From e9973fbc8954f5e0006c199b3fdafcc92d400838 Mon Sep 17 00:00:00 2001 From: Pavlo Machekhin Date: Wed, 14 Jun 2023 15:41:42 +0300 Subject: [PATCH] Release v5.0.0-beta.0: Switch to SDK generated with openapi-generator --- .gitattributes | 4 +- .gitignore | 23 +- .openapi-generator-ignore | 23 + .openapi-generator/FILES | 1556 +++ .openapi-generator/VERSION | 1 + CHANGELOG.md | 12 + LICENSE | 2 +- MIGRATION-5.x.md | 312 + README.md | 9666 +++-------------- composer.json | 26 +- docs/Api/ActivitiesApi.md | 497 + docs/Api/ActivityFieldsApi.md | 70 + docs/Api/ActivityTypesApi.md | 336 + docs/Api/BillingApi.md | 70 + docs/Api/CallLogsApi.md | 341 + docs/Api/ChannelsApi.md | 273 + docs/Api/CurrenciesApi.md | 73 + docs/Api/DealFieldsApi.md | 407 + docs/Api/DealsApi.md | 1973 ++++ docs/Api/FilesApi.md | 569 + docs/Api/FiltersApi.md | 465 + docs/Api/GoalsApi.md | 367 + docs/Api/ItemSearchApi.md | 165 + docs/Api/LeadLabelsApi.md | 270 + docs/Api/LeadSourcesApi.md | 70 + docs/Api/LeadsApi.md | 496 + docs/Api/LegacyTeamsApi.md | 549 + docs/Api/MailboxApi.md | 419 + docs/Api/NoteFieldsApi.md | 70 + docs/Api/NotesApi.md | 709 ++ docs/Api/OrganizationFieldsApi.md | 407 + docs/Api/OrganizationRelationshipsApi.md | 341 + docs/Api/OrganizationsApi.md | 1255 +++ docs/Api/PermissionSetsApi.md | 209 + docs/Api/PersonFieldsApi.md | 407 + docs/Api/PersonsApi.md | 1396 +++ docs/Api/PipelinesApi.md | 564 + docs/Api/ProductFieldsApi.md | 407 + docs/Api/ProductsApi.md | 843 ++ docs/Api/RecentsApi.md | 79 + docs/Api/RolesApi.md | 817 ++ docs/Api/StagesApi.md | 487 + docs/Api/SubscriptionsApi.md | 607 ++ docs/Api/UserConnectionsApi.md | 70 + docs/Api/UserSettingsApi.md | 70 + docs/Api/UsersApi.md | 669 ++ docs/Api/WebhooksApi.md | 202 + .../Model/ActivityCollectionResponseObject.md | 44 + .../ActivityCollectionResponseObjectAllOf.md | 34 + docs/Model/ActivityDistributionData.md | 9 + ...ityDistributionDataActivityDistribution.md | 9 + ...ataActivityDistributionASSIGNEDTOUSERID.md | 12 + ...yDistributionASSIGNEDTOUSERIDActivities.md | 9 + ...ivityDistributionDataWithAdditionalData.md | 12 + docs/Model/ActivityInfo.md | 13 + docs/Model/ActivityObjectFragment.md | 18 + docs/Model/ActivityPostObject.md | 26 + docs/Model/ActivityPostObjectAllOf.md | 16 + docs/Model/ActivityPutObject.md | 26 + docs/Model/ActivityPutObjectAllOf.md | 16 + docs/Model/ActivityRecordAdditionalData.md | 9 + docs/Model/ActivityResponseObject.md | 69 + docs/Model/ActivityResponseObjectAllOf.md | 59 + docs/Model/ActivityTypeBulkDeleteResponse.md | 10 + .../ActivityTypeBulkDeleteResponseAllOf.md | 9 + ...ActivityTypeBulkDeleteResponseAllOfData.md | 9 + docs/Model/ActivityTypeCreateRequest.md | 11 + .../ActivityTypeCreateUpdateDeleteResponse.md | 10 + ...vityTypeCreateUpdateDeleteResponseAllOf.md | 9 + docs/Model/ActivityTypeListResponse.md | 10 + docs/Model/ActivityTypeListResponseAllOf.md | 9 + docs/Model/ActivityTypeObjectResponse.md | 18 + docs/Model/ActivityTypeUpdateRequest.md | 12 + docs/Model/AddActivityResponse200.md | 12 + .../AddActivityResponse200RelatedObjects.md | 12 + docs/Model/AddDealFollowerRequest.md | 9 + docs/Model/AddDealParticipantRequest.md | 9 + docs/Model/AddFile.md | 10 + docs/Model/AddFilterRequest.md | 11 + docs/Model/AddFollowerToPersonResponse.md | 10 + .../Model/AddFollowerToPersonResponseAllOf.md | 9 + .../AddFollowerToPersonResponseAllOfData.md | 12 + docs/Model/AddLeadLabelRequest.md | 10 + docs/Model/AddLeadRequest.md | 17 + docs/Model/AddNewPipeline.md | 10 + docs/Model/AddNewPipelineAllOf.md | 9 + docs/Model/AddNoteRequest.md | 19 + docs/Model/AddNoteRequestAllOf.md | 13 + docs/Model/AddOrUpdateGoalResponse200.md | 10 + docs/Model/AddOrUpdateLeadLabelResponse200.md | 10 + docs/Model/AddOrUpdateRoleSettingRequest.md | 10 + docs/Model/AddOrganizationFollowerRequest.md | 9 + .../AddOrganizationRelationshipRequest.md | 12 + docs/Model/AddPersonFollowerRequest.md | 9 + docs/Model/AddPersonPictureResponse.md | 10 + docs/Model/AddPersonPictureResponseAllOf.md | 9 + docs/Model/AddPersonResponse.md | 11 + docs/Model/AddPersonResponseAllOf.md | 10 + docs/Model/AddProductAttachmentDetails.md | 29 + .../Model/AddProductAttachmentDetailsAllOf.md | 9 + docs/Model/AddProductFollowerRequest.md | 9 + docs/Model/AddProductRequestBody.md | 17 + docs/Model/AddRole.md | 10 + docs/Model/AddRoleAssignmentRequest.md | 9 + docs/Model/AddTeamUserRequest.md | 9 + docs/Model/AddUserRequest.md | 11 + docs/Model/AddWebhookRequest.md | 15 + docs/Model/AddedDealFollower.md | 10 + docs/Model/AddedDealFollowerData.md | 12 + .../AdditionalBaseOrganizationItemInfo.md | 40 + docs/Model/AdditionalData.md | 11 + .../AdditionalDataWithCursorPagination.md | 9 + .../AdditionalDataWithOffsetPagination.md | 9 + .../AdditionalDataWithPaginationDetails.md | 9 + docs/Model/AdditionalMergePersonInfo.md | 38 + docs/Model/AdditionalPersonInfo.md | 35 + ...AllOrganizationRelationshipsGetResponse.md | 12 + ...ganizationRelationshipsGetResponseAllOf.md | 11 + ...tionshipsGetResponseAllOfRelatedObjects.md | 9 + docs/Model/AllOrganizationsGetResponse.md | 12 + .../Model/AllOrganizationsGetResponseAllOf.md | 11 + ...nizationsGetResponseAllOfRelatedObjects.md | 11 + docs/Model/ArrayPrices.md | 9 + docs/Model/Assignee.md | 10 + docs/Model/BaseComment.md | 18 + docs/Model/BaseCurrency.md | 15 + docs/Model/BaseDeal.md | 60 + docs/Model/BaseFollowerItem.md | 11 + docs/Model/BaseMailThread.md | 45 + docs/Model/BaseMailThreadAllOf.md | 31 + docs/Model/BaseMailThreadAllOfParties.md | 10 + docs/Model/BaseMailThreadMessages.md | 35 + docs/Model/BaseMailThreadMessagesAllOf.md | 21 + docs/Model/BaseNote.md | 26 + docs/Model/BaseNoteDealTitle.md | 9 + docs/Model/BaseNoteOrganization.md | 9 + docs/Model/BaseNotePerson.md | 9 + docs/Model/BaseOrganizationItem.md | 54 + docs/Model/BaseOrganizationItemFields.md | 22 + .../BaseOrganizationItemWithEditNameFlag.md | 55 + ...seOrganizationItemWithEditNameFlagAllOf.md | 9 + .../Model/BaseOrganizationRelationshipItem.md | 15 + docs/Model/BasePersonItem.md | 22 + docs/Model/BasePersonItemEmail.md | 11 + docs/Model/BasePersonItemPhone.md | 11 + docs/Model/BasePipeline.md | 16 + docs/Model/BasePipelineWithSelectedFlag.md | 17 + .../BasePipelineWithSelectedFlagAllOf.md | 9 + docs/Model/BaseProduct.md | 17 + docs/Model/BaseResponse.md | 9 + docs/Model/BaseResponseWithStatus.md | 10 + docs/Model/BaseResponseWithStatusAllOf.md | 9 + docs/Model/BaseRole.md | 10 + docs/Model/BaseStage.md | 18 + docs/Model/BaseTeam.md | 17 + docs/Model/BaseTeamAdditionalProperties.md | 10 + docs/Model/BaseUser.md | 27 + docs/Model/BaseUserMe.md | 33 + docs/Model/BaseUserMeAllOf.md | 14 + docs/Model/BaseUserMeAllOfLanguage.md | 10 + docs/Model/BaseWebhook.md | 26 + docs/Model/BasicDeal.md | 20 + docs/Model/BasicDealProduct.md | 18 + docs/Model/BasicGoal.md | 14 + docs/Model/BasicOrganization.md | 10 + docs/Model/BasicPerson.md | 15 + docs/Model/BasicPersonEmail.md | 11 + docs/Model/BulkDeleteResponse.md | 10 + docs/Model/BulkDeleteResponseAllOf.md | 9 + docs/Model/BulkDeleteResponseAllOfData.md | 9 + docs/Model/CalculatedFields.md | 10 + docs/Model/CallLogObject.md | 21 + docs/Model/CallLogResponse200.md | 10 + docs/Model/CallLogResponse400.md | 13 + docs/Model/CallLogResponse403.md | 13 + docs/Model/CallLogResponse404.md | 13 + docs/Model/CallLogResponse409.md | 13 + docs/Model/CallLogResponse410.md | 13 + docs/Model/CallLogResponse500.md | 13 + docs/Model/CallLogsResponse.md | 11 + docs/Model/CallLogsResponseAdditionalData.md | 9 + docs/Model/ChannelObject.md | 13 + docs/Model/ChannelObjectResponse.md | 10 + docs/Model/ChannelObjectResponseData.md | 18 + docs/Model/CommentPostPutObject.md | 9 + docs/Model/CommonMailThread.md | 22 + docs/Model/CreateRemoteFileAndLinkItToItem.md | 10 + docs/Model/CreateTeam.md | 12 + docs/Model/Currencies.md | 10 + docs/Model/DealCollectionResponseObject.md | 29 + docs/Model/DealCountAndActivityInfo.md | 21 + docs/Model/DealFlowResponse.md | 12 + docs/Model/DealFlowResponseAllOf.md | 11 + docs/Model/DealFlowResponseAllOfData.md | 11 + .../DealFlowResponseAllOfRelatedObjects.md | 12 + docs/Model/DealListActivitiesResponse.md | 12 + docs/Model/DealListActivitiesResponseAllOf.md | 11 + ...stActivitiesResponseAllOfRelatedObjects.md | 12 + docs/Model/DealNonStrict.md | 65 + docs/Model/DealNonStrictModeFields.md | 13 + .../DealNonStrictModeFieldsCreatorUserId.md | 15 + docs/Model/DealNonStrictWithDetails.md | 71 + docs/Model/DealNonStrictWithDetailsAllOf.md | 14 + .../Model/DealNonStrictWithDetailsAllOfAge.md | 15 + ...nStrictWithDetailsAllOfAverageTimeToWon.md | 15 + ...ictWithDetailsAllOfStayInPipelineStages.md | 10 + docs/Model/DealOrganizationData.md | 14 + docs/Model/DealOrganizationDataWithId.md | 15 + docs/Model/DealOrganizationDataWithIdAllOf.md | 9 + docs/Model/DealParticipantCountInfo.md | 10 + docs/Model/DealParticipants.md | 12 + docs/Model/DealPersonData.md | 13 + docs/Model/DealPersonDataEmail.md | 11 + docs/Model/DealPersonDataPhone.md | 11 + docs/Model/DealPersonDataWithId.md | 14 + docs/Model/DealPersonDataWithIdAllOf.md | 9 + docs/Model/DealProductUnitDuration.md | 8 + docs/Model/DealSearchItem.md | 10 + docs/Model/DealSearchItemItem.md | 21 + docs/Model/DealSearchItemItemOrganization.md | 10 + docs/Model/DealSearchItemItemOwner.md | 9 + docs/Model/DealSearchItemItemPerson.md | 10 + docs/Model/DealSearchItemItemStage.md | 10 + docs/Model/DealSearchResponse.md | 11 + docs/Model/DealSearchResponseAllOf.md | 10 + docs/Model/DealSearchResponseAllOfData.md | 9 + docs/Model/DealStrict.md | 65 + docs/Model/DealStrictModeFields.md | 13 + docs/Model/DealStrictWithMergeId.md | 66 + docs/Model/DealStrictWithMergeIdAllOf.md | 9 + docs/Model/DealSummary.md | 12 + docs/Model/DealSummaryPerCurrency.md | 9 + docs/Model/DealSummaryPerCurrencyFull.md | 9 + .../DealSummaryPerCurrencyFullCURRENCYID.md | 10 + docs/Model/DealSummaryPerStages.md | 9 + docs/Model/DealSummaryPerStagesSTAGEID.md | 9 + .../DealSummaryPerStagesSTAGEIDCURRENCYID.md | 13 + docs/Model/DealTitleParameter.md | 9 + docs/Model/DealUserData.md | 14 + docs/Model/DealUserDataWithId.md | 15 + docs/Model/DealUserDataWithIdAllOf.md | 9 + docs/Model/DealsCountAndActivityInfo.md | 21 + docs/Model/DealsCountInfo.md | 16 + docs/Model/DealsMovementsInfo.md | 12 + .../DealsMovementsInfoFormattedValues.md | 9 + docs/Model/DealsMovementsInfoValues.md | 9 + docs/Model/DeleteActivitiesResponse200.md | 10 + docs/Model/DeleteActivitiesResponse200Data.md | 9 + docs/Model/DeleteActivityResponse200.md | 10 + docs/Model/DeleteActivityResponse200Data.md | 9 + docs/Model/DeleteChannelSuccess.md | 9 + docs/Model/DeleteComment.md | 10 + docs/Model/DeleteConversationSuccess.md | 9 + docs/Model/DeleteDeal.md | 10 + docs/Model/DeleteDealData.md | 9 + docs/Model/DeleteDealFollower.md | 10 + docs/Model/DeleteDealFollowerData.md | 9 + docs/Model/DeleteDealParticipant.md | 10 + docs/Model/DeleteDealParticipantData.md | 9 + docs/Model/DeleteDealProduct.md | 10 + docs/Model/DeleteDealProductData.md | 9 + docs/Model/DeleteFile.md | 10 + docs/Model/DeleteFileData.md | 9 + docs/Model/DeleteGoalResponse200.md | 9 + docs/Model/DeleteMultipleDeals.md | 10 + docs/Model/DeleteMultipleDealsData.md | 9 + .../DeleteMultipleProductFieldsResponse.md | 10 + ...DeleteMultipleProductFieldsResponseData.md | 9 + docs/Model/DeleteNote.md | 10 + docs/Model/DeletePersonResponse.md | 10 + docs/Model/DeletePersonResponseAllOf.md | 9 + docs/Model/DeletePersonResponseAllOfData.md | 9 + docs/Model/DeletePersonsInBulkResponse.md | 10 + .../Model/DeletePersonsInBulkResponseAllOf.md | 9 + .../DeletePersonsInBulkResponseAllOfData.md | 9 + docs/Model/DeletePipelineResponse200.md | 10 + docs/Model/DeletePipelineResponse200Data.md | 9 + docs/Model/DeleteProductFieldResponse.md | 10 + docs/Model/DeleteProductFieldResponseData.md | 9 + docs/Model/DeleteProductFollowerResponse.md | 10 + .../DeleteProductFollowerResponseData.md | 9 + docs/Model/DeleteProductResponse.md | 10 + docs/Model/DeleteProductResponseData.md | 9 + docs/Model/DeleteResponse.md | 10 + docs/Model/DeleteResponseAllOf.md | 9 + docs/Model/DeleteResponseAllOfData.md | 9 + docs/Model/DeleteRole.md | 10 + docs/Model/DeleteRoleAllOf.md | 9 + docs/Model/DeleteRoleAllOfData.md | 9 + docs/Model/DeleteRoleAssignment.md | 10 + docs/Model/DeleteRoleAssignmentAllOf.md | 9 + docs/Model/DeleteRoleAssignmentAllOfData.md | 9 + docs/Model/DeleteRoleAssignmentRequest.md | 9 + docs/Model/DeleteStageResponse200.md | 10 + docs/Model/DeleteStageResponse200Data.md | 9 + docs/Model/DeleteStagesResponse200.md | 10 + docs/Model/DeleteStagesResponse200Data.md | 9 + docs/Model/DeleteTeamUserRequest.md | 9 + docs/Model/Duration.md | 10 + docs/Model/EditPipeline.md | 10 + docs/Model/EditPipelineAllOf.md | 9 + docs/Model/EmailInfo.md | 10 + docs/Model/ExpectedOutcome.md | 10 + docs/Model/FailResponse.md | 10 + docs/Model/Field.md | 31 + docs/Model/FieldCreateRequest.md | 12 + docs/Model/FieldCreateRequestAllOf.md | 11 + docs/Model/FieldResponse.md | 10 + docs/Model/FieldResponseAllOf.md | 9 + docs/Model/FieldType.md | 9 + docs/Model/FieldTypeAsString.md | 8 + docs/Model/FieldUpdateRequest.md | 11 + docs/Model/FieldsResponse.md | 11 + docs/Model/FieldsResponseAllOf.md | 10 + docs/Model/FileData.md | 36 + docs/Model/FileItem.md | 36 + docs/Model/FilterGetItem.md | 17 + docs/Model/FilterType.md | 8 + docs/Model/FiltersBulkDeleteResponse.md | 10 + docs/Model/FiltersBulkDeleteResponseAllOf.md | 9 + .../FiltersBulkDeleteResponseAllOfData.md | 9 + docs/Model/FiltersBulkGetResponse.md | 10 + docs/Model/FiltersBulkGetResponseAllOf.md | 9 + docs/Model/FiltersDeleteResponse.md | 10 + docs/Model/FiltersDeleteResponseAllOf.md | 9 + docs/Model/FiltersDeleteResponseAllOfData.md | 9 + docs/Model/FiltersGetResponse.md | 10 + docs/Model/FiltersGetResponseAllOf.md | 9 + docs/Model/FiltersPostResponse.md | 10 + docs/Model/FiltersPostResponseAllOf.md | 9 + docs/Model/FiltersPostResponseAllOfData.md | 19 + docs/Model/FindGoalResponse.md | 9 + docs/Model/FollowerData.md | 12 + docs/Model/FollowerDataWithID.md | 13 + docs/Model/FollowerDataWithIDAllOf.md | 9 + docs/Model/FullRole.md | 15 + docs/Model/FullRoleAllOf.md | 9 + .../GetActivitiesCollectionResponse200.md | 11 + docs/Model/GetActivitiesResponse200.md | 12 + .../GetActivitiesResponse200RelatedObjects.md | 12 + docs/Model/GetActivityResponse200.md | 11 + docs/Model/GetAddProductAttachementDetails.md | 10 + docs/Model/GetAddUpdateStage.md | 10 + docs/Model/GetAddedDeal.md | 11 + docs/Model/GetAllFiles.md | 11 + docs/Model/GetAllPersonsResponse.md | 12 + docs/Model/GetAllPersonsResponseAllOf.md | 11 + docs/Model/GetAllPipelines.md | 10 + docs/Model/GetAllPipelinesAllOf.md | 9 + docs/Model/GetAllProductFieldsResponse.md | 11 + docs/Model/GetComments.md | 11 + docs/Model/GetDeal.md | 12 + docs/Model/GetDealAdditionalData.md | 9 + docs/Model/GetDeals.md | 12 + docs/Model/GetDealsCollection.md | 11 + .../GetDealsConversionRatesInPipeline.md | 10 + .../GetDealsConversionRatesInPipelineAllOf.md | 9 + ...DealsConversionRatesInPipelineAllOfData.md | 11 + docs/Model/GetDealsMovementsInPipeline.md | 10 + .../Model/GetDealsMovementsInPipelineAllOf.md | 9 + .../GetDealsMovementsInPipelineAllOfData.md | 14 + ...entsInPipelineAllOfDataAverageAgeInDays.md | 10 + ...pelineAllOfDataAverageAgeInDaysByStages.md | 10 + ...PipelineAllOfDataMovementsBetweenStages.md | 9 + docs/Model/GetDealsRelatedObjects.md | 11 + docs/Model/GetDealsSummary.md | 10 + docs/Model/GetDealsSummaryData.md | 15 + docs/Model/GetDealsSummaryDataValuesTotal.md | 13 + .../GetDealsSummaryDataWeightedValuesTotal.md | 11 + docs/Model/GetDealsTimeline.md | 10 + docs/Model/GetDealsTimelineData.md | 12 + docs/Model/GetDealsTimelineDataTotals.md | 16 + docs/Model/GetDuplicatedDeal.md | 10 + docs/Model/GetGoalResultResponse200.md | 10 + docs/Model/GetGoalsResponse200.md | 10 + docs/Model/GetLeadLabelsResponse200.md | 10 + docs/Model/GetLeadSourcesResponse200.md | 10 + docs/Model/GetLeadSourcesResponse200Data.md | 9 + docs/Model/GetLeadsResponse200.md | 11 + docs/Model/GetMergedDeal.md | 10 + docs/Model/GetNotes.md | 11 + docs/Model/GetOneFile.md | 10 + docs/Model/GetOnePipeline.md | 10 + docs/Model/GetOnePipelineAllOf.md | 9 + docs/Model/GetOneStage.md | 10 + docs/Model/GetPersonDetailsResponse.md | 12 + docs/Model/GetPersonDetailsResponseAllOf.md | 11 + ...ersonDetailsResponseAllOfAdditionalData.md | 9 + docs/Model/GetProductAttachementDetails.md | 10 + docs/Model/GetProductFieldResponse.md | 10 + docs/Model/GetRecents.md | 11 + docs/Model/GetRecentsAdditionalData.md | 11 + docs/Model/GetRole.md | 11 + docs/Model/GetRoleAllOf.md | 10 + docs/Model/GetRoleAllOfAdditionalData.md | 9 + docs/Model/GetRoleAssignments.md | 11 + docs/Model/GetRoleAssignmentsAllOf.md | 10 + docs/Model/GetRolePipelines.md | 10 + docs/Model/GetRolePipelinesAllOf.md | 9 + docs/Model/GetRolePipelinesAllOfData.md | 10 + docs/Model/GetRoleSettings.md | 10 + docs/Model/GetRoleSettingsAllOf.md | 9 + docs/Model/GetRoles.md | 11 + docs/Model/GetRolesAllOf.md | 10 + docs/Model/GetStageDeals.md | 11 + docs/Model/GetStages.md | 10 + docs/Model/GoalResults.md | 10 + docs/Model/GoalType.md | 10 + docs/Model/GoalsResponseComponent.md | 18 + docs/Model/IconKey.md | 8 + docs/Model/InlineResponse200.md | 10 + docs/Model/InlineResponse400.md | 12 + docs/Model/InlineResponse4001.md | 12 + .../Model/InlineResponse4001AdditionalData.md | 9 + docs/Model/InlineResponse400AdditionalData.md | 9 + docs/Model/InlineResponse403.md | 12 + docs/Model/InlineResponse4031.md | 12 + .../Model/InlineResponse4031AdditionalData.md | 9 + docs/Model/InlineResponse403AdditionalData.md | 9 + docs/Model/InlineResponse404.md | 12 + docs/Model/InlineResponse404AdditionalData.md | 9 + docs/Model/ItemSearchAdditionalData.md | 9 + .../ItemSearchAdditionalDataPagination.md | 12 + docs/Model/ItemSearchFieldResponse.md | 11 + docs/Model/ItemSearchFieldResponseAllOf.md | 10 + .../Model/ItemSearchFieldResponseAllOfData.md | 10 + docs/Model/ItemSearchItem.md | 10 + docs/Model/ItemSearchResponse.md | 11 + docs/Model/ItemSearchResponseAllOf.md | 10 + docs/Model/ItemSearchResponseAllOfData.md | 10 + docs/Model/LeadIdResponse200.md | 10 + docs/Model/LeadIdResponse200Data.md | 9 + docs/Model/LeadLabelColor.md | 8 + docs/Model/LeadLabelResponse.md | 13 + docs/Model/LeadResponse.md | 25 + docs/Model/LeadResponse404.md | 13 + docs/Model/LeadSearchItem.md | 10 + docs/Model/LeadSearchItemItem.md | 22 + docs/Model/LeadSearchItemItemOrganization.md | 10 + docs/Model/LeadSearchItemItemOwner.md | 9 + docs/Model/LeadSearchItemItemPerson.md | 10 + docs/Model/LeadSearchResponse.md | 11 + docs/Model/LeadSearchResponseAllOf.md | 10 + docs/Model/LeadSearchResponseAllOfData.md | 9 + docs/Model/LeadValue.md | 10 + docs/Model/LinkRemoteFileToItem.md | 10 + docs/Model/ListActivitiesResponse.md | 11 + docs/Model/ListActivitiesResponseAllOf.md | 10 + docs/Model/ListDealsResponse.md | 12 + docs/Model/ListDealsResponseAllOf.md | 11 + .../ListDealsResponseAllOfRelatedObjects.md | 13 + docs/Model/ListFilesResponse.md | 11 + docs/Model/ListFilesResponseAllOf.md | 10 + docs/Model/ListFollowersResponse.md | 11 + docs/Model/ListFollowersResponseAllOf.md | 10 + docs/Model/ListFollowersResponseAllOfData.md | 12 + docs/Model/ListMailMessagesResponse.md | 11 + docs/Model/ListMailMessagesResponseAllOf.md | 10 + .../ListMailMessagesResponseAllOfData.md | 11 + docs/Model/ListPermittedUsersResponse.md | 10 + docs/Model/ListPermittedUsersResponse1.md | 10 + .../Model/ListPermittedUsersResponse1AllOf.md | 9 + docs/Model/ListPermittedUsersResponseAllOf.md | 9 + .../ListPermittedUsersResponseAllOfData.md | 9 + docs/Model/ListPersonProductsResponse.md | 11 + docs/Model/ListPersonProductsResponseAllOf.md | 10 + .../ListPersonProductsResponseAllOfDEALID.md | 10 + .../ListPersonProductsResponseAllOfData.md | 9 + docs/Model/ListPersonsResponse.md | 12 + docs/Model/ListPersonsResponseAllOf.md | 11 + .../ListPersonsResponseAllOfRelatedObjects.md | 10 + docs/Model/ListProductAdditionalData.md | 13 + docs/Model/ListProductAdditionalDataAllOf.md | 12 + docs/Model/ListProductFilesResponse.md | 11 + docs/Model/ListProductFilesResponseAllOf.md | 10 + docs/Model/ListProductFollowersResponse.md | 11 + .../ListProductFollowersResponseAllOf.md | 10 + .../ListProductFollowersResponseAllOfData.md | 12 + docs/Model/ListProductsResponse.md | 12 + docs/Model/ListProductsResponseAllOf.md | 11 + docs/Model/ListProductsResponseAllOfData.md | 9 + ...ListProductsResponseAllOfRelatedObjects.md | 9 + docs/Model/MailMessage.md | 13 + docs/Model/MailMessageAllOf.md | 9 + docs/Model/MailMessageData.md | 36 + docs/Model/MailMessageItemForList.md | 45 + docs/Model/MailMessageItemForListAllOf.md | 17 + docs/Model/MailParticipant.md | 14 + docs/Model/MailServiceBaseResponse.md | 12 + docs/Model/MailThread.md | 10 + docs/Model/MailThreadAllOf.md | 9 + docs/Model/MailThreadDelete.md | 10 + docs/Model/MailThreadDeleteAllOf.md | 9 + docs/Model/MailThreadDeleteAllOfData.md | 9 + docs/Model/MailThreadMessages.md | 10 + docs/Model/MailThreadMessagesAllOf.md | 9 + docs/Model/MailThreadOne.md | 10 + docs/Model/MailThreadOneAllOf.md | 9 + docs/Model/MailThreadParticipant.md | 17 + docs/Model/MailThreadPut.md | 10 + docs/Model/MailThreadPutAllOf.md | 9 + docs/Model/MarketingStatus.md | 8 + docs/Model/MergeDealsRequest.md | 9 + docs/Model/MergeOrganizationsRequest.md | 9 + docs/Model/MergePersonDealRelatedInfo.md | 23 + docs/Model/MergePersonItem.md | 52 + docs/Model/MergePersonsRequest.md | 9 + docs/Model/MergePersonsResponse.md | 10 + docs/Model/MergePersonsResponseAllOf.md | 9 + docs/Model/MessageObject.md | 18 + docs/Model/MessageObjectAttachments.md | 15 + docs/Model/NewDeal.md | 22 + docs/Model/NewDealAllOf.md | 9 + docs/Model/NewDealProduct.md | 18 + docs/Model/NewFollowerResponse.md | 10 + docs/Model/NewFollowerResponseData.md | 12 + docs/Model/NewGoal.md | 14 + docs/Model/NewOrganization.md | 12 + docs/Model/NewOrganizationAllOf.md | 10 + docs/Model/NewPerson.md | 16 + docs/Model/NewPersonAllOf.md | 9 + docs/Model/NewProductField.md | 11 + docs/Model/Note.md | 19 + docs/Model/NoteAllOf.md | 9 + docs/Model/NoteConnectToParams.md | 12 + docs/Model/NoteCreatorUser.md | 12 + docs/Model/NoteField.md | 17 + docs/Model/NoteFieldOptions.md | 10 + docs/Model/NoteFieldsResponse.md | 11 + docs/Model/NoteFieldsResponseAllOf.md | 10 + docs/Model/NoteParams.md | 14 + docs/Model/NumberBoolean.md | 8 + docs/Model/NumberBooleanDefault0.md | 8 + docs/Model/NumberBooleanDefault1.md | 8 + docs/Model/ObjectPrices.md | 9 + docs/Model/OneLeadResponse200.md | 10 + docs/Model/OptionalNameObject.md | 9 + docs/Model/OrgAndOwnerId.md | 10 + docs/Model/OrganizationAddressInfo.md | 19 + docs/Model/OrganizationCountAndAddressInfo.md | 27 + docs/Model/OrganizationCountInfo.md | 16 + docs/Model/OrganizationData.md | 13 + docs/Model/OrganizationDataWithId.md | 14 + docs/Model/OrganizationDataWithIdAllOf.md | 9 + .../OrganizationDataWithIdAndActiveFlag.md | 15 + ...rganizationDataWithIdAndActiveFlagAllOf.md | 9 + docs/Model/OrganizationDeleteResponse.md | 10 + docs/Model/OrganizationDeleteResponseData.md | 9 + docs/Model/OrganizationDetailsGetResponse.md | 12 + .../OrganizationDetailsGetResponseAllOf.md | 11 + ...onDetailsGetResponseAllOfAdditionalData.md | 10 + docs/Model/OrganizationFlowResponse.md | 12 + docs/Model/OrganizationFlowResponseAllOf.md | 11 + .../OrganizationFlowResponseAllOfData.md | 11 + ...nizationFlowResponseAllOfRelatedObjects.md | 10 + .../OrganizationFollowerDeleteResponse.md | 10 + .../OrganizationFollowerDeleteResponseData.md | 9 + docs/Model/OrganizationFollowerItem.md | 12 + docs/Model/OrganizationFollowerItemAllOf.md | 9 + .../Model/OrganizationFollowerPostResponse.md | 10 + .../OrganizationFollowersListResponse.md | 11 + docs/Model/OrganizationItem.md | 57 + docs/Model/OrganizationItemAllOf.md | 10 + docs/Model/OrganizationPostResponse.md | 11 + docs/Model/OrganizationPostResponseAllOf.md | 10 + docs/Model/OrganizationRelationship.md | 12 + .../OrganizationRelationshipDeleteResponse.md | 10 + ...nizationRelationshipDeleteResponseAllOf.md | 9 + ...tionRelationshipDeleteResponseAllOfData.md | 9 + docs/Model/OrganizationRelationshipDetails.md | 18 + .../OrganizationRelationshipGetResponse.md | 11 + ...rganizationRelationshipGetResponseAllOf.md | 10 + .../OrganizationRelationshipPostResponse.md | 11 + ...ganizationRelationshipPostResponseAllOf.md | 10 + .../OrganizationRelationshipUpdateResponse.md | 11 + ...izationRelationshipWithCalculatedFields.md | 17 + docs/Model/OrganizationSearchItem.md | 10 + docs/Model/OrganizationSearchItemItem.md | 16 + docs/Model/OrganizationSearchResponse.md | 11 + docs/Model/OrganizationSearchResponseAllOf.md | 10 + .../OrganizationSearchResponseAllOfData.md | 9 + docs/Model/OrganizationUpdateResponse.md | 11 + docs/Model/OrganizationUpdateResponseAllOf.md | 10 + docs/Model/OrganizationsDeleteResponse.md | 10 + docs/Model/OrganizationsDeleteResponseData.md | 9 + docs/Model/OrganizationsMergeResponse.md | 10 + docs/Model/OrganizationsMergeResponseData.md | 9 + docs/Model/Owner.md | 15 + docs/Model/OwnerAllOf.md | 9 + docs/Model/PaginationDetails.md | 12 + docs/Model/PaginationDetailsAllOf.md | 9 + docs/Model/Params.md | 10 + docs/Model/PaymentItem.md | 21 + docs/Model/PaymentsResponse.md | 10 + docs/Model/PaymentsResponseAllOf.md | 9 + docs/Model/PermissionSets.md | 10 + docs/Model/PermissionSetsAllOf.md | 9 + docs/Model/PermissionSetsItem.md | 14 + docs/Model/PersonCountAndEmailInfo.md | 17 + .../PersonCountEmailDealAndActivityInfo.md | 30 + docs/Model/PersonCountInfo.md | 15 + docs/Model/PersonData.md | 13 + docs/Model/PersonDataEmail.md | 11 + docs/Model/PersonDataPhone.md | 11 + docs/Model/PersonDataWithActiveFlag.md | 14 + docs/Model/PersonDataWithActiveFlagAllOf.md | 9 + docs/Model/PersonFlowResponse.md | 12 + docs/Model/PersonFlowResponseAllOf.md | 11 + docs/Model/PersonFlowResponseAllOfData.md | 11 + docs/Model/PersonItem.md | 49 + docs/Model/PersonListProduct.md | 25 + docs/Model/PersonNameCountAndEmailInfo.md | 20 + .../PersonNameCountAndEmailInfoWithIds.md | 23 + ...PersonNameCountAndEmailInfoWithIdsAllOf.md | 11 + docs/Model/PersonNameInfo.md | 11 + docs/Model/PersonNameInfoWithOrgAndOwnerId.md | 13 + docs/Model/PersonSearchItem.md | 10 + docs/Model/PersonSearchItemItem.md | 18 + .../Model/PersonSearchItemItemOrganization.md | 10 + docs/Model/PersonSearchItemItemOwner.md | 9 + docs/Model/PersonSearchResponse.md | 11 + docs/Model/PersonSearchResponseAllOf.md | 10 + docs/Model/PersonSearchResponseAllOfData.md | 9 + docs/Model/PictureData.md | 15 + docs/Model/PictureDataPictures.md | 10 + docs/Model/PictureDataWithID.md | 16 + docs/Model/PictureDataWithIDAllOf.md | 9 + docs/Model/PictureDataWithValue.md | 16 + docs/Model/PictureDataWithValueAllOf.md | 9 + docs/Model/Pipeline.md | 12 + docs/Model/PipelineDetails.md | 18 + docs/Model/PipelineDetailsAllOf.md | 9 + docs/Model/PostComment.md | 10 + docs/Model/PostDealParticipants.md | 11 + docs/Model/PostGoalResponse.md | 9 + docs/Model/PostNote.md | 10 + docs/Model/PostRoleAssignment.md | 10 + docs/Model/PostRoleAssignmentAllOf.md | 9 + docs/Model/PostRoleAssignmentAllOfData.md | 10 + docs/Model/PostRoleSettings.md | 10 + docs/Model/PostRoleSettingsAllOf.md | 9 + docs/Model/PostRoleSettingsAllOfData.md | 10 + docs/Model/PostRoles.md | 10 + docs/Model/PostRolesAllOf.md | 9 + docs/Model/PostRolesAllOfData.md | 9 + docs/Model/ProductAttachementFields.md | 21 + docs/Model/ProductAttachmentDetails.md | 28 + docs/Model/ProductBaseDeal.md | 51 + docs/Model/ProductField.md | 26 + docs/Model/ProductFieldAllOf.md | 23 + docs/Model/ProductFileItem.md | 23 + docs/Model/ProductListItem.md | 31 + docs/Model/ProductRequest.md | 16 + docs/Model/ProductResponse.md | 11 + docs/Model/ProductSearchItem.md | 10 + docs/Model/ProductSearchItemItem.md | 15 + docs/Model/ProductSearchItemItemOwner.md | 9 + docs/Model/ProductSearchResponse.md | 11 + docs/Model/ProductSearchResponseAllOf.md | 10 + docs/Model/ProductSearchResponseAllOfData.md | 9 + docs/Model/ProductWithArrayPrices.md | 18 + docs/Model/ProductWithObjectPrices.md | 18 + docs/Model/ProductsResponse.md | 12 + docs/Model/PutRole.md | 10 + docs/Model/PutRoleAllOf.md | 9 + docs/Model/PutRoleAllOfData.md | 9 + docs/Model/PutRolePipelinesBody.md | 9 + docs/Model/RecentDataProduct.md | 24 + docs/Model/RecentsActivity.md | 11 + docs/Model/RecentsActivityType.md | 11 + docs/Model/RecentsDeal.md | 11 + docs/Model/RecentsFile.md | 11 + docs/Model/RecentsFilter.md | 11 + docs/Model/RecentsNote.md | 11 + docs/Model/RecentsOrganization.md | 11 + docs/Model/RecentsPerson.md | 11 + docs/Model/RecentsPipeline.md | 11 + docs/Model/RecentsProduct.md | 11 + docs/Model/RecentsStage.md | 11 + docs/Model/RecentsUser.md | 11 + docs/Model/RelatedDealData.md | 9 + docs/Model/RelatedDealDataDEALID.md | 15 + docs/Model/RelatedFollowerData.md | 9 + docs/Model/RelatedOrganizationData.md | 9 + .../RelatedOrganizationDataWithActiveFlag.md | 9 + docs/Model/RelatedOrganizationName.md | 9 + docs/Model/RelatedPersonData.md | 9 + docs/Model/RelatedPersonDataWithActiveFlag.md | 9 + docs/Model/RelatedPictureData.md | 9 + docs/Model/RelatedUserData.md | 9 + .../Model/RelationshipOrganizationInfoItem.md | 14 + .../RelationshipOrganizationInfoItemAllOf.md | 9 + ...nshipOrganizationInfoItemWithActiveFlag.md | 15 + docs/Model/RequiredNameObject.md | 9 + docs/Model/RequredTitleParameter.md | 9 + docs/Model/ResponseCallLogObject.md | 24 + docs/Model/ResponseCallLogObjectAllOf.md | 11 + docs/Model/RoleAssignment.md | 14 + docs/Model/RoleAssignmentAllOf.md | 12 + docs/Model/RoleSettings.md | 17 + docs/Model/RolesAdditionalData.md | 9 + docs/Model/RolesAdditionalDataPagination.md | 11 + docs/Model/SinglePermissionSetsItem.md | 15 + docs/Model/SinglePermissionSetsItemAllOf.md | 9 + docs/Model/Stage.md | 13 + docs/Model/StageConversions.md | 11 + docs/Model/StageDetails.md | 19 + docs/Model/StageWithPipelineInfo.md | 20 + docs/Model/StageWithPipelineInfoAllOf.md | 10 + docs/Model/SubRole.md | 14 + docs/Model/SubRoleAllOf.md | 12 + docs/Model/SubscriptionAddonsResponse.md | 10 + docs/Model/SubscriptionAddonsResponseAllOf.md | 9 + .../SubscriptionInstallmentCreateRequest.md | 12 + .../SubscriptionInstallmentUpdateRequest.md | 10 + docs/Model/SubscriptionItem.md | 24 + .../SubscriptionRecurringCancelRequest.md | 9 + .../SubscriptionRecurringCreateRequest.md | 18 + .../SubscriptionRecurringUpdateRequest.md | 13 + docs/Model/SubscriptionsIdResponse.md | 10 + docs/Model/SubscriptionsIdResponseAllOf.md | 9 + docs/Model/Team.md | 10 + docs/Model/TeamAllOf.md | 9 + docs/Model/TeamId.md | 9 + docs/Model/Teams.md | 10 + docs/Model/TeamsAllOf.md | 9 + docs/Model/Unauthorized.md | 11 + docs/Model/UpdateActivityResponse200.md | 11 + docs/Model/UpdateDealProduct.md | 18 + docs/Model/UpdateDealRequest.md | 21 + docs/Model/UpdateFile.md | 10 + docs/Model/UpdateFilterRequest.md | 10 + docs/Model/UpdateLeadLabelRequest.md | 10 + docs/Model/UpdateLeadRequest.md | 18 + docs/Model/UpdateOrganization.md | 11 + docs/Model/UpdateOrganizationAllOf.md | 9 + docs/Model/UpdatePerson.md | 16 + docs/Model/UpdatePersonAllOf.md | 9 + docs/Model/UpdatePersonResponse.md | 11 + docs/Model/UpdateProductField.md | 10 + docs/Model/UpdateProductRequestBody.md | 17 + docs/Model/UpdateProductResponse.md | 11 + docs/Model/UpdateStageRequest.md | 14 + docs/Model/UpdateStageRequestAllOf.md | 9 + docs/Model/UpdateTeam.md | 14 + docs/Model/UpdateTeamAllOf.md | 10 + .../UpdateTeamWithAdditionalProperties.md | 16 + docs/Model/UpdateUserRequest.md | 9 + docs/Model/User.md | 10 + docs/Model/UserAccess.md | 11 + docs/Model/UserAllOf.md | 9 + docs/Model/UserAssignmentToPermissionSet.md | 11 + docs/Model/UserAssignmentsToPermissionSet.md | 10 + .../UserAssignmentsToPermissionSetAllOf.md | 9 + docs/Model/UserConnections.md | 10 + docs/Model/UserConnectionsAllOf.md | 9 + docs/Model/UserConnectionsAllOfData.md | 9 + docs/Model/UserData.md | 14 + docs/Model/UserDataWithId.md | 14 + docs/Model/UserIDs.md | 10 + docs/Model/UserIDsAllOf.md | 9 + docs/Model/UserMe.md | 10 + docs/Model/UserMeAllOf.md | 9 + docs/Model/UserPermissions.md | 10 + docs/Model/UserPermissionsAllOf.md | 9 + docs/Model/UserPermissionsItem.md | 39 + docs/Model/UserSettings.md | 10 + docs/Model/UserSettingsAllOf.md | 9 + docs/Model/UserSettingsItem.md | 18 + docs/Model/Users.md | 10 + docs/Model/UsersAllOf.md | 9 + docs/Model/VisibleTo.md | 8 + docs/Model/Webhook.md | 11 + docs/Model/WebhookAllOf.md | 9 + docs/Model/WebhookBadRequest.md | 11 + docs/Model/WebhookBadRequestAllOf.md | 9 + docs/Model/Webhooks.md | 11 + docs/Model/WebhooksAllOf.md | 9 + docs/Model/WebhooksDeleteForbiddenSchema.md | 10 + .../WebhooksDeleteForbiddenSchemaAllOf.md | 9 + lib/Api/ActivitiesApi.php | 2393 ++++ lib/Api/ActivityFieldsApi.php | 419 + lib/Api/ActivityTypesApi.php | 1605 +++ lib/Api/BillingApi.php | 419 + lib/Api/CallLogsApi.php | 1897 ++++ lib/Api/ChannelsApi.php | 1455 +++ lib/Api/CurrenciesApi.php | 432 + lib/Api/DealFieldsApi.php | 1927 ++++ lib/Api/DealsApi.php | 9249 ++++++++++++++++ lib/Api/FilesApi.php | 2711 +++++ lib/Api/FiltersApi.php | 2182 ++++ lib/Api/GoalsApi.php | 1814 ++++ lib/Api/ItemSearchApi.php | 918 ++ lib/Api/LeadLabelsApi.php | 1351 +++ lib/Api/LeadSourcesApi.php | 419 + lib/Api/LeadsApi.php | 2447 +++++ lib/Api/LegacyTeamsApi.php | 2809 +++++ lib/Api/MailboxApi.php | 2003 ++++ lib/Api/NoteFieldsApi.php | 419 + lib/Api/NotesApi.php | 3375 ++++++ lib/Api/OrganizationFieldsApi.php | 1927 ++++ lib/Api/OrganizationRelationshipsApi.php | 1638 +++ lib/Api/OrganizationsApi.php | 5869 ++++++++++ lib/Api/PermissionSetsApi.php | 1092 ++ lib/Api/PersonFieldsApi.php | 1927 ++++ lib/Api/PersonsApi.php | 6527 +++++++++++ lib/Api/PipelinesApi.php | 2716 +++++ lib/Api/ProductFieldsApi.php | 1969 ++++ lib/Api/ProductsApi.php | 3968 +++++++ lib/Api/RecentsApi.php | 478 + lib/Api/RolesApi.php | 3786 +++++++ lib/Api/StagesApi.php | 2314 ++++ lib/Api/SubscriptionsApi.php | 2822 +++++ lib/Api/UserConnectionsApi.php | 440 + lib/Api/UserSettingsApi.php | 440 + lib/Api/UsersApi.php | 3230 ++++++ lib/Api/WebhooksApi.php | 1128 ++ lib/ApiException.php | 121 + lib/Configuration.php | 855 ++ lib/Exceptions/OAuthProviderException.php | 40 + lib/HeaderSelector.php | 105 + .../ActivityCollectionResponseObject.php | 1392 +++ .../ActivityCollectionResponseObjectAllOf.php | 1092 ++ lib/Model/ActivityDistributionData.php | 342 + ...tyDistributionDataActivityDistribution.php | 343 + ...taActivityDistributionASSIGNEDTOUSERID.php | 433 + ...DistributionASSIGNEDTOUSERIDActivities.php | 343 + ...vityDistributionDataWithAdditionalData.php | 432 + lib/Model/ActivityInfo.php | 462 + lib/Model/ActivityObjectFragment.php | 612 ++ lib/Model/ActivityPostObject.php | 852 ++ lib/Model/ActivityPostObjectAllOf.php | 552 + lib/Model/ActivityPutObject.php | 852 ++ lib/Model/ActivityPutObjectAllOf.php | 552 + lib/Model/ActivityRecordAdditionalData.php | 342 + lib/Model/ActivityResponseObject.php | 2142 ++++ lib/Model/ActivityResponseObjectAllOf.php | 1842 ++++ lib/Model/ActivityTypeBulkDeleteResponse.php | 372 + .../ActivityTypeBulkDeleteResponseAllOf.php | 342 + ...ctivityTypeBulkDeleteResponseAllOfData.php | 342 + lib/Model/ActivityTypeCreateRequest.php | 408 + ...ActivityTypeCreateUpdateDeleteResponse.php | 372 + ...ityTypeCreateUpdateDeleteResponseAllOf.php | 342 + lib/Model/ActivityTypeListResponse.php | 372 + lib/Model/ActivityTypeListResponseAllOf.php | 342 + lib/Model/ActivityTypeObjectResponse.php | 612 ++ lib/Model/ActivityTypeUpdateRequest.php | 432 + lib/Model/AddActivityResponse200.php | 432 + .../AddActivityResponse200RelatedObjects.php | 432 + lib/Model/AddDealFollowerRequest.php | 345 + lib/Model/AddDealParticipantRequest.php | 345 + lib/Model/AddFile.php | 372 + lib/Model/AddFilterRequest.php | 411 + lib/Model/AddFollowerToPersonResponse.php | 372 + .../AddFollowerToPersonResponseAllOf.php | 342 + .../AddFollowerToPersonResponseAllOfData.php | 432 + lib/Model/AddLeadLabelRequest.php | 378 + lib/Model/AddLeadRequest.php | 585 + lib/Model/AddNewPipeline.php | 372 + lib/Model/AddNewPipelineAllOf.php | 342 + lib/Model/AddNoteRequest.php | 645 ++ lib/Model/AddNoteRequestAllOf.php | 465 + lib/Model/AddOrUpdateGoalResponse200.php | 372 + lib/Model/AddOrUpdateLeadLabelResponse200.php | 372 + lib/Model/AddOrUpdateRoleSettingRequest.php | 460 + lib/Model/AddOrganizationFollowerRequest.php | 345 + .../AddOrganizationRelationshipRequest.php | 477 + lib/Model/AddPersonFollowerRequest.php | 345 + lib/Model/AddPersonPictureResponse.php | 372 + lib/Model/AddPersonPictureResponseAllOf.php | 342 + lib/Model/AddPersonResponse.php | 402 + lib/Model/AddPersonResponseAllOf.php | 372 + lib/Model/AddProductAttachmentDetails.php | 951 ++ .../AddProductAttachmentDetailsAllOf.php | 342 + lib/Model/AddProductFollowerRequest.php | 345 + lib/Model/AddProductRequestBody.php | 585 + lib/Model/AddRole.php | 376 + lib/Model/AddRoleAssignmentRequest.php | 345 + lib/Model/AddTeamUserRequest.php | 345 + lib/Model/AddUserRequest.php | 405 + lib/Model/AddWebhookRequest.php | 663 ++ lib/Model/AddedDealFollower.php | 372 + lib/Model/AddedDealFollowerData.php | 432 + .../AdditionalBaseOrganizationItemInfo.php | 1272 +++ lib/Model/AdditionalData.php | 403 + .../AdditionalDataWithCursorPagination.php | 343 + .../AdditionalDataWithOffsetPagination.php | 342 + .../AdditionalDataWithPaginationDetails.php | 342 + lib/Model/AdditionalMergePersonInfo.php | 1212 +++ lib/Model/AdditionalPersonInfo.php | 1122 ++ ...llOrganizationRelationshipsGetResponse.php | 432 + ...anizationRelationshipsGetResponseAllOf.php | 402 + ...ionshipsGetResponseAllOfRelatedObjects.php | 342 + lib/Model/AllOrganizationsGetResponse.php | 432 + .../AllOrganizationsGetResponseAllOf.php | 402 + ...izationsGetResponseAllOfRelatedObjects.php | 402 + lib/Model/AnyOfRecents.php | 215 + lib/Model/ArrayPrices.php | 342 + lib/Model/Assignee.php | 373 + lib/Model/BaseComment.php | 612 ++ lib/Model/BaseCurrency.php | 522 + lib/Model/BaseDeal.php | 1872 ++++ lib/Model/BaseFollowerItem.php | 402 + lib/Model/BaseMailThread.php | 1422 +++ lib/Model/BaseMailThreadAllOf.php | 1002 ++ lib/Model/BaseMailThreadAllOfParties.php | 373 + lib/Model/BaseMailThreadMessages.php | 1122 ++ lib/Model/BaseMailThreadMessagesAllOf.php | 702 ++ lib/Model/BaseNote.php | 852 ++ lib/Model/BaseNoteDealTitle.php | 343 + lib/Model/BaseNoteOrganization.php | 343 + lib/Model/BaseNotePerson.php | 343 + lib/Model/BaseOrganizationItem.php | 1692 +++ lib/Model/BaseOrganizationItemFields.php | 732 ++ .../BaseOrganizationItemWithEditNameFlag.php | 1722 +++ ...eOrganizationItemWithEditNameFlagAllOf.php | 342 + .../BaseOrganizationRelationshipItem.php | 522 + lib/Model/BasePersonItem.php | 732 ++ lib/Model/BasePersonItemEmail.php | 402 + lib/Model/BasePersonItemPhone.php | 402 + lib/Model/BasePipeline.php | 552 + lib/Model/BasePipelineWithSelectedFlag.php | 582 + .../BasePipelineWithSelectedFlagAllOf.php | 342 + lib/Model/BaseProduct.php | 582 + lib/Model/BaseResponse.php | 342 + lib/Model/BaseResponseWithStatus.php | 372 + lib/Model/BaseResponseWithStatusAllOf.php | 342 + lib/Model/BaseRole.php | 373 + lib/Model/BaseStage.php | 612 ++ lib/Model/BaseTeam.php | 582 + lib/Model/BaseTeamAdditionalProperties.php | 372 + lib/Model/BaseUser.php | 882 ++ lib/Model/BaseUserMe.php | 1062 ++ lib/Model/BaseUserMeAllOf.php | 492 + lib/Model/BaseUserMeAllOfLanguage.php | 373 + lib/Model/BaseWebhook.php | 888 ++ lib/Model/BasicDeal.php | 712 ++ lib/Model/BasicDealProduct.php | 621 ++ lib/Model/BasicGoal.php | 532 + lib/Model/BasicOrganization.php | 372 + lib/Model/BasicPerson.php | 522 + lib/Model/BasicPersonEmail.php | 402 + lib/Model/BulkDeleteResponse.php | 372 + lib/Model/BulkDeleteResponseAllOf.php | 342 + lib/Model/BulkDeleteResponseAllOfData.php | 342 + lib/Model/CalculatedFields.php | 372 + lib/Model/CallLogObject.php | 758 ++ lib/Model/CallLogResponse200.php | 372 + lib/Model/CallLogResponse400.php | 462 + lib/Model/CallLogResponse403.php | 462 + lib/Model/CallLogResponse404.php | 462 + lib/Model/CallLogResponse409.php | 462 + lib/Model/CallLogResponse410.php | 462 + lib/Model/CallLogResponse500.php | 462 + lib/Model/CallLogsResponse.php | 402 + lib/Model/CallLogsResponseAdditionalData.php | 342 + lib/Model/ChannelObject.php | 506 + lib/Model/ChannelObjectResponse.php | 372 + lib/Model/ChannelObjectResponseData.php | 650 ++ lib/Model/CommentPostPutObject.php | 345 + lib/Model/CommonMailThread.php | 732 ++ lib/Model/CreateRemoteFileAndLinkItToItem.php | 372 + lib/Model/CreateTeam.php | 432 + lib/Model/Currencies.php | 372 + lib/Model/DealCollectionResponseObject.php | 942 ++ lib/Model/DealCountAndActivityInfo.php | 702 ++ lib/Model/DealFlowResponse.php | 432 + lib/Model/DealFlowResponseAllOf.php | 402 + lib/Model/DealFlowResponseAllOfData.php | 402 + .../DealFlowResponseAllOfRelatedObjects.php | 432 + lib/Model/DealListActivitiesResponse.php | 432 + lib/Model/DealListActivitiesResponseAllOf.php | 402 + ...tActivitiesResponseAllOfRelatedObjects.php | 432 + lib/Model/DealNonStrict.php | 2022 ++++ lib/Model/DealNonStrictModeFields.php | 462 + .../DealNonStrictModeFieldsCreatorUserId.php | 523 + lib/Model/DealNonStrictWithDetails.php | 2202 ++++ lib/Model/DealNonStrictWithDetailsAllOf.php | 492 + .../DealNonStrictWithDetailsAllOfAge.php | 523 + ...StrictWithDetailsAllOfAverageTimeToWon.php | 523 + ...ctWithDetailsAllOfStayInPipelineStages.php | 373 + lib/Model/DealOrganizationData.php | 493 + lib/Model/DealOrganizationDataWithId.php | 522 + lib/Model/DealOrganizationDataWithIdAllOf.php | 342 + lib/Model/DealParticipantCountInfo.php | 372 + lib/Model/DealParticipants.php | 432 + lib/Model/DealPersonData.php | 463 + lib/Model/DealPersonDataEmail.php | 402 + lib/Model/DealPersonDataPhone.php | 402 + lib/Model/DealPersonDataWithId.php | 492 + lib/Model/DealPersonDataWithIdAllOf.php | 342 + lib/Model/DealProductUnitDuration.php | 71 + lib/Model/DealSearchItem.php | 372 + lib/Model/DealSearchItemItem.php | 702 ++ lib/Model/DealSearchItemItemOrganization.php | 372 + lib/Model/DealSearchItemItemOwner.php | 342 + lib/Model/DealSearchItemItemPerson.php | 372 + lib/Model/DealSearchItemItemStage.php | 372 + lib/Model/DealSearchResponse.php | 402 + lib/Model/DealSearchResponseAllOf.php | 372 + lib/Model/DealSearchResponseAllOfData.php | 342 + lib/Model/DealStrict.php | 2022 ++++ lib/Model/DealStrictModeFields.php | 462 + lib/Model/DealStrictWithMergeId.php | 2052 ++++ lib/Model/DealStrictWithMergeIdAllOf.php | 342 + lib/Model/DealSummary.php | 433 + lib/Model/DealSummaryPerCurrency.php | 343 + lib/Model/DealSummaryPerCurrencyFull.php | 343 + .../DealSummaryPerCurrencyFullCURRENCYID.php | 373 + lib/Model/DealSummaryPerStages.php | 343 + lib/Model/DealSummaryPerStagesSTAGEID.php | 343 + .../DealSummaryPerStagesSTAGEIDCURRENCYID.php | 463 + lib/Model/DealTitleParameter.php | 342 + lib/Model/DealUserData.php | 493 + lib/Model/DealUserDataWithId.php | 522 + lib/Model/DealUserDataWithIdAllOf.php | 342 + lib/Model/DealsCountAndActivityInfo.php | 702 ++ lib/Model/DealsCountInfo.php | 552 + lib/Model/DealsMovementsInfo.php | 433 + .../DealsMovementsInfoFormattedValues.php | 343 + lib/Model/DealsMovementsInfoValues.php | 343 + lib/Model/DeleteActivitiesResponse200.php | 372 + lib/Model/DeleteActivitiesResponse200Data.php | 342 + lib/Model/DeleteActivityResponse200.php | 372 + lib/Model/DeleteActivityResponse200Data.php | 342 + lib/Model/DeleteChannelSuccess.php | 342 + lib/Model/DeleteComment.php | 372 + lib/Model/DeleteConversationSuccess.php | 342 + lib/Model/DeleteDeal.php | 372 + lib/Model/DeleteDealData.php | 342 + lib/Model/DeleteDealFollower.php | 372 + lib/Model/DeleteDealFollowerData.php | 342 + lib/Model/DeleteDealParticipant.php | 372 + lib/Model/DeleteDealParticipantData.php | 342 + lib/Model/DeleteDealProduct.php | 372 + lib/Model/DeleteDealProductData.php | 342 + lib/Model/DeleteFile.php | 372 + lib/Model/DeleteFileData.php | 342 + lib/Model/DeleteGoalResponse200.php | 342 + lib/Model/DeleteMultipleDeals.php | 372 + lib/Model/DeleteMultipleDealsData.php | 342 + .../DeleteMultipleProductFieldsResponse.php | 372 + ...eleteMultipleProductFieldsResponseData.php | 342 + lib/Model/DeleteNote.php | 372 + lib/Model/DeletePersonResponse.php | 372 + lib/Model/DeletePersonResponseAllOf.php | 342 + lib/Model/DeletePersonResponseAllOfData.php | 342 + lib/Model/DeletePersonsInBulkResponse.php | 372 + .../DeletePersonsInBulkResponseAllOf.php | 342 + .../DeletePersonsInBulkResponseAllOfData.php | 342 + lib/Model/DeletePipelineResponse200.php | 372 + lib/Model/DeletePipelineResponse200Data.php | 342 + lib/Model/DeleteProductFieldResponse.php | 372 + lib/Model/DeleteProductFieldResponseData.php | 342 + lib/Model/DeleteProductFollowerResponse.php | 372 + .../DeleteProductFollowerResponseData.php | 342 + lib/Model/DeleteProductResponse.php | 372 + lib/Model/DeleteProductResponseData.php | 342 + lib/Model/DeleteResponse.php | 372 + lib/Model/DeleteResponseAllOf.php | 342 + lib/Model/DeleteResponseAllOfData.php | 342 + lib/Model/DeleteRole.php | 372 + lib/Model/DeleteRoleAllOf.php | 342 + lib/Model/DeleteRoleAllOfData.php | 343 + lib/Model/DeleteRoleAssignment.php | 372 + lib/Model/DeleteRoleAssignmentAllOf.php | 342 + lib/Model/DeleteRoleAssignmentAllOfData.php | 343 + lib/Model/DeleteRoleAssignmentRequest.php | 345 + lib/Model/DeleteStageResponse200.php | 372 + lib/Model/DeleteStageResponse200Data.php | 342 + lib/Model/DeleteStagesResponse200.php | 372 + lib/Model/DeleteStagesResponse200Data.php | 342 + lib/Model/DeleteTeamUserRequest.php | 345 + lib/Model/Duration.php | 373 + lib/Model/EditPipeline.php | 372 + lib/Model/EditPipelineAllOf.php | 342 + lib/Model/EmailInfo.php | 372 + lib/Model/ExpectedOutcome.php | 373 + lib/Model/FailResponse.php | 372 + lib/Model/Field.php | 1002 ++ lib/Model/FieldCreateRequest.php | 438 + lib/Model/FieldCreateRequestAllOf.php | 405 + lib/Model/FieldResponse.php | 372 + lib/Model/FieldResponseAllOf.php | 342 + lib/Model/FieldType.php | 345 + lib/Model/FieldTypeAsString.php | 108 + lib/Model/FieldUpdateRequest.php | 402 + lib/Model/FieldsResponse.php | 402 + lib/Model/FieldsResponseAllOf.php | 372 + lib/Model/FileData.php | 1153 ++ lib/Model/FileItem.php | 1153 ++ lib/Model/FilterGetItem.php | 583 + lib/Model/FilterType.php | 74 + lib/Model/FiltersBulkDeleteResponse.php | 372 + lib/Model/FiltersBulkDeleteResponseAllOf.php | 342 + .../FiltersBulkDeleteResponseAllOfData.php | 342 + lib/Model/FiltersBulkGetResponse.php | 372 + lib/Model/FiltersBulkGetResponseAllOf.php | 342 + lib/Model/FiltersDeleteResponse.php | 372 + lib/Model/FiltersDeleteResponseAllOf.php | 342 + lib/Model/FiltersDeleteResponseAllOfData.php | 342 + lib/Model/FiltersGetResponse.php | 372 + lib/Model/FiltersGetResponseAllOf.php | 342 + lib/Model/FiltersPostResponse.php | 372 + lib/Model/FiltersPostResponseAllOf.php | 342 + lib/Model/FiltersPostResponseAllOfData.php | 642 ++ lib/Model/FindGoalResponse.php | 342 + lib/Model/FollowerData.php | 432 + lib/Model/FollowerDataWithID.php | 462 + lib/Model/FollowerDataWithIDAllOf.php | 342 + lib/Model/FullRole.php | 522 + lib/Model/FullRoleAllOf.php | 342 + .../GetActivitiesCollectionResponse200.php | 402 + lib/Model/GetActivitiesResponse200.php | 432 + ...GetActivitiesResponse200RelatedObjects.php | 432 + lib/Model/GetActivityResponse200.php | 402 + lib/Model/GetAddProductAttachementDetails.php | 372 + lib/Model/GetAddUpdateStage.php | 372 + lib/Model/GetAddedDeal.php | 402 + lib/Model/GetAllFiles.php | 402 + lib/Model/GetAllPersonsResponse.php | 432 + lib/Model/GetAllPersonsResponseAllOf.php | 402 + lib/Model/GetAllPipelines.php | 372 + lib/Model/GetAllPipelinesAllOf.php | 342 + lib/Model/GetAllProductFieldsResponse.php | 402 + lib/Model/GetComments.php | 402 + lib/Model/GetDeal.php | 432 + lib/Model/GetDealAdditionalData.php | 342 + lib/Model/GetDeals.php | 432 + lib/Model/GetDealsCollection.php | 402 + .../GetDealsConversionRatesInPipeline.php | 372 + ...GetDealsConversionRatesInPipelineAllOf.php | 342 + ...ealsConversionRatesInPipelineAllOfData.php | 403 + lib/Model/GetDealsMovementsInPipeline.php | 372 + .../GetDealsMovementsInPipelineAllOf.php | 342 + .../GetDealsMovementsInPipelineAllOfData.php | 493 + ...ntsInPipelineAllOfDataAverageAgeInDays.php | 373 + ...elineAllOfDataAverageAgeInDaysByStages.php | 373 + ...ipelineAllOfDataMovementsBetweenStages.php | 343 + lib/Model/GetDealsRelatedObjects.php | 402 + lib/Model/GetDealsSummary.php | 372 + lib/Model/GetDealsSummaryData.php | 523 + lib/Model/GetDealsSummaryDataValuesTotal.php | 463 + ...GetDealsSummaryDataWeightedValuesTotal.php | 403 + lib/Model/GetDealsTimeline.php | 372 + lib/Model/GetDealsTimelineData.php | 433 + lib/Model/GetDealsTimelineDataTotals.php | 553 + lib/Model/GetDuplicatedDeal.php | 372 + lib/Model/GetGoalResultResponse200.php | 372 + lib/Model/GetGoalsResponse200.php | 372 + lib/Model/GetLeadLabelsResponse200.php | 372 + lib/Model/GetLeadSourcesResponse200.php | 372 + lib/Model/GetLeadSourcesResponse200Data.php | 342 + lib/Model/GetLeadsResponse200.php | 402 + lib/Model/GetMergedDeal.php | 372 + lib/Model/GetNotes.php | 402 + lib/Model/GetOneFile.php | 372 + lib/Model/GetOnePipeline.php | 372 + lib/Model/GetOnePipelineAllOf.php | 342 + lib/Model/GetOneStage.php | 372 + lib/Model/GetPersonDetailsResponse.php | 432 + lib/Model/GetPersonDetailsResponseAllOf.php | 402 + ...rsonDetailsResponseAllOfAdditionalData.php | 342 + lib/Model/GetProductAttachementDetails.php | 372 + lib/Model/GetProductFieldResponse.php | 372 + lib/Model/GetRecents.php | 402 + lib/Model/GetRecentsAdditionalData.php | 402 + lib/Model/GetRole.php | 402 + lib/Model/GetRoleAllOf.php | 372 + lib/Model/GetRoleAllOfAdditionalData.php | 343 + lib/Model/GetRoleAssignments.php | 402 + lib/Model/GetRoleAssignmentsAllOf.php | 372 + lib/Model/GetRolePipelines.php | 372 + lib/Model/GetRolePipelinesAllOf.php | 342 + lib/Model/GetRolePipelinesAllOfData.php | 373 + lib/Model/GetRoleSettings.php | 372 + lib/Model/GetRoleSettingsAllOf.php | 342 + lib/Model/GetRoles.php | 402 + lib/Model/GetRolesAllOf.php | 372 + lib/Model/GetStageDeals.php | 402 + lib/Model/GetStages.php | 372 + lib/Model/GoalResults.php | 372 + lib/Model/GoalType.php | 373 + lib/Model/GoalsResponseComponent.php | 612 ++ lib/Model/IconKey.php | 177 + lib/Model/InlineResponse200.php | 372 + lib/Model/InlineResponse400.php | 432 + lib/Model/InlineResponse4001.php | 432 + .../InlineResponse4001AdditionalData.php | 342 + lib/Model/InlineResponse400AdditionalData.php | 342 + lib/Model/InlineResponse403.php | 432 + lib/Model/InlineResponse4031.php | 432 + .../InlineResponse4031AdditionalData.php | 342 + lib/Model/InlineResponse403AdditionalData.php | 342 + lib/Model/InlineResponse404.php | 432 + lib/Model/InlineResponse404AdditionalData.php | 342 + lib/Model/ItemSearchAdditionalData.php | 342 + .../ItemSearchAdditionalDataPagination.php | 433 + lib/Model/ItemSearchFieldResponse.php | 402 + lib/Model/ItemSearchFieldResponseAllOf.php | 372 + .../ItemSearchFieldResponseAllOfData.php | 372 + lib/Model/ItemSearchItem.php | 372 + lib/Model/ItemSearchResponse.php | 402 + lib/Model/ItemSearchResponseAllOf.php | 372 + lib/Model/ItemSearchResponseAllOfData.php | 372 + lib/Model/LeadIdResponse200.php | 372 + lib/Model/LeadIdResponse200Data.php | 342 + lib/Model/LeadLabelColor.php | 75 + lib/Model/LeadLabelResponse.php | 462 + lib/Model/LeadResponse.php | 822 ++ lib/Model/LeadResponse404.php | 462 + lib/Model/LeadSearchItem.php | 372 + lib/Model/LeadSearchItemItem.php | 732 ++ lib/Model/LeadSearchItemItemOrganization.php | 372 + lib/Model/LeadSearchItemItemOwner.php | 342 + lib/Model/LeadSearchItemItemPerson.php | 372 + lib/Model/LeadSearchResponse.php | 402 + lib/Model/LeadSearchResponseAllOf.php | 372 + lib/Model/LeadSearchResponseAllOfData.php | 342 + lib/Model/LeadValue.php | 379 + lib/Model/LinkRemoteFileToItem.php | 372 + lib/Model/ListActivitiesResponse.php | 402 + lib/Model/ListActivitiesResponseAllOf.php | 372 + lib/Model/ListDealsResponse.php | 432 + lib/Model/ListDealsResponseAllOf.php | 402 + .../ListDealsResponseAllOfRelatedObjects.php | 462 + lib/Model/ListFilesResponse.php | 402 + lib/Model/ListFilesResponseAllOf.php | 372 + lib/Model/ListFollowersResponse.php | 402 + lib/Model/ListFollowersResponseAllOf.php | 372 + lib/Model/ListFollowersResponseAllOfData.php | 432 + lib/Model/ListMailMessagesResponse.php | 402 + lib/Model/ListMailMessagesResponseAllOf.php | 372 + .../ListMailMessagesResponseAllOfData.php | 402 + lib/Model/ListPermittedUsersResponse.php | 372 + lib/Model/ListPermittedUsersResponse1.php | 372 + .../ListPermittedUsersResponse1AllOf.php | 342 + lib/Model/ListPermittedUsersResponseAllOf.php | 342 + .../ListPermittedUsersResponseAllOfData.php | 342 + lib/Model/ListPersonProductsResponse.php | 402 + lib/Model/ListPersonProductsResponseAllOf.php | 372 + .../ListPersonProductsResponseAllOfDEALID.php | 372 + .../ListPersonProductsResponseAllOfData.php | 342 + lib/Model/ListPersonsResponse.php | 432 + lib/Model/ListPersonsResponseAllOf.php | 402 + ...ListPersonsResponseAllOfRelatedObjects.php | 372 + lib/Model/ListProductAdditionalData.php | 462 + lib/Model/ListProductAdditionalDataAllOf.php | 432 + lib/Model/ListProductFilesResponse.php | 402 + lib/Model/ListProductFilesResponseAllOf.php | 372 + lib/Model/ListProductFollowersResponse.php | 402 + .../ListProductFollowersResponseAllOf.php | 372 + .../ListProductFollowersResponseAllOfData.php | 432 + lib/Model/ListProductsResponse.php | 432 + lib/Model/ListProductsResponseAllOf.php | 402 + lib/Model/ListProductsResponseAllOfData.php | 342 + ...istProductsResponseAllOfRelatedObjects.php | 342 + lib/Model/MailMessage.php | 462 + lib/Model/MailMessageAllOf.php | 342 + lib/Model/MailMessageData.php | 1188 ++ lib/Model/MailMessageItemForList.php | 1458 +++ lib/Model/MailMessageItemForListAllOf.php | 582 + lib/Model/MailParticipant.php | 492 + lib/Model/MailServiceBaseResponse.php | 432 + lib/Model/MailThread.php | 372 + lib/Model/MailThreadAllOf.php | 342 + lib/Model/MailThreadDelete.php | 372 + lib/Model/MailThreadDeleteAllOf.php | 342 + lib/Model/MailThreadDeleteAllOfData.php | 342 + lib/Model/MailThreadMessages.php | 372 + lib/Model/MailThreadMessagesAllOf.php | 342 + lib/Model/MailThreadOne.php | 372 + lib/Model/MailThreadOneAllOf.php | 342 + lib/Model/MailThreadParticipant.php | 583 + lib/Model/MailThreadPut.php | 372 + lib/Model/MailThreadPutAllOf.php | 342 + lib/Model/MarketingStatus.php | 68 + lib/Model/MergeDealsRequest.php | 345 + lib/Model/MergeOrganizationsRequest.php | 345 + lib/Model/MergePersonDealRelatedInfo.php | 762 ++ lib/Model/MergePersonItem.php | 1632 +++ lib/Model/MergePersonsRequest.php | 345 + lib/Model/MergePersonsResponse.php | 372 + lib/Model/MergePersonsResponseAllOf.php | 342 + lib/Model/MessageObject.php | 673 ++ lib/Model/MessageObjectAttachments.php | 531 + lib/Model/ModelInterface.php | 106 + lib/Model/NewDeal.php | 775 ++ lib/Model/NewDealAllOf.php | 342 + lib/Model/NewDealProduct.php | 621 ++ lib/Model/NewFollowerResponse.php | 372 + lib/Model/NewFollowerResponseData.php | 432 + lib/Model/NewGoal.php | 547 + lib/Model/NewOrganization.php | 435 + lib/Model/NewOrganizationAllOf.php | 375 + lib/Model/NewPerson.php | 555 + lib/Model/NewPersonAllOf.php | 345 + lib/Model/NewProductField.php | 472 + lib/Model/Note.php | 642 ++ lib/Model/NoteAllOf.php | 342 + lib/Model/NoteConnectToParams.php | 432 + lib/Model/NoteCreatorUser.php | 433 + lib/Model/NoteField.php | 582 + lib/Model/NoteFieldOptions.php | 372 + lib/Model/NoteFieldsResponse.php | 402 + lib/Model/NoteFieldsResponseAllOf.php | 372 + lib/Model/NoteParams.php | 492 + lib/Model/NumberBoolean.php | 62 + lib/Model/NumberBooleanDefault0.php | 62 + lib/Model/NumberBooleanDefault1.php | 62 + lib/Model/ObjectPrices.php | 342 + lib/Model/OneLeadResponse200.php | 372 + lib/Model/OptionalNameObject.php | 342 + lib/Model/OrgAndOwnerId.php | 372 + lib/Model/OrganizationAddressInfo.php | 642 ++ lib/Model/OrganizationCountAndAddressInfo.php | 882 ++ lib/Model/OrganizationCountInfo.php | 552 + lib/Model/OrganizationData.php | 462 + lib/Model/OrganizationDataWithId.php | 493 + lib/Model/OrganizationDataWithIdAllOf.php | 342 + .../OrganizationDataWithIdAndActiveFlag.php | 523 + ...ganizationDataWithIdAndActiveFlagAllOf.php | 342 + lib/Model/OrganizationDeleteResponse.php | 372 + lib/Model/OrganizationDeleteResponseData.php | 342 + lib/Model/OrganizationDetailsGetResponse.php | 432 + .../OrganizationDetailsGetResponseAllOf.php | 402 + ...nDetailsGetResponseAllOfAdditionalData.php | 372 + lib/Model/OrganizationFlowResponse.php | 432 + lib/Model/OrganizationFlowResponseAllOf.php | 402 + .../OrganizationFlowResponseAllOfData.php | 402 + ...izationFlowResponseAllOfRelatedObjects.php | 372 + .../OrganizationFollowerDeleteResponse.php | 372 + ...OrganizationFollowerDeleteResponseData.php | 342 + lib/Model/OrganizationFollowerItem.php | 432 + lib/Model/OrganizationFollowerItemAllOf.php | 342 + .../OrganizationFollowerPostResponse.php | 372 + .../OrganizationFollowersListResponse.php | 402 + lib/Model/OrganizationItem.php | 1782 +++ lib/Model/OrganizationItemAllOf.php | 372 + lib/Model/OrganizationPostResponse.php | 402 + lib/Model/OrganizationPostResponseAllOf.php | 372 + lib/Model/OrganizationRelationship.php | 468 + ...OrganizationRelationshipDeleteResponse.php | 372 + ...izationRelationshipDeleteResponseAllOf.php | 342 + ...ionRelationshipDeleteResponseAllOfData.php | 342 + lib/Model/OrganizationRelationshipDetails.php | 612 ++ .../OrganizationRelationshipGetResponse.php | 402 + ...ganizationRelationshipGetResponseAllOf.php | 372 + .../OrganizationRelationshipPostResponse.php | 402 + ...anizationRelationshipPostResponseAllOf.php | 372 + ...OrganizationRelationshipUpdateResponse.php | 402 + ...zationRelationshipWithCalculatedFields.php | 582 + lib/Model/OrganizationSearchItem.php | 372 + lib/Model/OrganizationSearchItemItem.php | 552 + lib/Model/OrganizationSearchResponse.php | 402 + lib/Model/OrganizationSearchResponseAllOf.php | 372 + .../OrganizationSearchResponseAllOfData.php | 342 + lib/Model/OrganizationUpdateResponse.php | 402 + lib/Model/OrganizationUpdateResponseAllOf.php | 372 + lib/Model/OrganizationsDeleteResponse.php | 372 + lib/Model/OrganizationsDeleteResponseData.php | 342 + lib/Model/OrganizationsMergeResponse.php | 372 + lib/Model/OrganizationsMergeResponseData.php | 342 + lib/Model/Owner.php | 522 + lib/Model/OwnerAllOf.php | 342 + lib/Model/PaginationDetails.php | 433 + lib/Model/PaginationDetailsAllOf.php | 342 + lib/Model/Params.php | 373 + lib/Model/PaymentItem.php | 784 ++ lib/Model/PaymentsResponse.php | 372 + lib/Model/PaymentsResponseAllOf.php | 342 + lib/Model/PermissionSets.php | 372 + lib/Model/PermissionSetsAllOf.php | 342 + lib/Model/PermissionSetsItem.php | 574 + lib/Model/PersonCountAndEmailInfo.php | 582 + .../PersonCountEmailDealAndActivityInfo.php | 972 ++ lib/Model/PersonCountInfo.php | 522 + lib/Model/PersonData.php | 462 + lib/Model/PersonDataEmail.php | 402 + lib/Model/PersonDataPhone.php | 402 + lib/Model/PersonDataWithActiveFlag.php | 493 + lib/Model/PersonDataWithActiveFlagAllOf.php | 342 + lib/Model/PersonFlowResponse.php | 432 + lib/Model/PersonFlowResponseAllOf.php | 402 + lib/Model/PersonFlowResponseAllOfData.php | 402 + lib/Model/PersonItem.php | 1542 +++ lib/Model/PersonListProduct.php | 822 ++ lib/Model/PersonNameCountAndEmailInfo.php | 672 ++ .../PersonNameCountAndEmailInfoWithIds.php | 762 ++ ...ersonNameCountAndEmailInfoWithIdsAllOf.php | 402 + lib/Model/PersonNameInfo.php | 402 + lib/Model/PersonNameInfoWithOrgAndOwnerId.php | 462 + lib/Model/PersonSearchItem.php | 372 + lib/Model/PersonSearchItemItem.php | 612 ++ .../PersonSearchItemItemOrganization.php | 372 + lib/Model/PersonSearchItemItemOwner.php | 342 + lib/Model/PersonSearchResponse.php | 402 + lib/Model/PersonSearchResponseAllOf.php | 372 + lib/Model/PersonSearchResponseAllOfData.php | 342 + lib/Model/PictureData.php | 522 + lib/Model/PictureDataPictures.php | 372 + lib/Model/PictureDataWithID.php | 552 + lib/Model/PictureDataWithIDAllOf.php | 342 + lib/Model/PictureDataWithValue.php | 552 + lib/Model/PictureDataWithValueAllOf.php | 342 + lib/Model/Pipeline.php | 432 + lib/Model/PipelineDetails.php | 613 ++ lib/Model/PipelineDetailsAllOf.php | 342 + lib/Model/PostComment.php | 372 + lib/Model/PostDealParticipants.php | 402 + lib/Model/PostGoalResponse.php | 342 + lib/Model/PostNote.php | 372 + lib/Model/PostRoleAssignment.php | 372 + lib/Model/PostRoleAssignmentAllOf.php | 342 + lib/Model/PostRoleAssignmentAllOfData.php | 373 + lib/Model/PostRoleSettings.php | 372 + lib/Model/PostRoleSettingsAllOf.php | 342 + lib/Model/PostRoleSettingsAllOfData.php | 413 + lib/Model/PostRoles.php | 372 + lib/Model/PostRolesAllOf.php | 342 + lib/Model/PostRolesAllOfData.php | 343 + lib/Model/ProductAttachementFields.php | 702 ++ lib/Model/ProductAttachmentDetails.php | 921 ++ lib/Model/ProductBaseDeal.php | 1602 +++ lib/Model/ProductField.php | 922 ++ lib/Model/ProductFieldAllOf.php | 762 ++ lib/Model/ProductFileItem.php | 763 ++ lib/Model/ProductListItem.php | 1002 ++ lib/Model/ProductRequest.php | 552 + lib/Model/ProductResponse.php | 402 + lib/Model/ProductSearchItem.php | 372 + lib/Model/ProductSearchItemItem.php | 522 + lib/Model/ProductSearchItemItemOwner.php | 342 + lib/Model/ProductSearchResponse.php | 402 + lib/Model/ProductSearchResponseAllOf.php | 372 + lib/Model/ProductSearchResponseAllOfData.php | 342 + lib/Model/ProductWithArrayPrices.php | 612 ++ lib/Model/ProductWithObjectPrices.php | 612 ++ lib/Model/ProductsResponse.php | 432 + lib/Model/PutRole.php | 372 + lib/Model/PutRoleAllOf.php | 342 + lib/Model/PutRoleAllOfData.php | 343 + lib/Model/PutRolePipelinesBody.php | 345 + lib/Model/RecentDataProduct.php | 792 ++ lib/Model/RecentsActivity.php | 436 + lib/Model/RecentsActivityType.php | 436 + lib/Model/RecentsDeal.php | 436 + lib/Model/RecentsFile.php | 436 + lib/Model/RecentsFilter.php | 436 + lib/Model/RecentsNote.php | 436 + lib/Model/RecentsOrganization.php | 436 + lib/Model/RecentsPerson.php | 436 + lib/Model/RecentsPipeline.php | 436 + lib/Model/RecentsProduct.php | 436 + lib/Model/RecentsStage.php | 436 + lib/Model/RecentsUser.php | 436 + lib/Model/RelatedDealData.php | 342 + lib/Model/RelatedDealDataDEALID.php | 523 + lib/Model/RelatedFollowerData.php | 343 + lib/Model/RelatedOrganizationData.php | 342 + .../RelatedOrganizationDataWithActiveFlag.php | 342 + lib/Model/RelatedOrganizationName.php | 342 + lib/Model/RelatedPersonData.php | 342 + lib/Model/RelatedPersonDataWithActiveFlag.php | 342 + lib/Model/RelatedPictureData.php | 343 + lib/Model/RelatedUserData.php | 342 + .../RelationshipOrganizationInfoItem.php | 492 + .../RelationshipOrganizationInfoItemAllOf.php | 342 + ...shipOrganizationInfoItemWithActiveFlag.php | 522 + lib/Model/RequiredNameObject.php | 345 + lib/Model/RequredTitleParameter.php | 345 + lib/Model/ResponseCallLogObject.php | 848 ++ lib/Model/ResponseCallLogObjectAllOf.php | 402 + lib/Model/RoleAssignment.php | 493 + lib/Model/RoleAssignmentAllOf.php | 432 + lib/Model/RoleSettings.php | 583 + lib/Model/RolesAdditionalData.php | 343 + lib/Model/RolesAdditionalDataPagination.php | 403 + lib/Model/SinglePermissionSetsItem.php | 604 + lib/Model/SinglePermissionSetsItemAllOf.php | 342 + lib/Model/Stage.php | 462 + lib/Model/StageConversions.php | 402 + lib/Model/StageDetails.php | 643 ++ lib/Model/StageWithPipelineInfo.php | 672 ++ lib/Model/StageWithPipelineInfoAllOf.php | 372 + lib/Model/SubRole.php | 493 + lib/Model/SubRoleAllOf.php | 432 + lib/Model/SubscriptionAddonsResponse.php | 372 + lib/Model/SubscriptionAddonsResponseAllOf.php | 342 + .../SubscriptionInstallmentCreateRequest.php | 441 + .../SubscriptionInstallmentUpdateRequest.php | 375 + lib/Model/SubscriptionItem.php | 792 ++ .../SubscriptionRecurringCancelRequest.php | 342 + .../SubscriptionRecurringCreateRequest.php | 667 ++ .../SubscriptionRecurringUpdateRequest.php | 465 + lib/Model/SubscriptionsIdResponse.php | 372 + lib/Model/SubscriptionsIdResponseAllOf.php | 342 + lib/Model/Team.php | 372 + lib/Model/TeamAllOf.php | 342 + lib/Model/TeamId.php | 342 + lib/Model/Teams.php | 372 + lib/Model/TeamsAllOf.php | 342 + lib/Model/Unauthorized.php | 402 + lib/Model/UpdateActivityResponse200.php | 402 + lib/Model/UpdateDealProduct.php | 615 ++ lib/Model/UpdateDealRequest.php | 742 ++ lib/Model/UpdateFile.php | 372 + lib/Model/UpdateFilterRequest.php | 375 + lib/Model/UpdateLeadLabelRequest.php | 372 + lib/Model/UpdateLeadRequest.php | 612 ++ lib/Model/UpdateOrganization.php | 402 + lib/Model/UpdateOrganizationAllOf.php | 342 + lib/Model/UpdatePerson.php | 552 + lib/Model/UpdatePersonAllOf.php | 342 + lib/Model/UpdatePersonResponse.php | 402 + lib/Model/UpdateProductField.php | 372 + lib/Model/UpdateProductRequestBody.php | 585 + lib/Model/UpdateProductResponse.php | 402 + lib/Model/UpdateStageRequest.php | 492 + lib/Model/UpdateStageRequestAllOf.php | 342 + lib/Model/UpdateTeam.php | 492 + lib/Model/UpdateTeamAllOf.php | 372 + .../UpdateTeamWithAdditionalProperties.php | 552 + lib/Model/UpdateUserRequest.php | 345 + lib/Model/User.php | 372 + lib/Model/UserAccess.php | 444 + lib/Model/UserAllOf.php | 342 + lib/Model/UserAssignmentToPermissionSet.php | 402 + lib/Model/UserAssignmentsToPermissionSet.php | 372 + .../UserAssignmentsToPermissionSetAllOf.php | 342 + lib/Model/UserConnections.php | 372 + lib/Model/UserConnectionsAllOf.php | 342 + lib/Model/UserConnectionsAllOfData.php | 343 + lib/Model/UserData.php | 492 + lib/Model/UserDataWithId.php | 492 + lib/Model/UserIDs.php | 372 + lib/Model/UserIDsAllOf.php | 342 + lib/Model/UserMe.php | 372 + lib/Model/UserMeAllOf.php | 342 + lib/Model/UserPermissions.php | 372 + lib/Model/UserPermissionsAllOf.php | 342 + lib/Model/UserPermissionsItem.php | 1242 +++ lib/Model/UserSettings.php | 372 + lib/Model/UserSettingsAllOf.php | 342 + lib/Model/UserSettingsItem.php | 612 ++ lib/Model/Users.php | 372 + lib/Model/UsersAllOf.php | 342 + lib/Model/VisibleTo.php | 68 + lib/Model/Webhook.php | 402 + lib/Model/WebhookAllOf.php | 342 + lib/Model/WebhookBadRequest.php | 402 + lib/Model/WebhookBadRequestAllOf.php | 342 + lib/Model/Webhooks.php | 402 + lib/Model/WebhooksAllOf.php | 342 + lib/Model/WebhooksDeleteForbiddenSchema.php | 372 + .../WebhooksDeleteForbiddenSchemaAllOf.php | 342 + lib/ObjectSerializer.php | 406 + package.json | 9 + phpstan.neon | 10 + phpunit.xml | 33 +- src/APIException.php | 88 - src/APIHelper.php | 189 - src/Client.php | 320 - src/Configuration.php | 78 - src/Controllers/ActivitiesController.php | 477 - src/Controllers/ActivityFieldsController.php | 92 - src/Controllers/ActivityTypesController.php | 342 - src/Controllers/BaseController.php | 69 - src/Controllers/CallLogsController.php | 362 - src/Controllers/CurrenciesController.php | 104 - src/Controllers/DealFieldsController.php | 399 - src/Controllers/DealsController.php | 1824 ---- src/Controllers/FilesController.php | 546 - src/Controllers/FiltersController.php | 473 - src/Controllers/GlobalMessagesController.php | 159 - src/Controllers/GoalsController.php | 423 - src/Controllers/ItemSearchController.php | 198 - src/Controllers/MailMessagesController.php | 126 - src/Controllers/MailThreadsController.php | 360 - src/Controllers/NoteFieldsController.php | 92 - src/Controllers/NotesController.php | 452 - .../OAuthAuthorizationController.php | 213 - .../OrganizationFieldsController.php | 391 - .../OrganizationRelationshipsController.php | 350 - src/Controllers/OrganizationsController.php | 1166 -- src/Controllers/PermissionSetsController.php | 247 - src/Controllers/PersonFieldsController.php | 400 - src/Controllers/PersonsController.php | 1290 --- src/Controllers/PipelinesController.php | 573 - src/Controllers/ProductFieldsController.php | 423 - src/Controllers/ProductsController.php | 793 -- src/Controllers/RecentsController.php | 123 - src/Controllers/RolesController.php | 730 -- src/Controllers/StagesController.php | 458 - src/Controllers/TeamsController.php | 613 -- src/Controllers/UserConnectionsController.php | 100 - src/Controllers/UserSettingsController.php | 92 - src/Controllers/UsersController.php | 898 -- src/Controllers/WebhooksController.php | 279 - src/Environments.php | 19 - src/Exceptions/FailResponseException.php | 45 - src/Exceptions/OAuthProviderException.php | 56 - src/Exceptions/SchemaException.php | 51 - src/Exceptions/UnauthorizedException.php | 51 - src/Exceptions/Webhooks403ErrorException.php | 45 - src/Http/HttpCallBack.php | 95 - src/Http/HttpContext.php | 55 - src/Http/HttpMethod.php | 21 - src/Http/HttpRequest.php | 125 - src/Http/HttpResponse.php | 72 - src/Models/Activity.php | 158 - src/Models/AddedDealFollower.php | 54 - src/Models/AdditionalData.php | 64 - src/Models/AdditionalData2.php | 45 - src/Models/AdditionalData3.php | 46 - src/Models/AdditionalData4.php | 45 - src/Models/AdditionalData5.php | 46 - .../AdditionalDataWithPaginationDetails.php | 45 - src/Models/Age.php | 100 - src/Models/AssigneeTypeEnum.php | 29 - src/Models/AverageTimeToWon.php | 100 - src/Models/BaseCurrency.php | 102 - src/Models/BaseDeal.php | 559 - src/Models/BaseMailThread.php | 413 - src/Models/BaseMailThreadMessages.php | 316 - src/Models/BaseNote.php | 220 - src/Models/BaseNoteDealTitle.php | 45 - src/Models/BaseResponse.php | 45 - src/Models/BaseRole.php | 55 - src/Models/BaseTeam.php | 124 - src/Models/BaseUser.php | 228 - src/Models/BaseUserMe.php | 267 - src/Models/BasicDeal.php | 148 - src/Models/BasicDealProduct.php | 114 - src/Models/BasicGoal.php | 103 - src/Models/BasicOrganization.php | 68 - src/Models/BasicPerson.php | 98 - src/Models/BasicPersonField.php | 58 - src/Models/BasicProductField.php | 56 - src/Models/CommonMailThread.php | 183 - src/Models/CreateTeam.php | 75 - src/Models/CreatorUserId.php | 102 - src/Models/Currencies.php | 54 - src/Models/Data.php | 45 - src/Models/Data1.php | 608 -- src/Models/Data10.php | 45 - src/Models/Data11.php | 102 - src/Models/Data12.php | 45 - src/Models/Data13.php | 45 - src/Models/Data14.php | 45 - src/Models/Data15.php | 45 - src/Models/Data16.php | 45 - src/Models/Data17.php | 45 - src/Models/Data18.php | 56 - src/Models/Data19.php | 55 - src/Models/Data2.php | 608 -- src/Models/Data20.php | 45 - src/Models/Data21.php | 667 -- src/Models/Data22.php | 608 -- src/Models/Data23.php | 161 - src/Models/Data24.php | 115 - src/Models/Data25.php | 75 - src/Models/Data26.php | 239 - src/Models/Data27.php | 249 - src/Models/Data29.php | 221 - src/Models/Data3.php | 618 -- src/Models/Data4.php | 75 - src/Models/Data5.php | 45 - src/Models/Data6.php | 45 - src/Models/Data7.php | 45 - src/Models/Data8.php | 55 - src/Models/Data9.php | 75 - src/Models/Deal.php | 608 -- src/Models/DealDefaultVisibilityEnum.php | 34 - src/Models/DealNonStrictModeFields.php | 85 - src/Models/DealOrganizationData.php | 94 - src/Models/DealPersonData.php | 73 - src/Models/DealStrictModeFields.php | 85 - src/Models/DealUserData.php | 93 - src/Models/DeleteDeal.php | 54 - src/Models/DeleteDealFollower.php | 54 - src/Models/DeleteDealParticipant.php | 54 - src/Models/DeleteDealProduct.php | 54 - src/Models/DeleteMultipleDeals.php | 54 - .../DeleteMultipleProductFieldsResponse.php | 54 - src/Models/DeleteNote.php | 54 - src/Models/DeleteProductFieldResponse.php | 54 - src/Models/DeleteProductFollowerResponse.php | 54 - src/Models/DeleteRole.php | 54 - src/Models/DeleteRoleAssignment.php | 54 - src/Models/Email.php | 63 - src/Models/EventActionEnum.php | 39 - src/Models/EventObjectEnum.php | 69 - .../ExpectedOutcomeTrackingMetricEnum.php | 24 - src/Models/FieldType.php | 59 - src/Models/FieldType1Enum.php | 101 - src/Models/FieldType4Enum.php | 101 - src/Models/FieldType6Enum.php | 34 - src/Models/FileTypeEnum.php | 39 - src/Models/FilterTypeEnum.php | 39 - src/Models/FolderEnum.php | 34 - src/Models/FullRole.php | 103 - .../GetAddProductAttachementDetails.php | 54 - src/Models/GetAddedDeal.php | 74 - src/Models/GetAllProductFieldsResponse.php | 64 - src/Models/GetDeal.php | 74 - src/Models/GetDeals.php | 74 - src/Models/GetDealsByName.php | 64 - src/Models/GetDealsSummary.php | 54 - src/Models/GetDealsTimeline.php | 55 - src/Models/GetDuplicatedDeal.php | 54 - src/Models/GetMergedDeal.php | 54 - src/Models/GetNotes.php | 64 - src/Models/GetProductAttachementDetails.php | 54 - src/Models/GetProductFieldResponse.php | 54 - src/Models/GetRole.php | 64 - src/Models/GetRoleAssignments.php | 64 - src/Models/GetRoleSettings.php | 54 - src/Models/GetRoleSubroles.php | 64 - src/Models/GetRoles.php | 64 - src/Models/GlobalMessageBaseResponse.php | 45 - src/Models/GlobalMessageData.php | 94 - src/Models/GlobalMessageDelete.php | 75 - src/Models/GlobalMessageGet.php | 75 - src/Models/GlobalMessageUserData.php | 65 - src/Models/IconKeyEnum.php | 214 - src/Models/Interval2Enum.php | 34 - src/Models/IntervalEnum.php | 35 - src/Models/ItemType2Enum.php | 39 - src/Models/ItemTypeEnum.php | 29 - src/Models/ItemsEnum.php | 79 - src/Models/Language.php | 56 - src/Models/MailMessage.php | 81 - src/Models/MailMessageData.php | 326 - src/Models/MailParticipant.php | 94 - src/Models/MailServiceBaseResponse.php | 72 - src/Models/MailThread.php | 54 - src/Models/MailThreadDelete.php | 54 - src/Models/MailThreadMessages.php | 54 - src/Models/MailThreadOne.php | 54 - src/Models/MailThreadParticipant.php | 124 - src/Models/MailThreadPut.php | 54 - src/Models/MailTrackingStatusEnum.php | 24 - src/Models/NewDeal.php | 160 - src/Models/NewDealProduct.php | 127 - src/Models/NewFollowerResponse.php | 54 - src/Models/NewGoal.php | 108 - src/Models/NewOrganization.php | 80 - src/Models/NewOrganizationField.php | 81 - src/Models/NewPerson.php | 110 - src/Models/NewPersonField.php | 81 - src/Models/NewProductField.php | 79 - src/Models/Note.php | 147 - src/Models/NoteCreatorUser.php | 74 - src/Models/NumberBooleanEnum.php | 24 - src/Models/OAuthProviderErrorEnum.php | 50 - src/Models/OAuthToken.php | 98 - src/Models/OrderByEnum.php | 34 - src/Models/OrgId.php | 103 - src/Models/Organization.php | 45 - src/Models/OrganizationRelationship.php | 77 - src/Models/Pagination.php | 74 - src/Models/Pagination1.php | 64 - src/Models/Parties.php | 54 - src/Models/PermissionSets.php | 54 - src/Models/PermissionSetsItem.php | 64 - src/Models/Person.php | 45 - src/Models/PersonId.php | 82 - src/Models/Phone.php | 63 - src/Models/Pipeline.php | 74 - src/Models/PostNote.php | 54 - src/Models/PostRoleAssignment.php | 54 - src/Models/PostRoleSettings.php | 54 - src/Models/PostRoles.php | 54 - src/Models/ProductAttachementFields.php | 161 - src/Models/ProductField.php | 227 - src/Models/PutRole.php | 54 - src/Models/RelatedObjects.php | 63 - src/Models/RemoteLocationEnum.php | 19 - src/Models/RoleAssignment.php | 94 - src/Models/RoleSettings.php | 116 - src/Models/RolesAdditionalData.php | 45 - src/Models/RottenFlagEnum.php | 24 - src/Models/Schema1.php | 54 - src/Models/SettingKeyEnum.php | 34 - src/Models/SinglePermissionSetsItem.php | 73 - src/Models/Stage.php | 86 - src/Models/Status2Enum.php | 39 - src/Models/Status3Enum.php | 29 - src/Models/StatusEnum.php | 34 - src/Models/StayInPipelineStages.php | 56 - src/Models/SubRole.php | 94 - src/Models/Teams.php | 54 - src/Models/Totals.php | 116 - src/Models/Type2Enum.php | 24 - src/Models/TypeEnum.php | 24 - src/Models/TypeNameEnum.php | 39 - src/Models/UpdateTeam.php | 95 - src/Models/User.php | 54 - src/Models/UserAssignmentToPermissionSet.php | 74 - src/Models/UserAssignmentsToPermissionSet.php | 54 - src/Models/UserConnections.php | 54 - src/Models/UserIDs.php | 54 - src/Models/UserId.php | 102 - src/Models/UserMe.php | 54 - src/Models/Users.php | 54 - src/Models/ValuesTotal.php | 84 - src/Models/VisibleToEnum.php | 24 - src/Models/WebhooksResponse.php | 63 - src/Models/WebhooksResponse1.php | 63 - src/Models/WeightedValuesTotal.php | 65 - src/OAuthManager.php | 194 - src/Servers.php | 24 - src/Utils/CamelCaseHelper.php | 53 - src/Utils/DateTimeHelper.php | 296 - src/Utils/JsonSerializer.php | 24 - test/Activities/ActivityApiTest.php | 71 + test/CallLogs/CallLogsApiTest.php | 133 + test/Deals/DealsApiTest.php | 62 + test/Leads/LeadsApiTest.php | 48 + test/MailThreads/MailThreadsApiTest.php | 63 + test/Pest.php | 45 + test/Recents/RecentsApiTest.php | 53 + test/Stages/StagesApiTest.php | 45 + test/TestCase.php | 26 + .../Controllers/ActivitiesControllerTest.php | 75 - .../ActivityFieldsControllerTest.php | 64 - .../ActivityTypesControllerTest.php | 64 - .../Controllers/CurrenciesControllerTest.php | 92 - .../Controllers/DealFieldsControllerTest.php | 91 - tests/Controllers/DealsControllerTest.php | 266 - tests/Controllers/FilesControllerTest.php | 70 - tests/Controllers/FiltersControllerTest.php | 87 - tests/Controllers/GoalsControllerTest.php | 103 - .../Controllers/MailThreadsControllerTest.php | 110 - .../Controllers/NoteFieldsControllerTest.php | 64 - tests/Controllers/NotesControllerTest.php | 109 - .../OrganizationFieldsControllerTest.php | 87 - ...rganizationRelationshipsControllerTest.php | 66 - .../OrganizationsControllerTest.php | 95 - .../PermissionSetsControllerTest.php | 90 - .../PersonFieldsControllerTest.php | 91 - tests/Controllers/PersonsControllerTest.php | 118 - tests/Controllers/PipelinesControllerTest.php | 92 - .../ProductFieldsControllerTest.php | 96 - tests/Controllers/ProductsControllerTest.php | 126 - tests/Controllers/RolesControllerTest.php | 90 - tests/Controllers/StagesControllerTest.php | 89 - tests/Controllers/TeamsControllerTest.php | 99 - .../UserConnectionsControllerTest.php | 88 - .../UserSettingsControllerTest.php | 64 - tests/Controllers/UsersControllerTest.php | 151 - tests/Controllers/WebhooksControllerTest.php | 92 - tests/HttpCallBackCatcher.php | 58 - tests/TestHelper.php | 348 - tests/bootstrap.php | 15 - 1856 files changed, 452330 insertions(+), 48404 deletions(-) create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 CHANGELOG.md create mode 100644 MIGRATION-5.x.md create mode 100644 docs/Api/ActivitiesApi.md create mode 100644 docs/Api/ActivityFieldsApi.md create mode 100644 docs/Api/ActivityTypesApi.md create mode 100644 docs/Api/BillingApi.md create mode 100644 docs/Api/CallLogsApi.md create mode 100644 docs/Api/ChannelsApi.md create mode 100644 docs/Api/CurrenciesApi.md create mode 100644 docs/Api/DealFieldsApi.md create mode 100644 docs/Api/DealsApi.md create mode 100644 docs/Api/FilesApi.md create mode 100644 docs/Api/FiltersApi.md create mode 100644 docs/Api/GoalsApi.md create mode 100644 docs/Api/ItemSearchApi.md create mode 100644 docs/Api/LeadLabelsApi.md create mode 100644 docs/Api/LeadSourcesApi.md create mode 100644 docs/Api/LeadsApi.md create mode 100644 docs/Api/LegacyTeamsApi.md create mode 100644 docs/Api/MailboxApi.md create mode 100644 docs/Api/NoteFieldsApi.md create mode 100644 docs/Api/NotesApi.md create mode 100644 docs/Api/OrganizationFieldsApi.md create mode 100644 docs/Api/OrganizationRelationshipsApi.md create mode 100644 docs/Api/OrganizationsApi.md create mode 100644 docs/Api/PermissionSetsApi.md create mode 100644 docs/Api/PersonFieldsApi.md create mode 100644 docs/Api/PersonsApi.md create mode 100644 docs/Api/PipelinesApi.md create mode 100644 docs/Api/ProductFieldsApi.md create mode 100644 docs/Api/ProductsApi.md create mode 100644 docs/Api/RecentsApi.md create mode 100644 docs/Api/RolesApi.md create mode 100644 docs/Api/StagesApi.md create mode 100644 docs/Api/SubscriptionsApi.md create mode 100644 docs/Api/UserConnectionsApi.md create mode 100644 docs/Api/UserSettingsApi.md create mode 100644 docs/Api/UsersApi.md create mode 100644 docs/Api/WebhooksApi.md create mode 100644 docs/Model/ActivityCollectionResponseObject.md create mode 100644 docs/Model/ActivityCollectionResponseObjectAllOf.md create mode 100644 docs/Model/ActivityDistributionData.md create mode 100644 docs/Model/ActivityDistributionDataActivityDistribution.md create mode 100644 docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.md create mode 100644 docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md create mode 100644 docs/Model/ActivityDistributionDataWithAdditionalData.md create mode 100644 docs/Model/ActivityInfo.md create mode 100644 docs/Model/ActivityObjectFragment.md create mode 100644 docs/Model/ActivityPostObject.md create mode 100644 docs/Model/ActivityPostObjectAllOf.md create mode 100644 docs/Model/ActivityPutObject.md create mode 100644 docs/Model/ActivityPutObjectAllOf.md create mode 100644 docs/Model/ActivityRecordAdditionalData.md create mode 100644 docs/Model/ActivityResponseObject.md create mode 100644 docs/Model/ActivityResponseObjectAllOf.md create mode 100644 docs/Model/ActivityTypeBulkDeleteResponse.md create mode 100644 docs/Model/ActivityTypeBulkDeleteResponseAllOf.md create mode 100644 docs/Model/ActivityTypeBulkDeleteResponseAllOfData.md create mode 100644 docs/Model/ActivityTypeCreateRequest.md create mode 100644 docs/Model/ActivityTypeCreateUpdateDeleteResponse.md create mode 100644 docs/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.md create mode 100644 docs/Model/ActivityTypeListResponse.md create mode 100644 docs/Model/ActivityTypeListResponseAllOf.md create mode 100644 docs/Model/ActivityTypeObjectResponse.md create mode 100644 docs/Model/ActivityTypeUpdateRequest.md create mode 100644 docs/Model/AddActivityResponse200.md create mode 100644 docs/Model/AddActivityResponse200RelatedObjects.md create mode 100644 docs/Model/AddDealFollowerRequest.md create mode 100644 docs/Model/AddDealParticipantRequest.md create mode 100644 docs/Model/AddFile.md create mode 100644 docs/Model/AddFilterRequest.md create mode 100644 docs/Model/AddFollowerToPersonResponse.md create mode 100644 docs/Model/AddFollowerToPersonResponseAllOf.md create mode 100644 docs/Model/AddFollowerToPersonResponseAllOfData.md create mode 100644 docs/Model/AddLeadLabelRequest.md create mode 100644 docs/Model/AddLeadRequest.md create mode 100644 docs/Model/AddNewPipeline.md create mode 100644 docs/Model/AddNewPipelineAllOf.md create mode 100644 docs/Model/AddNoteRequest.md create mode 100644 docs/Model/AddNoteRequestAllOf.md create mode 100644 docs/Model/AddOrUpdateGoalResponse200.md create mode 100644 docs/Model/AddOrUpdateLeadLabelResponse200.md create mode 100644 docs/Model/AddOrUpdateRoleSettingRequest.md create mode 100644 docs/Model/AddOrganizationFollowerRequest.md create mode 100644 docs/Model/AddOrganizationRelationshipRequest.md create mode 100644 docs/Model/AddPersonFollowerRequest.md create mode 100644 docs/Model/AddPersonPictureResponse.md create mode 100644 docs/Model/AddPersonPictureResponseAllOf.md create mode 100644 docs/Model/AddPersonResponse.md create mode 100644 docs/Model/AddPersonResponseAllOf.md create mode 100644 docs/Model/AddProductAttachmentDetails.md create mode 100644 docs/Model/AddProductAttachmentDetailsAllOf.md create mode 100644 docs/Model/AddProductFollowerRequest.md create mode 100644 docs/Model/AddProductRequestBody.md create mode 100644 docs/Model/AddRole.md create mode 100644 docs/Model/AddRoleAssignmentRequest.md create mode 100644 docs/Model/AddTeamUserRequest.md create mode 100644 docs/Model/AddUserRequest.md create mode 100644 docs/Model/AddWebhookRequest.md create mode 100644 docs/Model/AddedDealFollower.md create mode 100644 docs/Model/AddedDealFollowerData.md create mode 100644 docs/Model/AdditionalBaseOrganizationItemInfo.md create mode 100644 docs/Model/AdditionalData.md create mode 100644 docs/Model/AdditionalDataWithCursorPagination.md create mode 100644 docs/Model/AdditionalDataWithOffsetPagination.md create mode 100644 docs/Model/AdditionalDataWithPaginationDetails.md create mode 100644 docs/Model/AdditionalMergePersonInfo.md create mode 100644 docs/Model/AdditionalPersonInfo.md create mode 100644 docs/Model/AllOrganizationRelationshipsGetResponse.md create mode 100644 docs/Model/AllOrganizationRelationshipsGetResponseAllOf.md create mode 100644 docs/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.md create mode 100644 docs/Model/AllOrganizationsGetResponse.md create mode 100644 docs/Model/AllOrganizationsGetResponseAllOf.md create mode 100644 docs/Model/AllOrganizationsGetResponseAllOfRelatedObjects.md create mode 100644 docs/Model/ArrayPrices.md create mode 100644 docs/Model/Assignee.md create mode 100644 docs/Model/BaseComment.md create mode 100644 docs/Model/BaseCurrency.md create mode 100644 docs/Model/BaseDeal.md create mode 100644 docs/Model/BaseFollowerItem.md create mode 100644 docs/Model/BaseMailThread.md create mode 100644 docs/Model/BaseMailThreadAllOf.md create mode 100644 docs/Model/BaseMailThreadAllOfParties.md create mode 100644 docs/Model/BaseMailThreadMessages.md create mode 100644 docs/Model/BaseMailThreadMessagesAllOf.md create mode 100644 docs/Model/BaseNote.md create mode 100644 docs/Model/BaseNoteDealTitle.md create mode 100644 docs/Model/BaseNoteOrganization.md create mode 100644 docs/Model/BaseNotePerson.md create mode 100644 docs/Model/BaseOrganizationItem.md create mode 100644 docs/Model/BaseOrganizationItemFields.md create mode 100644 docs/Model/BaseOrganizationItemWithEditNameFlag.md create mode 100644 docs/Model/BaseOrganizationItemWithEditNameFlagAllOf.md create mode 100644 docs/Model/BaseOrganizationRelationshipItem.md create mode 100644 docs/Model/BasePersonItem.md create mode 100644 docs/Model/BasePersonItemEmail.md create mode 100644 docs/Model/BasePersonItemPhone.md create mode 100644 docs/Model/BasePipeline.md create mode 100644 docs/Model/BasePipelineWithSelectedFlag.md create mode 100644 docs/Model/BasePipelineWithSelectedFlagAllOf.md create mode 100644 docs/Model/BaseProduct.md create mode 100644 docs/Model/BaseResponse.md create mode 100644 docs/Model/BaseResponseWithStatus.md create mode 100644 docs/Model/BaseResponseWithStatusAllOf.md create mode 100644 docs/Model/BaseRole.md create mode 100644 docs/Model/BaseStage.md create mode 100644 docs/Model/BaseTeam.md create mode 100644 docs/Model/BaseTeamAdditionalProperties.md create mode 100644 docs/Model/BaseUser.md create mode 100644 docs/Model/BaseUserMe.md create mode 100644 docs/Model/BaseUserMeAllOf.md create mode 100644 docs/Model/BaseUserMeAllOfLanguage.md create mode 100644 docs/Model/BaseWebhook.md create mode 100644 docs/Model/BasicDeal.md create mode 100644 docs/Model/BasicDealProduct.md create mode 100644 docs/Model/BasicGoal.md create mode 100644 docs/Model/BasicOrganization.md create mode 100644 docs/Model/BasicPerson.md create mode 100644 docs/Model/BasicPersonEmail.md create mode 100644 docs/Model/BulkDeleteResponse.md create mode 100644 docs/Model/BulkDeleteResponseAllOf.md create mode 100644 docs/Model/BulkDeleteResponseAllOfData.md create mode 100644 docs/Model/CalculatedFields.md create mode 100644 docs/Model/CallLogObject.md create mode 100644 docs/Model/CallLogResponse200.md create mode 100644 docs/Model/CallLogResponse400.md create mode 100644 docs/Model/CallLogResponse403.md create mode 100644 docs/Model/CallLogResponse404.md create mode 100644 docs/Model/CallLogResponse409.md create mode 100644 docs/Model/CallLogResponse410.md create mode 100644 docs/Model/CallLogResponse500.md create mode 100644 docs/Model/CallLogsResponse.md create mode 100644 docs/Model/CallLogsResponseAdditionalData.md create mode 100644 docs/Model/ChannelObject.md create mode 100644 docs/Model/ChannelObjectResponse.md create mode 100644 docs/Model/ChannelObjectResponseData.md create mode 100644 docs/Model/CommentPostPutObject.md create mode 100644 docs/Model/CommonMailThread.md create mode 100644 docs/Model/CreateRemoteFileAndLinkItToItem.md create mode 100644 docs/Model/CreateTeam.md create mode 100644 docs/Model/Currencies.md create mode 100644 docs/Model/DealCollectionResponseObject.md create mode 100644 docs/Model/DealCountAndActivityInfo.md create mode 100644 docs/Model/DealFlowResponse.md create mode 100644 docs/Model/DealFlowResponseAllOf.md create mode 100644 docs/Model/DealFlowResponseAllOfData.md create mode 100644 docs/Model/DealFlowResponseAllOfRelatedObjects.md create mode 100644 docs/Model/DealListActivitiesResponse.md create mode 100644 docs/Model/DealListActivitiesResponseAllOf.md create mode 100644 docs/Model/DealListActivitiesResponseAllOfRelatedObjects.md create mode 100644 docs/Model/DealNonStrict.md create mode 100644 docs/Model/DealNonStrictModeFields.md create mode 100644 docs/Model/DealNonStrictModeFieldsCreatorUserId.md create mode 100644 docs/Model/DealNonStrictWithDetails.md create mode 100644 docs/Model/DealNonStrictWithDetailsAllOf.md create mode 100644 docs/Model/DealNonStrictWithDetailsAllOfAge.md create mode 100644 docs/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.md create mode 100644 docs/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.md create mode 100644 docs/Model/DealOrganizationData.md create mode 100644 docs/Model/DealOrganizationDataWithId.md create mode 100644 docs/Model/DealOrganizationDataWithIdAllOf.md create mode 100644 docs/Model/DealParticipantCountInfo.md create mode 100644 docs/Model/DealParticipants.md create mode 100644 docs/Model/DealPersonData.md create mode 100644 docs/Model/DealPersonDataEmail.md create mode 100644 docs/Model/DealPersonDataPhone.md create mode 100644 docs/Model/DealPersonDataWithId.md create mode 100644 docs/Model/DealPersonDataWithIdAllOf.md create mode 100644 docs/Model/DealProductUnitDuration.md create mode 100644 docs/Model/DealSearchItem.md create mode 100644 docs/Model/DealSearchItemItem.md create mode 100644 docs/Model/DealSearchItemItemOrganization.md create mode 100644 docs/Model/DealSearchItemItemOwner.md create mode 100644 docs/Model/DealSearchItemItemPerson.md create mode 100644 docs/Model/DealSearchItemItemStage.md create mode 100644 docs/Model/DealSearchResponse.md create mode 100644 docs/Model/DealSearchResponseAllOf.md create mode 100644 docs/Model/DealSearchResponseAllOfData.md create mode 100644 docs/Model/DealStrict.md create mode 100644 docs/Model/DealStrictModeFields.md create mode 100644 docs/Model/DealStrictWithMergeId.md create mode 100644 docs/Model/DealStrictWithMergeIdAllOf.md create mode 100644 docs/Model/DealSummary.md create mode 100644 docs/Model/DealSummaryPerCurrency.md create mode 100644 docs/Model/DealSummaryPerCurrencyFull.md create mode 100644 docs/Model/DealSummaryPerCurrencyFullCURRENCYID.md create mode 100644 docs/Model/DealSummaryPerStages.md create mode 100644 docs/Model/DealSummaryPerStagesSTAGEID.md create mode 100644 docs/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.md create mode 100644 docs/Model/DealTitleParameter.md create mode 100644 docs/Model/DealUserData.md create mode 100644 docs/Model/DealUserDataWithId.md create mode 100644 docs/Model/DealUserDataWithIdAllOf.md create mode 100644 docs/Model/DealsCountAndActivityInfo.md create mode 100644 docs/Model/DealsCountInfo.md create mode 100644 docs/Model/DealsMovementsInfo.md create mode 100644 docs/Model/DealsMovementsInfoFormattedValues.md create mode 100644 docs/Model/DealsMovementsInfoValues.md create mode 100644 docs/Model/DeleteActivitiesResponse200.md create mode 100644 docs/Model/DeleteActivitiesResponse200Data.md create mode 100644 docs/Model/DeleteActivityResponse200.md create mode 100644 docs/Model/DeleteActivityResponse200Data.md create mode 100644 docs/Model/DeleteChannelSuccess.md create mode 100644 docs/Model/DeleteComment.md create mode 100644 docs/Model/DeleteConversationSuccess.md create mode 100644 docs/Model/DeleteDeal.md create mode 100644 docs/Model/DeleteDealData.md create mode 100644 docs/Model/DeleteDealFollower.md create mode 100644 docs/Model/DeleteDealFollowerData.md create mode 100644 docs/Model/DeleteDealParticipant.md create mode 100644 docs/Model/DeleteDealParticipantData.md create mode 100644 docs/Model/DeleteDealProduct.md create mode 100644 docs/Model/DeleteDealProductData.md create mode 100644 docs/Model/DeleteFile.md create mode 100644 docs/Model/DeleteFileData.md create mode 100644 docs/Model/DeleteGoalResponse200.md create mode 100644 docs/Model/DeleteMultipleDeals.md create mode 100644 docs/Model/DeleteMultipleDealsData.md create mode 100644 docs/Model/DeleteMultipleProductFieldsResponse.md create mode 100644 docs/Model/DeleteMultipleProductFieldsResponseData.md create mode 100644 docs/Model/DeleteNote.md create mode 100644 docs/Model/DeletePersonResponse.md create mode 100644 docs/Model/DeletePersonResponseAllOf.md create mode 100644 docs/Model/DeletePersonResponseAllOfData.md create mode 100644 docs/Model/DeletePersonsInBulkResponse.md create mode 100644 docs/Model/DeletePersonsInBulkResponseAllOf.md create mode 100644 docs/Model/DeletePersonsInBulkResponseAllOfData.md create mode 100644 docs/Model/DeletePipelineResponse200.md create mode 100644 docs/Model/DeletePipelineResponse200Data.md create mode 100644 docs/Model/DeleteProductFieldResponse.md create mode 100644 docs/Model/DeleteProductFieldResponseData.md create mode 100644 docs/Model/DeleteProductFollowerResponse.md create mode 100644 docs/Model/DeleteProductFollowerResponseData.md create mode 100644 docs/Model/DeleteProductResponse.md create mode 100644 docs/Model/DeleteProductResponseData.md create mode 100644 docs/Model/DeleteResponse.md create mode 100644 docs/Model/DeleteResponseAllOf.md create mode 100644 docs/Model/DeleteResponseAllOfData.md create mode 100644 docs/Model/DeleteRole.md create mode 100644 docs/Model/DeleteRoleAllOf.md create mode 100644 docs/Model/DeleteRoleAllOfData.md create mode 100644 docs/Model/DeleteRoleAssignment.md create mode 100644 docs/Model/DeleteRoleAssignmentAllOf.md create mode 100644 docs/Model/DeleteRoleAssignmentAllOfData.md create mode 100644 docs/Model/DeleteRoleAssignmentRequest.md create mode 100644 docs/Model/DeleteStageResponse200.md create mode 100644 docs/Model/DeleteStageResponse200Data.md create mode 100644 docs/Model/DeleteStagesResponse200.md create mode 100644 docs/Model/DeleteStagesResponse200Data.md create mode 100644 docs/Model/DeleteTeamUserRequest.md create mode 100644 docs/Model/Duration.md create mode 100644 docs/Model/EditPipeline.md create mode 100644 docs/Model/EditPipelineAllOf.md create mode 100644 docs/Model/EmailInfo.md create mode 100644 docs/Model/ExpectedOutcome.md create mode 100644 docs/Model/FailResponse.md create mode 100644 docs/Model/Field.md create mode 100644 docs/Model/FieldCreateRequest.md create mode 100644 docs/Model/FieldCreateRequestAllOf.md create mode 100644 docs/Model/FieldResponse.md create mode 100644 docs/Model/FieldResponseAllOf.md create mode 100644 docs/Model/FieldType.md create mode 100644 docs/Model/FieldTypeAsString.md create mode 100644 docs/Model/FieldUpdateRequest.md create mode 100644 docs/Model/FieldsResponse.md create mode 100644 docs/Model/FieldsResponseAllOf.md create mode 100644 docs/Model/FileData.md create mode 100644 docs/Model/FileItem.md create mode 100644 docs/Model/FilterGetItem.md create mode 100644 docs/Model/FilterType.md create mode 100644 docs/Model/FiltersBulkDeleteResponse.md create mode 100644 docs/Model/FiltersBulkDeleteResponseAllOf.md create mode 100644 docs/Model/FiltersBulkDeleteResponseAllOfData.md create mode 100644 docs/Model/FiltersBulkGetResponse.md create mode 100644 docs/Model/FiltersBulkGetResponseAllOf.md create mode 100644 docs/Model/FiltersDeleteResponse.md create mode 100644 docs/Model/FiltersDeleteResponseAllOf.md create mode 100644 docs/Model/FiltersDeleteResponseAllOfData.md create mode 100644 docs/Model/FiltersGetResponse.md create mode 100644 docs/Model/FiltersGetResponseAllOf.md create mode 100644 docs/Model/FiltersPostResponse.md create mode 100644 docs/Model/FiltersPostResponseAllOf.md create mode 100644 docs/Model/FiltersPostResponseAllOfData.md create mode 100644 docs/Model/FindGoalResponse.md create mode 100644 docs/Model/FollowerData.md create mode 100644 docs/Model/FollowerDataWithID.md create mode 100644 docs/Model/FollowerDataWithIDAllOf.md create mode 100644 docs/Model/FullRole.md create mode 100644 docs/Model/FullRoleAllOf.md create mode 100644 docs/Model/GetActivitiesCollectionResponse200.md create mode 100644 docs/Model/GetActivitiesResponse200.md create mode 100644 docs/Model/GetActivitiesResponse200RelatedObjects.md create mode 100644 docs/Model/GetActivityResponse200.md create mode 100644 docs/Model/GetAddProductAttachementDetails.md create mode 100644 docs/Model/GetAddUpdateStage.md create mode 100644 docs/Model/GetAddedDeal.md create mode 100644 docs/Model/GetAllFiles.md create mode 100644 docs/Model/GetAllPersonsResponse.md create mode 100644 docs/Model/GetAllPersonsResponseAllOf.md create mode 100644 docs/Model/GetAllPipelines.md create mode 100644 docs/Model/GetAllPipelinesAllOf.md create mode 100644 docs/Model/GetAllProductFieldsResponse.md create mode 100644 docs/Model/GetComments.md create mode 100644 docs/Model/GetDeal.md create mode 100644 docs/Model/GetDealAdditionalData.md create mode 100644 docs/Model/GetDeals.md create mode 100644 docs/Model/GetDealsCollection.md create mode 100644 docs/Model/GetDealsConversionRatesInPipeline.md create mode 100644 docs/Model/GetDealsConversionRatesInPipelineAllOf.md create mode 100644 docs/Model/GetDealsConversionRatesInPipelineAllOfData.md create mode 100644 docs/Model/GetDealsMovementsInPipeline.md create mode 100644 docs/Model/GetDealsMovementsInPipelineAllOf.md create mode 100644 docs/Model/GetDealsMovementsInPipelineAllOfData.md create mode 100644 docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.md create mode 100644 docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md create mode 100644 docs/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md create mode 100644 docs/Model/GetDealsRelatedObjects.md create mode 100644 docs/Model/GetDealsSummary.md create mode 100644 docs/Model/GetDealsSummaryData.md create mode 100644 docs/Model/GetDealsSummaryDataValuesTotal.md create mode 100644 docs/Model/GetDealsSummaryDataWeightedValuesTotal.md create mode 100644 docs/Model/GetDealsTimeline.md create mode 100644 docs/Model/GetDealsTimelineData.md create mode 100644 docs/Model/GetDealsTimelineDataTotals.md create mode 100644 docs/Model/GetDuplicatedDeal.md create mode 100644 docs/Model/GetGoalResultResponse200.md create mode 100644 docs/Model/GetGoalsResponse200.md create mode 100644 docs/Model/GetLeadLabelsResponse200.md create mode 100644 docs/Model/GetLeadSourcesResponse200.md create mode 100644 docs/Model/GetLeadSourcesResponse200Data.md create mode 100644 docs/Model/GetLeadsResponse200.md create mode 100644 docs/Model/GetMergedDeal.md create mode 100644 docs/Model/GetNotes.md create mode 100644 docs/Model/GetOneFile.md create mode 100644 docs/Model/GetOnePipeline.md create mode 100644 docs/Model/GetOnePipelineAllOf.md create mode 100644 docs/Model/GetOneStage.md create mode 100644 docs/Model/GetPersonDetailsResponse.md create mode 100644 docs/Model/GetPersonDetailsResponseAllOf.md create mode 100644 docs/Model/GetPersonDetailsResponseAllOfAdditionalData.md create mode 100644 docs/Model/GetProductAttachementDetails.md create mode 100644 docs/Model/GetProductFieldResponse.md create mode 100644 docs/Model/GetRecents.md create mode 100644 docs/Model/GetRecentsAdditionalData.md create mode 100644 docs/Model/GetRole.md create mode 100644 docs/Model/GetRoleAllOf.md create mode 100644 docs/Model/GetRoleAllOfAdditionalData.md create mode 100644 docs/Model/GetRoleAssignments.md create mode 100644 docs/Model/GetRoleAssignmentsAllOf.md create mode 100644 docs/Model/GetRolePipelines.md create mode 100644 docs/Model/GetRolePipelinesAllOf.md create mode 100644 docs/Model/GetRolePipelinesAllOfData.md create mode 100644 docs/Model/GetRoleSettings.md create mode 100644 docs/Model/GetRoleSettingsAllOf.md create mode 100644 docs/Model/GetRoles.md create mode 100644 docs/Model/GetRolesAllOf.md create mode 100644 docs/Model/GetStageDeals.md create mode 100644 docs/Model/GetStages.md create mode 100644 docs/Model/GoalResults.md create mode 100644 docs/Model/GoalType.md create mode 100644 docs/Model/GoalsResponseComponent.md create mode 100644 docs/Model/IconKey.md create mode 100644 docs/Model/InlineResponse200.md create mode 100644 docs/Model/InlineResponse400.md create mode 100644 docs/Model/InlineResponse4001.md create mode 100644 docs/Model/InlineResponse4001AdditionalData.md create mode 100644 docs/Model/InlineResponse400AdditionalData.md create mode 100644 docs/Model/InlineResponse403.md create mode 100644 docs/Model/InlineResponse4031.md create mode 100644 docs/Model/InlineResponse4031AdditionalData.md create mode 100644 docs/Model/InlineResponse403AdditionalData.md create mode 100644 docs/Model/InlineResponse404.md create mode 100644 docs/Model/InlineResponse404AdditionalData.md create mode 100644 docs/Model/ItemSearchAdditionalData.md create mode 100644 docs/Model/ItemSearchAdditionalDataPagination.md create mode 100644 docs/Model/ItemSearchFieldResponse.md create mode 100644 docs/Model/ItemSearchFieldResponseAllOf.md create mode 100644 docs/Model/ItemSearchFieldResponseAllOfData.md create mode 100644 docs/Model/ItemSearchItem.md create mode 100644 docs/Model/ItemSearchResponse.md create mode 100644 docs/Model/ItemSearchResponseAllOf.md create mode 100644 docs/Model/ItemSearchResponseAllOfData.md create mode 100644 docs/Model/LeadIdResponse200.md create mode 100644 docs/Model/LeadIdResponse200Data.md create mode 100644 docs/Model/LeadLabelColor.md create mode 100644 docs/Model/LeadLabelResponse.md create mode 100644 docs/Model/LeadResponse.md create mode 100644 docs/Model/LeadResponse404.md create mode 100644 docs/Model/LeadSearchItem.md create mode 100644 docs/Model/LeadSearchItemItem.md create mode 100644 docs/Model/LeadSearchItemItemOrganization.md create mode 100644 docs/Model/LeadSearchItemItemOwner.md create mode 100644 docs/Model/LeadSearchItemItemPerson.md create mode 100644 docs/Model/LeadSearchResponse.md create mode 100644 docs/Model/LeadSearchResponseAllOf.md create mode 100644 docs/Model/LeadSearchResponseAllOfData.md create mode 100644 docs/Model/LeadValue.md create mode 100644 docs/Model/LinkRemoteFileToItem.md create mode 100644 docs/Model/ListActivitiesResponse.md create mode 100644 docs/Model/ListActivitiesResponseAllOf.md create mode 100644 docs/Model/ListDealsResponse.md create mode 100644 docs/Model/ListDealsResponseAllOf.md create mode 100644 docs/Model/ListDealsResponseAllOfRelatedObjects.md create mode 100644 docs/Model/ListFilesResponse.md create mode 100644 docs/Model/ListFilesResponseAllOf.md create mode 100644 docs/Model/ListFollowersResponse.md create mode 100644 docs/Model/ListFollowersResponseAllOf.md create mode 100644 docs/Model/ListFollowersResponseAllOfData.md create mode 100644 docs/Model/ListMailMessagesResponse.md create mode 100644 docs/Model/ListMailMessagesResponseAllOf.md create mode 100644 docs/Model/ListMailMessagesResponseAllOfData.md create mode 100644 docs/Model/ListPermittedUsersResponse.md create mode 100644 docs/Model/ListPermittedUsersResponse1.md create mode 100644 docs/Model/ListPermittedUsersResponse1AllOf.md create mode 100644 docs/Model/ListPermittedUsersResponseAllOf.md create mode 100644 docs/Model/ListPermittedUsersResponseAllOfData.md create mode 100644 docs/Model/ListPersonProductsResponse.md create mode 100644 docs/Model/ListPersonProductsResponseAllOf.md create mode 100644 docs/Model/ListPersonProductsResponseAllOfDEALID.md create mode 100644 docs/Model/ListPersonProductsResponseAllOfData.md create mode 100644 docs/Model/ListPersonsResponse.md create mode 100644 docs/Model/ListPersonsResponseAllOf.md create mode 100644 docs/Model/ListPersonsResponseAllOfRelatedObjects.md create mode 100644 docs/Model/ListProductAdditionalData.md create mode 100644 docs/Model/ListProductAdditionalDataAllOf.md create mode 100644 docs/Model/ListProductFilesResponse.md create mode 100644 docs/Model/ListProductFilesResponseAllOf.md create mode 100644 docs/Model/ListProductFollowersResponse.md create mode 100644 docs/Model/ListProductFollowersResponseAllOf.md create mode 100644 docs/Model/ListProductFollowersResponseAllOfData.md create mode 100644 docs/Model/ListProductsResponse.md create mode 100644 docs/Model/ListProductsResponseAllOf.md create mode 100644 docs/Model/ListProductsResponseAllOfData.md create mode 100644 docs/Model/ListProductsResponseAllOfRelatedObjects.md create mode 100644 docs/Model/MailMessage.md create mode 100644 docs/Model/MailMessageAllOf.md create mode 100644 docs/Model/MailMessageData.md create mode 100644 docs/Model/MailMessageItemForList.md create mode 100644 docs/Model/MailMessageItemForListAllOf.md create mode 100644 docs/Model/MailParticipant.md create mode 100644 docs/Model/MailServiceBaseResponse.md create mode 100644 docs/Model/MailThread.md create mode 100644 docs/Model/MailThreadAllOf.md create mode 100644 docs/Model/MailThreadDelete.md create mode 100644 docs/Model/MailThreadDeleteAllOf.md create mode 100644 docs/Model/MailThreadDeleteAllOfData.md create mode 100644 docs/Model/MailThreadMessages.md create mode 100644 docs/Model/MailThreadMessagesAllOf.md create mode 100644 docs/Model/MailThreadOne.md create mode 100644 docs/Model/MailThreadOneAllOf.md create mode 100644 docs/Model/MailThreadParticipant.md create mode 100644 docs/Model/MailThreadPut.md create mode 100644 docs/Model/MailThreadPutAllOf.md create mode 100644 docs/Model/MarketingStatus.md create mode 100644 docs/Model/MergeDealsRequest.md create mode 100644 docs/Model/MergeOrganizationsRequest.md create mode 100644 docs/Model/MergePersonDealRelatedInfo.md create mode 100644 docs/Model/MergePersonItem.md create mode 100644 docs/Model/MergePersonsRequest.md create mode 100644 docs/Model/MergePersonsResponse.md create mode 100644 docs/Model/MergePersonsResponseAllOf.md create mode 100644 docs/Model/MessageObject.md create mode 100644 docs/Model/MessageObjectAttachments.md create mode 100644 docs/Model/NewDeal.md create mode 100644 docs/Model/NewDealAllOf.md create mode 100644 docs/Model/NewDealProduct.md create mode 100644 docs/Model/NewFollowerResponse.md create mode 100644 docs/Model/NewFollowerResponseData.md create mode 100644 docs/Model/NewGoal.md create mode 100644 docs/Model/NewOrganization.md create mode 100644 docs/Model/NewOrganizationAllOf.md create mode 100644 docs/Model/NewPerson.md create mode 100644 docs/Model/NewPersonAllOf.md create mode 100644 docs/Model/NewProductField.md create mode 100644 docs/Model/Note.md create mode 100644 docs/Model/NoteAllOf.md create mode 100644 docs/Model/NoteConnectToParams.md create mode 100644 docs/Model/NoteCreatorUser.md create mode 100644 docs/Model/NoteField.md create mode 100644 docs/Model/NoteFieldOptions.md create mode 100644 docs/Model/NoteFieldsResponse.md create mode 100644 docs/Model/NoteFieldsResponseAllOf.md create mode 100644 docs/Model/NoteParams.md create mode 100644 docs/Model/NumberBoolean.md create mode 100644 docs/Model/NumberBooleanDefault0.md create mode 100644 docs/Model/NumberBooleanDefault1.md create mode 100644 docs/Model/ObjectPrices.md create mode 100644 docs/Model/OneLeadResponse200.md create mode 100644 docs/Model/OptionalNameObject.md create mode 100644 docs/Model/OrgAndOwnerId.md create mode 100644 docs/Model/OrganizationAddressInfo.md create mode 100644 docs/Model/OrganizationCountAndAddressInfo.md create mode 100644 docs/Model/OrganizationCountInfo.md create mode 100644 docs/Model/OrganizationData.md create mode 100644 docs/Model/OrganizationDataWithId.md create mode 100644 docs/Model/OrganizationDataWithIdAllOf.md create mode 100644 docs/Model/OrganizationDataWithIdAndActiveFlag.md create mode 100644 docs/Model/OrganizationDataWithIdAndActiveFlagAllOf.md create mode 100644 docs/Model/OrganizationDeleteResponse.md create mode 100644 docs/Model/OrganizationDeleteResponseData.md create mode 100644 docs/Model/OrganizationDetailsGetResponse.md create mode 100644 docs/Model/OrganizationDetailsGetResponseAllOf.md create mode 100644 docs/Model/OrganizationDetailsGetResponseAllOfAdditionalData.md create mode 100644 docs/Model/OrganizationFlowResponse.md create mode 100644 docs/Model/OrganizationFlowResponseAllOf.md create mode 100644 docs/Model/OrganizationFlowResponseAllOfData.md create mode 100644 docs/Model/OrganizationFlowResponseAllOfRelatedObjects.md create mode 100644 docs/Model/OrganizationFollowerDeleteResponse.md create mode 100644 docs/Model/OrganizationFollowerDeleteResponseData.md create mode 100644 docs/Model/OrganizationFollowerItem.md create mode 100644 docs/Model/OrganizationFollowerItemAllOf.md create mode 100644 docs/Model/OrganizationFollowerPostResponse.md create mode 100644 docs/Model/OrganizationFollowersListResponse.md create mode 100644 docs/Model/OrganizationItem.md create mode 100644 docs/Model/OrganizationItemAllOf.md create mode 100644 docs/Model/OrganizationPostResponse.md create mode 100644 docs/Model/OrganizationPostResponseAllOf.md create mode 100644 docs/Model/OrganizationRelationship.md create mode 100644 docs/Model/OrganizationRelationshipDeleteResponse.md create mode 100644 docs/Model/OrganizationRelationshipDeleteResponseAllOf.md create mode 100644 docs/Model/OrganizationRelationshipDeleteResponseAllOfData.md create mode 100644 docs/Model/OrganizationRelationshipDetails.md create mode 100644 docs/Model/OrganizationRelationshipGetResponse.md create mode 100644 docs/Model/OrganizationRelationshipGetResponseAllOf.md create mode 100644 docs/Model/OrganizationRelationshipPostResponse.md create mode 100644 docs/Model/OrganizationRelationshipPostResponseAllOf.md create mode 100644 docs/Model/OrganizationRelationshipUpdateResponse.md create mode 100644 docs/Model/OrganizationRelationshipWithCalculatedFields.md create mode 100644 docs/Model/OrganizationSearchItem.md create mode 100644 docs/Model/OrganizationSearchItemItem.md create mode 100644 docs/Model/OrganizationSearchResponse.md create mode 100644 docs/Model/OrganizationSearchResponseAllOf.md create mode 100644 docs/Model/OrganizationSearchResponseAllOfData.md create mode 100644 docs/Model/OrganizationUpdateResponse.md create mode 100644 docs/Model/OrganizationUpdateResponseAllOf.md create mode 100644 docs/Model/OrganizationsDeleteResponse.md create mode 100644 docs/Model/OrganizationsDeleteResponseData.md create mode 100644 docs/Model/OrganizationsMergeResponse.md create mode 100644 docs/Model/OrganizationsMergeResponseData.md create mode 100644 docs/Model/Owner.md create mode 100644 docs/Model/OwnerAllOf.md create mode 100644 docs/Model/PaginationDetails.md create mode 100644 docs/Model/PaginationDetailsAllOf.md create mode 100644 docs/Model/Params.md create mode 100644 docs/Model/PaymentItem.md create mode 100644 docs/Model/PaymentsResponse.md create mode 100644 docs/Model/PaymentsResponseAllOf.md create mode 100644 docs/Model/PermissionSets.md create mode 100644 docs/Model/PermissionSetsAllOf.md create mode 100644 docs/Model/PermissionSetsItem.md create mode 100644 docs/Model/PersonCountAndEmailInfo.md create mode 100644 docs/Model/PersonCountEmailDealAndActivityInfo.md create mode 100644 docs/Model/PersonCountInfo.md create mode 100644 docs/Model/PersonData.md create mode 100644 docs/Model/PersonDataEmail.md create mode 100644 docs/Model/PersonDataPhone.md create mode 100644 docs/Model/PersonDataWithActiveFlag.md create mode 100644 docs/Model/PersonDataWithActiveFlagAllOf.md create mode 100644 docs/Model/PersonFlowResponse.md create mode 100644 docs/Model/PersonFlowResponseAllOf.md create mode 100644 docs/Model/PersonFlowResponseAllOfData.md create mode 100644 docs/Model/PersonItem.md create mode 100644 docs/Model/PersonListProduct.md create mode 100644 docs/Model/PersonNameCountAndEmailInfo.md create mode 100644 docs/Model/PersonNameCountAndEmailInfoWithIds.md create mode 100644 docs/Model/PersonNameCountAndEmailInfoWithIdsAllOf.md create mode 100644 docs/Model/PersonNameInfo.md create mode 100644 docs/Model/PersonNameInfoWithOrgAndOwnerId.md create mode 100644 docs/Model/PersonSearchItem.md create mode 100644 docs/Model/PersonSearchItemItem.md create mode 100644 docs/Model/PersonSearchItemItemOrganization.md create mode 100644 docs/Model/PersonSearchItemItemOwner.md create mode 100644 docs/Model/PersonSearchResponse.md create mode 100644 docs/Model/PersonSearchResponseAllOf.md create mode 100644 docs/Model/PersonSearchResponseAllOfData.md create mode 100644 docs/Model/PictureData.md create mode 100644 docs/Model/PictureDataPictures.md create mode 100644 docs/Model/PictureDataWithID.md create mode 100644 docs/Model/PictureDataWithIDAllOf.md create mode 100644 docs/Model/PictureDataWithValue.md create mode 100644 docs/Model/PictureDataWithValueAllOf.md create mode 100644 docs/Model/Pipeline.md create mode 100644 docs/Model/PipelineDetails.md create mode 100644 docs/Model/PipelineDetailsAllOf.md create mode 100644 docs/Model/PostComment.md create mode 100644 docs/Model/PostDealParticipants.md create mode 100644 docs/Model/PostGoalResponse.md create mode 100644 docs/Model/PostNote.md create mode 100644 docs/Model/PostRoleAssignment.md create mode 100644 docs/Model/PostRoleAssignmentAllOf.md create mode 100644 docs/Model/PostRoleAssignmentAllOfData.md create mode 100644 docs/Model/PostRoleSettings.md create mode 100644 docs/Model/PostRoleSettingsAllOf.md create mode 100644 docs/Model/PostRoleSettingsAllOfData.md create mode 100644 docs/Model/PostRoles.md create mode 100644 docs/Model/PostRolesAllOf.md create mode 100644 docs/Model/PostRolesAllOfData.md create mode 100644 docs/Model/ProductAttachementFields.md create mode 100644 docs/Model/ProductAttachmentDetails.md create mode 100644 docs/Model/ProductBaseDeal.md create mode 100644 docs/Model/ProductField.md create mode 100644 docs/Model/ProductFieldAllOf.md create mode 100644 docs/Model/ProductFileItem.md create mode 100644 docs/Model/ProductListItem.md create mode 100644 docs/Model/ProductRequest.md create mode 100644 docs/Model/ProductResponse.md create mode 100644 docs/Model/ProductSearchItem.md create mode 100644 docs/Model/ProductSearchItemItem.md create mode 100644 docs/Model/ProductSearchItemItemOwner.md create mode 100644 docs/Model/ProductSearchResponse.md create mode 100644 docs/Model/ProductSearchResponseAllOf.md create mode 100644 docs/Model/ProductSearchResponseAllOfData.md create mode 100644 docs/Model/ProductWithArrayPrices.md create mode 100644 docs/Model/ProductWithObjectPrices.md create mode 100644 docs/Model/ProductsResponse.md create mode 100644 docs/Model/PutRole.md create mode 100644 docs/Model/PutRoleAllOf.md create mode 100644 docs/Model/PutRoleAllOfData.md create mode 100644 docs/Model/PutRolePipelinesBody.md create mode 100644 docs/Model/RecentDataProduct.md create mode 100644 docs/Model/RecentsActivity.md create mode 100644 docs/Model/RecentsActivityType.md create mode 100644 docs/Model/RecentsDeal.md create mode 100644 docs/Model/RecentsFile.md create mode 100644 docs/Model/RecentsFilter.md create mode 100644 docs/Model/RecentsNote.md create mode 100644 docs/Model/RecentsOrganization.md create mode 100644 docs/Model/RecentsPerson.md create mode 100644 docs/Model/RecentsPipeline.md create mode 100644 docs/Model/RecentsProduct.md create mode 100644 docs/Model/RecentsStage.md create mode 100644 docs/Model/RecentsUser.md create mode 100644 docs/Model/RelatedDealData.md create mode 100644 docs/Model/RelatedDealDataDEALID.md create mode 100644 docs/Model/RelatedFollowerData.md create mode 100644 docs/Model/RelatedOrganizationData.md create mode 100644 docs/Model/RelatedOrganizationDataWithActiveFlag.md create mode 100644 docs/Model/RelatedOrganizationName.md create mode 100644 docs/Model/RelatedPersonData.md create mode 100644 docs/Model/RelatedPersonDataWithActiveFlag.md create mode 100644 docs/Model/RelatedPictureData.md create mode 100644 docs/Model/RelatedUserData.md create mode 100644 docs/Model/RelationshipOrganizationInfoItem.md create mode 100644 docs/Model/RelationshipOrganizationInfoItemAllOf.md create mode 100644 docs/Model/RelationshipOrganizationInfoItemWithActiveFlag.md create mode 100644 docs/Model/RequiredNameObject.md create mode 100644 docs/Model/RequredTitleParameter.md create mode 100644 docs/Model/ResponseCallLogObject.md create mode 100644 docs/Model/ResponseCallLogObjectAllOf.md create mode 100644 docs/Model/RoleAssignment.md create mode 100644 docs/Model/RoleAssignmentAllOf.md create mode 100644 docs/Model/RoleSettings.md create mode 100644 docs/Model/RolesAdditionalData.md create mode 100644 docs/Model/RolesAdditionalDataPagination.md create mode 100644 docs/Model/SinglePermissionSetsItem.md create mode 100644 docs/Model/SinglePermissionSetsItemAllOf.md create mode 100644 docs/Model/Stage.md create mode 100644 docs/Model/StageConversions.md create mode 100644 docs/Model/StageDetails.md create mode 100644 docs/Model/StageWithPipelineInfo.md create mode 100644 docs/Model/StageWithPipelineInfoAllOf.md create mode 100644 docs/Model/SubRole.md create mode 100644 docs/Model/SubRoleAllOf.md create mode 100644 docs/Model/SubscriptionAddonsResponse.md create mode 100644 docs/Model/SubscriptionAddonsResponseAllOf.md create mode 100644 docs/Model/SubscriptionInstallmentCreateRequest.md create mode 100644 docs/Model/SubscriptionInstallmentUpdateRequest.md create mode 100644 docs/Model/SubscriptionItem.md create mode 100644 docs/Model/SubscriptionRecurringCancelRequest.md create mode 100644 docs/Model/SubscriptionRecurringCreateRequest.md create mode 100644 docs/Model/SubscriptionRecurringUpdateRequest.md create mode 100644 docs/Model/SubscriptionsIdResponse.md create mode 100644 docs/Model/SubscriptionsIdResponseAllOf.md create mode 100644 docs/Model/Team.md create mode 100644 docs/Model/TeamAllOf.md create mode 100644 docs/Model/TeamId.md create mode 100644 docs/Model/Teams.md create mode 100644 docs/Model/TeamsAllOf.md create mode 100644 docs/Model/Unauthorized.md create mode 100644 docs/Model/UpdateActivityResponse200.md create mode 100644 docs/Model/UpdateDealProduct.md create mode 100644 docs/Model/UpdateDealRequest.md create mode 100644 docs/Model/UpdateFile.md create mode 100644 docs/Model/UpdateFilterRequest.md create mode 100644 docs/Model/UpdateLeadLabelRequest.md create mode 100644 docs/Model/UpdateLeadRequest.md create mode 100644 docs/Model/UpdateOrganization.md create mode 100644 docs/Model/UpdateOrganizationAllOf.md create mode 100644 docs/Model/UpdatePerson.md create mode 100644 docs/Model/UpdatePersonAllOf.md create mode 100644 docs/Model/UpdatePersonResponse.md create mode 100644 docs/Model/UpdateProductField.md create mode 100644 docs/Model/UpdateProductRequestBody.md create mode 100644 docs/Model/UpdateProductResponse.md create mode 100644 docs/Model/UpdateStageRequest.md create mode 100644 docs/Model/UpdateStageRequestAllOf.md create mode 100644 docs/Model/UpdateTeam.md create mode 100644 docs/Model/UpdateTeamAllOf.md create mode 100644 docs/Model/UpdateTeamWithAdditionalProperties.md create mode 100644 docs/Model/UpdateUserRequest.md create mode 100644 docs/Model/User.md create mode 100644 docs/Model/UserAccess.md create mode 100644 docs/Model/UserAllOf.md create mode 100644 docs/Model/UserAssignmentToPermissionSet.md create mode 100644 docs/Model/UserAssignmentsToPermissionSet.md create mode 100644 docs/Model/UserAssignmentsToPermissionSetAllOf.md create mode 100644 docs/Model/UserConnections.md create mode 100644 docs/Model/UserConnectionsAllOf.md create mode 100644 docs/Model/UserConnectionsAllOfData.md create mode 100644 docs/Model/UserData.md create mode 100644 docs/Model/UserDataWithId.md create mode 100644 docs/Model/UserIDs.md create mode 100644 docs/Model/UserIDsAllOf.md create mode 100644 docs/Model/UserMe.md create mode 100644 docs/Model/UserMeAllOf.md create mode 100644 docs/Model/UserPermissions.md create mode 100644 docs/Model/UserPermissionsAllOf.md create mode 100644 docs/Model/UserPermissionsItem.md create mode 100644 docs/Model/UserSettings.md create mode 100644 docs/Model/UserSettingsAllOf.md create mode 100644 docs/Model/UserSettingsItem.md create mode 100644 docs/Model/Users.md create mode 100644 docs/Model/UsersAllOf.md create mode 100644 docs/Model/VisibleTo.md create mode 100644 docs/Model/Webhook.md create mode 100644 docs/Model/WebhookAllOf.md create mode 100644 docs/Model/WebhookBadRequest.md create mode 100644 docs/Model/WebhookBadRequestAllOf.md create mode 100644 docs/Model/Webhooks.md create mode 100644 docs/Model/WebhooksAllOf.md create mode 100644 docs/Model/WebhooksDeleteForbiddenSchema.md create mode 100644 docs/Model/WebhooksDeleteForbiddenSchemaAllOf.md create mode 100644 lib/Api/ActivitiesApi.php create mode 100644 lib/Api/ActivityFieldsApi.php create mode 100644 lib/Api/ActivityTypesApi.php create mode 100644 lib/Api/BillingApi.php create mode 100644 lib/Api/CallLogsApi.php create mode 100644 lib/Api/ChannelsApi.php create mode 100644 lib/Api/CurrenciesApi.php create mode 100644 lib/Api/DealFieldsApi.php create mode 100644 lib/Api/DealsApi.php create mode 100644 lib/Api/FilesApi.php create mode 100644 lib/Api/FiltersApi.php create mode 100644 lib/Api/GoalsApi.php create mode 100644 lib/Api/ItemSearchApi.php create mode 100644 lib/Api/LeadLabelsApi.php create mode 100644 lib/Api/LeadSourcesApi.php create mode 100644 lib/Api/LeadsApi.php create mode 100644 lib/Api/LegacyTeamsApi.php create mode 100644 lib/Api/MailboxApi.php create mode 100644 lib/Api/NoteFieldsApi.php create mode 100644 lib/Api/NotesApi.php create mode 100644 lib/Api/OrganizationFieldsApi.php create mode 100644 lib/Api/OrganizationRelationshipsApi.php create mode 100644 lib/Api/OrganizationsApi.php create mode 100644 lib/Api/PermissionSetsApi.php create mode 100644 lib/Api/PersonFieldsApi.php create mode 100644 lib/Api/PersonsApi.php create mode 100644 lib/Api/PipelinesApi.php create mode 100644 lib/Api/ProductFieldsApi.php create mode 100644 lib/Api/ProductsApi.php create mode 100644 lib/Api/RecentsApi.php create mode 100644 lib/Api/RolesApi.php create mode 100644 lib/Api/StagesApi.php create mode 100644 lib/Api/SubscriptionsApi.php create mode 100644 lib/Api/UserConnectionsApi.php create mode 100644 lib/Api/UserSettingsApi.php create mode 100644 lib/Api/UsersApi.php create mode 100644 lib/Api/WebhooksApi.php create mode 100644 lib/ApiException.php create mode 100644 lib/Configuration.php create mode 100644 lib/Exceptions/OAuthProviderException.php create mode 100644 lib/HeaderSelector.php create mode 100644 lib/Model/ActivityCollectionResponseObject.php create mode 100644 lib/Model/ActivityCollectionResponseObjectAllOf.php create mode 100644 lib/Model/ActivityDistributionData.php create mode 100644 lib/Model/ActivityDistributionDataActivityDistribution.php create mode 100644 lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.php create mode 100644 lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.php create mode 100644 lib/Model/ActivityDistributionDataWithAdditionalData.php create mode 100644 lib/Model/ActivityInfo.php create mode 100644 lib/Model/ActivityObjectFragment.php create mode 100644 lib/Model/ActivityPostObject.php create mode 100644 lib/Model/ActivityPostObjectAllOf.php create mode 100644 lib/Model/ActivityPutObject.php create mode 100644 lib/Model/ActivityPutObjectAllOf.php create mode 100644 lib/Model/ActivityRecordAdditionalData.php create mode 100644 lib/Model/ActivityResponseObject.php create mode 100644 lib/Model/ActivityResponseObjectAllOf.php create mode 100644 lib/Model/ActivityTypeBulkDeleteResponse.php create mode 100644 lib/Model/ActivityTypeBulkDeleteResponseAllOf.php create mode 100644 lib/Model/ActivityTypeBulkDeleteResponseAllOfData.php create mode 100644 lib/Model/ActivityTypeCreateRequest.php create mode 100644 lib/Model/ActivityTypeCreateUpdateDeleteResponse.php create mode 100644 lib/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.php create mode 100644 lib/Model/ActivityTypeListResponse.php create mode 100644 lib/Model/ActivityTypeListResponseAllOf.php create mode 100644 lib/Model/ActivityTypeObjectResponse.php create mode 100644 lib/Model/ActivityTypeUpdateRequest.php create mode 100644 lib/Model/AddActivityResponse200.php create mode 100644 lib/Model/AddActivityResponse200RelatedObjects.php create mode 100644 lib/Model/AddDealFollowerRequest.php create mode 100644 lib/Model/AddDealParticipantRequest.php create mode 100644 lib/Model/AddFile.php create mode 100644 lib/Model/AddFilterRequest.php create mode 100644 lib/Model/AddFollowerToPersonResponse.php create mode 100644 lib/Model/AddFollowerToPersonResponseAllOf.php create mode 100644 lib/Model/AddFollowerToPersonResponseAllOfData.php create mode 100644 lib/Model/AddLeadLabelRequest.php create mode 100644 lib/Model/AddLeadRequest.php create mode 100644 lib/Model/AddNewPipeline.php create mode 100644 lib/Model/AddNewPipelineAllOf.php create mode 100644 lib/Model/AddNoteRequest.php create mode 100644 lib/Model/AddNoteRequestAllOf.php create mode 100644 lib/Model/AddOrUpdateGoalResponse200.php create mode 100644 lib/Model/AddOrUpdateLeadLabelResponse200.php create mode 100644 lib/Model/AddOrUpdateRoleSettingRequest.php create mode 100644 lib/Model/AddOrganizationFollowerRequest.php create mode 100644 lib/Model/AddOrganizationRelationshipRequest.php create mode 100644 lib/Model/AddPersonFollowerRequest.php create mode 100644 lib/Model/AddPersonPictureResponse.php create mode 100644 lib/Model/AddPersonPictureResponseAllOf.php create mode 100644 lib/Model/AddPersonResponse.php create mode 100644 lib/Model/AddPersonResponseAllOf.php create mode 100644 lib/Model/AddProductAttachmentDetails.php create mode 100644 lib/Model/AddProductAttachmentDetailsAllOf.php create mode 100644 lib/Model/AddProductFollowerRequest.php create mode 100644 lib/Model/AddProductRequestBody.php create mode 100644 lib/Model/AddRole.php create mode 100644 lib/Model/AddRoleAssignmentRequest.php create mode 100644 lib/Model/AddTeamUserRequest.php create mode 100644 lib/Model/AddUserRequest.php create mode 100644 lib/Model/AddWebhookRequest.php create mode 100644 lib/Model/AddedDealFollower.php create mode 100644 lib/Model/AddedDealFollowerData.php create mode 100644 lib/Model/AdditionalBaseOrganizationItemInfo.php create mode 100644 lib/Model/AdditionalData.php create mode 100644 lib/Model/AdditionalDataWithCursorPagination.php create mode 100644 lib/Model/AdditionalDataWithOffsetPagination.php create mode 100644 lib/Model/AdditionalDataWithPaginationDetails.php create mode 100644 lib/Model/AdditionalMergePersonInfo.php create mode 100644 lib/Model/AdditionalPersonInfo.php create mode 100644 lib/Model/AllOrganizationRelationshipsGetResponse.php create mode 100644 lib/Model/AllOrganizationRelationshipsGetResponseAllOf.php create mode 100644 lib/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.php create mode 100644 lib/Model/AllOrganizationsGetResponse.php create mode 100644 lib/Model/AllOrganizationsGetResponseAllOf.php create mode 100644 lib/Model/AllOrganizationsGetResponseAllOfRelatedObjects.php create mode 100644 lib/Model/AnyOfRecents.php create mode 100644 lib/Model/ArrayPrices.php create mode 100644 lib/Model/Assignee.php create mode 100644 lib/Model/BaseComment.php create mode 100644 lib/Model/BaseCurrency.php create mode 100644 lib/Model/BaseDeal.php create mode 100644 lib/Model/BaseFollowerItem.php create mode 100644 lib/Model/BaseMailThread.php create mode 100644 lib/Model/BaseMailThreadAllOf.php create mode 100644 lib/Model/BaseMailThreadAllOfParties.php create mode 100644 lib/Model/BaseMailThreadMessages.php create mode 100644 lib/Model/BaseMailThreadMessagesAllOf.php create mode 100644 lib/Model/BaseNote.php create mode 100644 lib/Model/BaseNoteDealTitle.php create mode 100644 lib/Model/BaseNoteOrganization.php create mode 100644 lib/Model/BaseNotePerson.php create mode 100644 lib/Model/BaseOrganizationItem.php create mode 100644 lib/Model/BaseOrganizationItemFields.php create mode 100644 lib/Model/BaseOrganizationItemWithEditNameFlag.php create mode 100644 lib/Model/BaseOrganizationItemWithEditNameFlagAllOf.php create mode 100644 lib/Model/BaseOrganizationRelationshipItem.php create mode 100644 lib/Model/BasePersonItem.php create mode 100644 lib/Model/BasePersonItemEmail.php create mode 100644 lib/Model/BasePersonItemPhone.php create mode 100644 lib/Model/BasePipeline.php create mode 100644 lib/Model/BasePipelineWithSelectedFlag.php create mode 100644 lib/Model/BasePipelineWithSelectedFlagAllOf.php create mode 100644 lib/Model/BaseProduct.php create mode 100644 lib/Model/BaseResponse.php create mode 100644 lib/Model/BaseResponseWithStatus.php create mode 100644 lib/Model/BaseResponseWithStatusAllOf.php create mode 100644 lib/Model/BaseRole.php create mode 100644 lib/Model/BaseStage.php create mode 100644 lib/Model/BaseTeam.php create mode 100644 lib/Model/BaseTeamAdditionalProperties.php create mode 100644 lib/Model/BaseUser.php create mode 100644 lib/Model/BaseUserMe.php create mode 100644 lib/Model/BaseUserMeAllOf.php create mode 100644 lib/Model/BaseUserMeAllOfLanguage.php create mode 100644 lib/Model/BaseWebhook.php create mode 100644 lib/Model/BasicDeal.php create mode 100644 lib/Model/BasicDealProduct.php create mode 100644 lib/Model/BasicGoal.php create mode 100644 lib/Model/BasicOrganization.php create mode 100644 lib/Model/BasicPerson.php create mode 100644 lib/Model/BasicPersonEmail.php create mode 100644 lib/Model/BulkDeleteResponse.php create mode 100644 lib/Model/BulkDeleteResponseAllOf.php create mode 100644 lib/Model/BulkDeleteResponseAllOfData.php create mode 100644 lib/Model/CalculatedFields.php create mode 100644 lib/Model/CallLogObject.php create mode 100644 lib/Model/CallLogResponse200.php create mode 100644 lib/Model/CallLogResponse400.php create mode 100644 lib/Model/CallLogResponse403.php create mode 100644 lib/Model/CallLogResponse404.php create mode 100644 lib/Model/CallLogResponse409.php create mode 100644 lib/Model/CallLogResponse410.php create mode 100644 lib/Model/CallLogResponse500.php create mode 100644 lib/Model/CallLogsResponse.php create mode 100644 lib/Model/CallLogsResponseAdditionalData.php create mode 100644 lib/Model/ChannelObject.php create mode 100644 lib/Model/ChannelObjectResponse.php create mode 100644 lib/Model/ChannelObjectResponseData.php create mode 100644 lib/Model/CommentPostPutObject.php create mode 100644 lib/Model/CommonMailThread.php create mode 100644 lib/Model/CreateRemoteFileAndLinkItToItem.php create mode 100644 lib/Model/CreateTeam.php create mode 100644 lib/Model/Currencies.php create mode 100644 lib/Model/DealCollectionResponseObject.php create mode 100644 lib/Model/DealCountAndActivityInfo.php create mode 100644 lib/Model/DealFlowResponse.php create mode 100644 lib/Model/DealFlowResponseAllOf.php create mode 100644 lib/Model/DealFlowResponseAllOfData.php create mode 100644 lib/Model/DealFlowResponseAllOfRelatedObjects.php create mode 100644 lib/Model/DealListActivitiesResponse.php create mode 100644 lib/Model/DealListActivitiesResponseAllOf.php create mode 100644 lib/Model/DealListActivitiesResponseAllOfRelatedObjects.php create mode 100644 lib/Model/DealNonStrict.php create mode 100644 lib/Model/DealNonStrictModeFields.php create mode 100644 lib/Model/DealNonStrictModeFieldsCreatorUserId.php create mode 100644 lib/Model/DealNonStrictWithDetails.php create mode 100644 lib/Model/DealNonStrictWithDetailsAllOf.php create mode 100644 lib/Model/DealNonStrictWithDetailsAllOfAge.php create mode 100644 lib/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.php create mode 100644 lib/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.php create mode 100644 lib/Model/DealOrganizationData.php create mode 100644 lib/Model/DealOrganizationDataWithId.php create mode 100644 lib/Model/DealOrganizationDataWithIdAllOf.php create mode 100644 lib/Model/DealParticipantCountInfo.php create mode 100644 lib/Model/DealParticipants.php create mode 100644 lib/Model/DealPersonData.php create mode 100644 lib/Model/DealPersonDataEmail.php create mode 100644 lib/Model/DealPersonDataPhone.php create mode 100644 lib/Model/DealPersonDataWithId.php create mode 100644 lib/Model/DealPersonDataWithIdAllOf.php create mode 100644 lib/Model/DealProductUnitDuration.php create mode 100644 lib/Model/DealSearchItem.php create mode 100644 lib/Model/DealSearchItemItem.php create mode 100644 lib/Model/DealSearchItemItemOrganization.php create mode 100644 lib/Model/DealSearchItemItemOwner.php create mode 100644 lib/Model/DealSearchItemItemPerson.php create mode 100644 lib/Model/DealSearchItemItemStage.php create mode 100644 lib/Model/DealSearchResponse.php create mode 100644 lib/Model/DealSearchResponseAllOf.php create mode 100644 lib/Model/DealSearchResponseAllOfData.php create mode 100644 lib/Model/DealStrict.php create mode 100644 lib/Model/DealStrictModeFields.php create mode 100644 lib/Model/DealStrictWithMergeId.php create mode 100644 lib/Model/DealStrictWithMergeIdAllOf.php create mode 100644 lib/Model/DealSummary.php create mode 100644 lib/Model/DealSummaryPerCurrency.php create mode 100644 lib/Model/DealSummaryPerCurrencyFull.php create mode 100644 lib/Model/DealSummaryPerCurrencyFullCURRENCYID.php create mode 100644 lib/Model/DealSummaryPerStages.php create mode 100644 lib/Model/DealSummaryPerStagesSTAGEID.php create mode 100644 lib/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.php create mode 100644 lib/Model/DealTitleParameter.php create mode 100644 lib/Model/DealUserData.php create mode 100644 lib/Model/DealUserDataWithId.php create mode 100644 lib/Model/DealUserDataWithIdAllOf.php create mode 100644 lib/Model/DealsCountAndActivityInfo.php create mode 100644 lib/Model/DealsCountInfo.php create mode 100644 lib/Model/DealsMovementsInfo.php create mode 100644 lib/Model/DealsMovementsInfoFormattedValues.php create mode 100644 lib/Model/DealsMovementsInfoValues.php create mode 100644 lib/Model/DeleteActivitiesResponse200.php create mode 100644 lib/Model/DeleteActivitiesResponse200Data.php create mode 100644 lib/Model/DeleteActivityResponse200.php create mode 100644 lib/Model/DeleteActivityResponse200Data.php create mode 100644 lib/Model/DeleteChannelSuccess.php create mode 100644 lib/Model/DeleteComment.php create mode 100644 lib/Model/DeleteConversationSuccess.php create mode 100644 lib/Model/DeleteDeal.php create mode 100644 lib/Model/DeleteDealData.php create mode 100644 lib/Model/DeleteDealFollower.php create mode 100644 lib/Model/DeleteDealFollowerData.php create mode 100644 lib/Model/DeleteDealParticipant.php create mode 100644 lib/Model/DeleteDealParticipantData.php create mode 100644 lib/Model/DeleteDealProduct.php create mode 100644 lib/Model/DeleteDealProductData.php create mode 100644 lib/Model/DeleteFile.php create mode 100644 lib/Model/DeleteFileData.php create mode 100644 lib/Model/DeleteGoalResponse200.php create mode 100644 lib/Model/DeleteMultipleDeals.php create mode 100644 lib/Model/DeleteMultipleDealsData.php create mode 100644 lib/Model/DeleteMultipleProductFieldsResponse.php create mode 100644 lib/Model/DeleteMultipleProductFieldsResponseData.php create mode 100644 lib/Model/DeleteNote.php create mode 100644 lib/Model/DeletePersonResponse.php create mode 100644 lib/Model/DeletePersonResponseAllOf.php create mode 100644 lib/Model/DeletePersonResponseAllOfData.php create mode 100644 lib/Model/DeletePersonsInBulkResponse.php create mode 100644 lib/Model/DeletePersonsInBulkResponseAllOf.php create mode 100644 lib/Model/DeletePersonsInBulkResponseAllOfData.php create mode 100644 lib/Model/DeletePipelineResponse200.php create mode 100644 lib/Model/DeletePipelineResponse200Data.php create mode 100644 lib/Model/DeleteProductFieldResponse.php create mode 100644 lib/Model/DeleteProductFieldResponseData.php create mode 100644 lib/Model/DeleteProductFollowerResponse.php create mode 100644 lib/Model/DeleteProductFollowerResponseData.php create mode 100644 lib/Model/DeleteProductResponse.php create mode 100644 lib/Model/DeleteProductResponseData.php create mode 100644 lib/Model/DeleteResponse.php create mode 100644 lib/Model/DeleteResponseAllOf.php create mode 100644 lib/Model/DeleteResponseAllOfData.php create mode 100644 lib/Model/DeleteRole.php create mode 100644 lib/Model/DeleteRoleAllOf.php create mode 100644 lib/Model/DeleteRoleAllOfData.php create mode 100644 lib/Model/DeleteRoleAssignment.php create mode 100644 lib/Model/DeleteRoleAssignmentAllOf.php create mode 100644 lib/Model/DeleteRoleAssignmentAllOfData.php create mode 100644 lib/Model/DeleteRoleAssignmentRequest.php create mode 100644 lib/Model/DeleteStageResponse200.php create mode 100644 lib/Model/DeleteStageResponse200Data.php create mode 100644 lib/Model/DeleteStagesResponse200.php create mode 100644 lib/Model/DeleteStagesResponse200Data.php create mode 100644 lib/Model/DeleteTeamUserRequest.php create mode 100644 lib/Model/Duration.php create mode 100644 lib/Model/EditPipeline.php create mode 100644 lib/Model/EditPipelineAllOf.php create mode 100644 lib/Model/EmailInfo.php create mode 100644 lib/Model/ExpectedOutcome.php create mode 100644 lib/Model/FailResponse.php create mode 100644 lib/Model/Field.php create mode 100644 lib/Model/FieldCreateRequest.php create mode 100644 lib/Model/FieldCreateRequestAllOf.php create mode 100644 lib/Model/FieldResponse.php create mode 100644 lib/Model/FieldResponseAllOf.php create mode 100644 lib/Model/FieldType.php create mode 100644 lib/Model/FieldTypeAsString.php create mode 100644 lib/Model/FieldUpdateRequest.php create mode 100644 lib/Model/FieldsResponse.php create mode 100644 lib/Model/FieldsResponseAllOf.php create mode 100644 lib/Model/FileData.php create mode 100644 lib/Model/FileItem.php create mode 100644 lib/Model/FilterGetItem.php create mode 100644 lib/Model/FilterType.php create mode 100644 lib/Model/FiltersBulkDeleteResponse.php create mode 100644 lib/Model/FiltersBulkDeleteResponseAllOf.php create mode 100644 lib/Model/FiltersBulkDeleteResponseAllOfData.php create mode 100644 lib/Model/FiltersBulkGetResponse.php create mode 100644 lib/Model/FiltersBulkGetResponseAllOf.php create mode 100644 lib/Model/FiltersDeleteResponse.php create mode 100644 lib/Model/FiltersDeleteResponseAllOf.php create mode 100644 lib/Model/FiltersDeleteResponseAllOfData.php create mode 100644 lib/Model/FiltersGetResponse.php create mode 100644 lib/Model/FiltersGetResponseAllOf.php create mode 100644 lib/Model/FiltersPostResponse.php create mode 100644 lib/Model/FiltersPostResponseAllOf.php create mode 100644 lib/Model/FiltersPostResponseAllOfData.php create mode 100644 lib/Model/FindGoalResponse.php create mode 100644 lib/Model/FollowerData.php create mode 100644 lib/Model/FollowerDataWithID.php create mode 100644 lib/Model/FollowerDataWithIDAllOf.php create mode 100644 lib/Model/FullRole.php create mode 100644 lib/Model/FullRoleAllOf.php create mode 100644 lib/Model/GetActivitiesCollectionResponse200.php create mode 100644 lib/Model/GetActivitiesResponse200.php create mode 100644 lib/Model/GetActivitiesResponse200RelatedObjects.php create mode 100644 lib/Model/GetActivityResponse200.php create mode 100644 lib/Model/GetAddProductAttachementDetails.php create mode 100644 lib/Model/GetAddUpdateStage.php create mode 100644 lib/Model/GetAddedDeal.php create mode 100644 lib/Model/GetAllFiles.php create mode 100644 lib/Model/GetAllPersonsResponse.php create mode 100644 lib/Model/GetAllPersonsResponseAllOf.php create mode 100644 lib/Model/GetAllPipelines.php create mode 100644 lib/Model/GetAllPipelinesAllOf.php create mode 100644 lib/Model/GetAllProductFieldsResponse.php create mode 100644 lib/Model/GetComments.php create mode 100644 lib/Model/GetDeal.php create mode 100644 lib/Model/GetDealAdditionalData.php create mode 100644 lib/Model/GetDeals.php create mode 100644 lib/Model/GetDealsCollection.php create mode 100644 lib/Model/GetDealsConversionRatesInPipeline.php create mode 100644 lib/Model/GetDealsConversionRatesInPipelineAllOf.php create mode 100644 lib/Model/GetDealsConversionRatesInPipelineAllOfData.php create mode 100644 lib/Model/GetDealsMovementsInPipeline.php create mode 100644 lib/Model/GetDealsMovementsInPipelineAllOf.php create mode 100644 lib/Model/GetDealsMovementsInPipelineAllOfData.php create mode 100644 lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.php create mode 100644 lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.php create mode 100644 lib/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.php create mode 100644 lib/Model/GetDealsRelatedObjects.php create mode 100644 lib/Model/GetDealsSummary.php create mode 100644 lib/Model/GetDealsSummaryData.php create mode 100644 lib/Model/GetDealsSummaryDataValuesTotal.php create mode 100644 lib/Model/GetDealsSummaryDataWeightedValuesTotal.php create mode 100644 lib/Model/GetDealsTimeline.php create mode 100644 lib/Model/GetDealsTimelineData.php create mode 100644 lib/Model/GetDealsTimelineDataTotals.php create mode 100644 lib/Model/GetDuplicatedDeal.php create mode 100644 lib/Model/GetGoalResultResponse200.php create mode 100644 lib/Model/GetGoalsResponse200.php create mode 100644 lib/Model/GetLeadLabelsResponse200.php create mode 100644 lib/Model/GetLeadSourcesResponse200.php create mode 100644 lib/Model/GetLeadSourcesResponse200Data.php create mode 100644 lib/Model/GetLeadsResponse200.php create mode 100644 lib/Model/GetMergedDeal.php create mode 100644 lib/Model/GetNotes.php create mode 100644 lib/Model/GetOneFile.php create mode 100644 lib/Model/GetOnePipeline.php create mode 100644 lib/Model/GetOnePipelineAllOf.php create mode 100644 lib/Model/GetOneStage.php create mode 100644 lib/Model/GetPersonDetailsResponse.php create mode 100644 lib/Model/GetPersonDetailsResponseAllOf.php create mode 100644 lib/Model/GetPersonDetailsResponseAllOfAdditionalData.php create mode 100644 lib/Model/GetProductAttachementDetails.php create mode 100644 lib/Model/GetProductFieldResponse.php create mode 100644 lib/Model/GetRecents.php create mode 100644 lib/Model/GetRecentsAdditionalData.php create mode 100644 lib/Model/GetRole.php create mode 100644 lib/Model/GetRoleAllOf.php create mode 100644 lib/Model/GetRoleAllOfAdditionalData.php create mode 100644 lib/Model/GetRoleAssignments.php create mode 100644 lib/Model/GetRoleAssignmentsAllOf.php create mode 100644 lib/Model/GetRolePipelines.php create mode 100644 lib/Model/GetRolePipelinesAllOf.php create mode 100644 lib/Model/GetRolePipelinesAllOfData.php create mode 100644 lib/Model/GetRoleSettings.php create mode 100644 lib/Model/GetRoleSettingsAllOf.php create mode 100644 lib/Model/GetRoles.php create mode 100644 lib/Model/GetRolesAllOf.php create mode 100644 lib/Model/GetStageDeals.php create mode 100644 lib/Model/GetStages.php create mode 100644 lib/Model/GoalResults.php create mode 100644 lib/Model/GoalType.php create mode 100644 lib/Model/GoalsResponseComponent.php create mode 100644 lib/Model/IconKey.php create mode 100644 lib/Model/InlineResponse200.php create mode 100644 lib/Model/InlineResponse400.php create mode 100644 lib/Model/InlineResponse4001.php create mode 100644 lib/Model/InlineResponse4001AdditionalData.php create mode 100644 lib/Model/InlineResponse400AdditionalData.php create mode 100644 lib/Model/InlineResponse403.php create mode 100644 lib/Model/InlineResponse4031.php create mode 100644 lib/Model/InlineResponse4031AdditionalData.php create mode 100644 lib/Model/InlineResponse403AdditionalData.php create mode 100644 lib/Model/InlineResponse404.php create mode 100644 lib/Model/InlineResponse404AdditionalData.php create mode 100644 lib/Model/ItemSearchAdditionalData.php create mode 100644 lib/Model/ItemSearchAdditionalDataPagination.php create mode 100644 lib/Model/ItemSearchFieldResponse.php create mode 100644 lib/Model/ItemSearchFieldResponseAllOf.php create mode 100644 lib/Model/ItemSearchFieldResponseAllOfData.php create mode 100644 lib/Model/ItemSearchItem.php create mode 100644 lib/Model/ItemSearchResponse.php create mode 100644 lib/Model/ItemSearchResponseAllOf.php create mode 100644 lib/Model/ItemSearchResponseAllOfData.php create mode 100644 lib/Model/LeadIdResponse200.php create mode 100644 lib/Model/LeadIdResponse200Data.php create mode 100644 lib/Model/LeadLabelColor.php create mode 100644 lib/Model/LeadLabelResponse.php create mode 100644 lib/Model/LeadResponse.php create mode 100644 lib/Model/LeadResponse404.php create mode 100644 lib/Model/LeadSearchItem.php create mode 100644 lib/Model/LeadSearchItemItem.php create mode 100644 lib/Model/LeadSearchItemItemOrganization.php create mode 100644 lib/Model/LeadSearchItemItemOwner.php create mode 100644 lib/Model/LeadSearchItemItemPerson.php create mode 100644 lib/Model/LeadSearchResponse.php create mode 100644 lib/Model/LeadSearchResponseAllOf.php create mode 100644 lib/Model/LeadSearchResponseAllOfData.php create mode 100644 lib/Model/LeadValue.php create mode 100644 lib/Model/LinkRemoteFileToItem.php create mode 100644 lib/Model/ListActivitiesResponse.php create mode 100644 lib/Model/ListActivitiesResponseAllOf.php create mode 100644 lib/Model/ListDealsResponse.php create mode 100644 lib/Model/ListDealsResponseAllOf.php create mode 100644 lib/Model/ListDealsResponseAllOfRelatedObjects.php create mode 100644 lib/Model/ListFilesResponse.php create mode 100644 lib/Model/ListFilesResponseAllOf.php create mode 100644 lib/Model/ListFollowersResponse.php create mode 100644 lib/Model/ListFollowersResponseAllOf.php create mode 100644 lib/Model/ListFollowersResponseAllOfData.php create mode 100644 lib/Model/ListMailMessagesResponse.php create mode 100644 lib/Model/ListMailMessagesResponseAllOf.php create mode 100644 lib/Model/ListMailMessagesResponseAllOfData.php create mode 100644 lib/Model/ListPermittedUsersResponse.php create mode 100644 lib/Model/ListPermittedUsersResponse1.php create mode 100644 lib/Model/ListPermittedUsersResponse1AllOf.php create mode 100644 lib/Model/ListPermittedUsersResponseAllOf.php create mode 100644 lib/Model/ListPermittedUsersResponseAllOfData.php create mode 100644 lib/Model/ListPersonProductsResponse.php create mode 100644 lib/Model/ListPersonProductsResponseAllOf.php create mode 100644 lib/Model/ListPersonProductsResponseAllOfDEALID.php create mode 100644 lib/Model/ListPersonProductsResponseAllOfData.php create mode 100644 lib/Model/ListPersonsResponse.php create mode 100644 lib/Model/ListPersonsResponseAllOf.php create mode 100644 lib/Model/ListPersonsResponseAllOfRelatedObjects.php create mode 100644 lib/Model/ListProductAdditionalData.php create mode 100644 lib/Model/ListProductAdditionalDataAllOf.php create mode 100644 lib/Model/ListProductFilesResponse.php create mode 100644 lib/Model/ListProductFilesResponseAllOf.php create mode 100644 lib/Model/ListProductFollowersResponse.php create mode 100644 lib/Model/ListProductFollowersResponseAllOf.php create mode 100644 lib/Model/ListProductFollowersResponseAllOfData.php create mode 100644 lib/Model/ListProductsResponse.php create mode 100644 lib/Model/ListProductsResponseAllOf.php create mode 100644 lib/Model/ListProductsResponseAllOfData.php create mode 100644 lib/Model/ListProductsResponseAllOfRelatedObjects.php create mode 100644 lib/Model/MailMessage.php create mode 100644 lib/Model/MailMessageAllOf.php create mode 100644 lib/Model/MailMessageData.php create mode 100644 lib/Model/MailMessageItemForList.php create mode 100644 lib/Model/MailMessageItemForListAllOf.php create mode 100644 lib/Model/MailParticipant.php create mode 100644 lib/Model/MailServiceBaseResponse.php create mode 100644 lib/Model/MailThread.php create mode 100644 lib/Model/MailThreadAllOf.php create mode 100644 lib/Model/MailThreadDelete.php create mode 100644 lib/Model/MailThreadDeleteAllOf.php create mode 100644 lib/Model/MailThreadDeleteAllOfData.php create mode 100644 lib/Model/MailThreadMessages.php create mode 100644 lib/Model/MailThreadMessagesAllOf.php create mode 100644 lib/Model/MailThreadOne.php create mode 100644 lib/Model/MailThreadOneAllOf.php create mode 100644 lib/Model/MailThreadParticipant.php create mode 100644 lib/Model/MailThreadPut.php create mode 100644 lib/Model/MailThreadPutAllOf.php create mode 100644 lib/Model/MarketingStatus.php create mode 100644 lib/Model/MergeDealsRequest.php create mode 100644 lib/Model/MergeOrganizationsRequest.php create mode 100644 lib/Model/MergePersonDealRelatedInfo.php create mode 100644 lib/Model/MergePersonItem.php create mode 100644 lib/Model/MergePersonsRequest.php create mode 100644 lib/Model/MergePersonsResponse.php create mode 100644 lib/Model/MergePersonsResponseAllOf.php create mode 100644 lib/Model/MessageObject.php create mode 100644 lib/Model/MessageObjectAttachments.php create mode 100644 lib/Model/ModelInterface.php create mode 100644 lib/Model/NewDeal.php create mode 100644 lib/Model/NewDealAllOf.php create mode 100644 lib/Model/NewDealProduct.php create mode 100644 lib/Model/NewFollowerResponse.php create mode 100644 lib/Model/NewFollowerResponseData.php create mode 100644 lib/Model/NewGoal.php create mode 100644 lib/Model/NewOrganization.php create mode 100644 lib/Model/NewOrganizationAllOf.php create mode 100644 lib/Model/NewPerson.php create mode 100644 lib/Model/NewPersonAllOf.php create mode 100644 lib/Model/NewProductField.php create mode 100644 lib/Model/Note.php create mode 100644 lib/Model/NoteAllOf.php create mode 100644 lib/Model/NoteConnectToParams.php create mode 100644 lib/Model/NoteCreatorUser.php create mode 100644 lib/Model/NoteField.php create mode 100644 lib/Model/NoteFieldOptions.php create mode 100644 lib/Model/NoteFieldsResponse.php create mode 100644 lib/Model/NoteFieldsResponseAllOf.php create mode 100644 lib/Model/NoteParams.php create mode 100644 lib/Model/NumberBoolean.php create mode 100644 lib/Model/NumberBooleanDefault0.php create mode 100644 lib/Model/NumberBooleanDefault1.php create mode 100644 lib/Model/ObjectPrices.php create mode 100644 lib/Model/OneLeadResponse200.php create mode 100644 lib/Model/OptionalNameObject.php create mode 100644 lib/Model/OrgAndOwnerId.php create mode 100644 lib/Model/OrganizationAddressInfo.php create mode 100644 lib/Model/OrganizationCountAndAddressInfo.php create mode 100644 lib/Model/OrganizationCountInfo.php create mode 100644 lib/Model/OrganizationData.php create mode 100644 lib/Model/OrganizationDataWithId.php create mode 100644 lib/Model/OrganizationDataWithIdAllOf.php create mode 100644 lib/Model/OrganizationDataWithIdAndActiveFlag.php create mode 100644 lib/Model/OrganizationDataWithIdAndActiveFlagAllOf.php create mode 100644 lib/Model/OrganizationDeleteResponse.php create mode 100644 lib/Model/OrganizationDeleteResponseData.php create mode 100644 lib/Model/OrganizationDetailsGetResponse.php create mode 100644 lib/Model/OrganizationDetailsGetResponseAllOf.php create mode 100644 lib/Model/OrganizationDetailsGetResponseAllOfAdditionalData.php create mode 100644 lib/Model/OrganizationFlowResponse.php create mode 100644 lib/Model/OrganizationFlowResponseAllOf.php create mode 100644 lib/Model/OrganizationFlowResponseAllOfData.php create mode 100644 lib/Model/OrganizationFlowResponseAllOfRelatedObjects.php create mode 100644 lib/Model/OrganizationFollowerDeleteResponse.php create mode 100644 lib/Model/OrganizationFollowerDeleteResponseData.php create mode 100644 lib/Model/OrganizationFollowerItem.php create mode 100644 lib/Model/OrganizationFollowerItemAllOf.php create mode 100644 lib/Model/OrganizationFollowerPostResponse.php create mode 100644 lib/Model/OrganizationFollowersListResponse.php create mode 100644 lib/Model/OrganizationItem.php create mode 100644 lib/Model/OrganizationItemAllOf.php create mode 100644 lib/Model/OrganizationPostResponse.php create mode 100644 lib/Model/OrganizationPostResponseAllOf.php create mode 100644 lib/Model/OrganizationRelationship.php create mode 100644 lib/Model/OrganizationRelationshipDeleteResponse.php create mode 100644 lib/Model/OrganizationRelationshipDeleteResponseAllOf.php create mode 100644 lib/Model/OrganizationRelationshipDeleteResponseAllOfData.php create mode 100644 lib/Model/OrganizationRelationshipDetails.php create mode 100644 lib/Model/OrganizationRelationshipGetResponse.php create mode 100644 lib/Model/OrganizationRelationshipGetResponseAllOf.php create mode 100644 lib/Model/OrganizationRelationshipPostResponse.php create mode 100644 lib/Model/OrganizationRelationshipPostResponseAllOf.php create mode 100644 lib/Model/OrganizationRelationshipUpdateResponse.php create mode 100644 lib/Model/OrganizationRelationshipWithCalculatedFields.php create mode 100644 lib/Model/OrganizationSearchItem.php create mode 100644 lib/Model/OrganizationSearchItemItem.php create mode 100644 lib/Model/OrganizationSearchResponse.php create mode 100644 lib/Model/OrganizationSearchResponseAllOf.php create mode 100644 lib/Model/OrganizationSearchResponseAllOfData.php create mode 100644 lib/Model/OrganizationUpdateResponse.php create mode 100644 lib/Model/OrganizationUpdateResponseAllOf.php create mode 100644 lib/Model/OrganizationsDeleteResponse.php create mode 100644 lib/Model/OrganizationsDeleteResponseData.php create mode 100644 lib/Model/OrganizationsMergeResponse.php create mode 100644 lib/Model/OrganizationsMergeResponseData.php create mode 100644 lib/Model/Owner.php create mode 100644 lib/Model/OwnerAllOf.php create mode 100644 lib/Model/PaginationDetails.php create mode 100644 lib/Model/PaginationDetailsAllOf.php create mode 100644 lib/Model/Params.php create mode 100644 lib/Model/PaymentItem.php create mode 100644 lib/Model/PaymentsResponse.php create mode 100644 lib/Model/PaymentsResponseAllOf.php create mode 100644 lib/Model/PermissionSets.php create mode 100644 lib/Model/PermissionSetsAllOf.php create mode 100644 lib/Model/PermissionSetsItem.php create mode 100644 lib/Model/PersonCountAndEmailInfo.php create mode 100644 lib/Model/PersonCountEmailDealAndActivityInfo.php create mode 100644 lib/Model/PersonCountInfo.php create mode 100644 lib/Model/PersonData.php create mode 100644 lib/Model/PersonDataEmail.php create mode 100644 lib/Model/PersonDataPhone.php create mode 100644 lib/Model/PersonDataWithActiveFlag.php create mode 100644 lib/Model/PersonDataWithActiveFlagAllOf.php create mode 100644 lib/Model/PersonFlowResponse.php create mode 100644 lib/Model/PersonFlowResponseAllOf.php create mode 100644 lib/Model/PersonFlowResponseAllOfData.php create mode 100644 lib/Model/PersonItem.php create mode 100644 lib/Model/PersonListProduct.php create mode 100644 lib/Model/PersonNameCountAndEmailInfo.php create mode 100644 lib/Model/PersonNameCountAndEmailInfoWithIds.php create mode 100644 lib/Model/PersonNameCountAndEmailInfoWithIdsAllOf.php create mode 100644 lib/Model/PersonNameInfo.php create mode 100644 lib/Model/PersonNameInfoWithOrgAndOwnerId.php create mode 100644 lib/Model/PersonSearchItem.php create mode 100644 lib/Model/PersonSearchItemItem.php create mode 100644 lib/Model/PersonSearchItemItemOrganization.php create mode 100644 lib/Model/PersonSearchItemItemOwner.php create mode 100644 lib/Model/PersonSearchResponse.php create mode 100644 lib/Model/PersonSearchResponseAllOf.php create mode 100644 lib/Model/PersonSearchResponseAllOfData.php create mode 100644 lib/Model/PictureData.php create mode 100644 lib/Model/PictureDataPictures.php create mode 100644 lib/Model/PictureDataWithID.php create mode 100644 lib/Model/PictureDataWithIDAllOf.php create mode 100644 lib/Model/PictureDataWithValue.php create mode 100644 lib/Model/PictureDataWithValueAllOf.php create mode 100644 lib/Model/Pipeline.php create mode 100644 lib/Model/PipelineDetails.php create mode 100644 lib/Model/PipelineDetailsAllOf.php create mode 100644 lib/Model/PostComment.php create mode 100644 lib/Model/PostDealParticipants.php create mode 100644 lib/Model/PostGoalResponse.php create mode 100644 lib/Model/PostNote.php create mode 100644 lib/Model/PostRoleAssignment.php create mode 100644 lib/Model/PostRoleAssignmentAllOf.php create mode 100644 lib/Model/PostRoleAssignmentAllOfData.php create mode 100644 lib/Model/PostRoleSettings.php create mode 100644 lib/Model/PostRoleSettingsAllOf.php create mode 100644 lib/Model/PostRoleSettingsAllOfData.php create mode 100644 lib/Model/PostRoles.php create mode 100644 lib/Model/PostRolesAllOf.php create mode 100644 lib/Model/PostRolesAllOfData.php create mode 100644 lib/Model/ProductAttachementFields.php create mode 100644 lib/Model/ProductAttachmentDetails.php create mode 100644 lib/Model/ProductBaseDeal.php create mode 100644 lib/Model/ProductField.php create mode 100644 lib/Model/ProductFieldAllOf.php create mode 100644 lib/Model/ProductFileItem.php create mode 100644 lib/Model/ProductListItem.php create mode 100644 lib/Model/ProductRequest.php create mode 100644 lib/Model/ProductResponse.php create mode 100644 lib/Model/ProductSearchItem.php create mode 100644 lib/Model/ProductSearchItemItem.php create mode 100644 lib/Model/ProductSearchItemItemOwner.php create mode 100644 lib/Model/ProductSearchResponse.php create mode 100644 lib/Model/ProductSearchResponseAllOf.php create mode 100644 lib/Model/ProductSearchResponseAllOfData.php create mode 100644 lib/Model/ProductWithArrayPrices.php create mode 100644 lib/Model/ProductWithObjectPrices.php create mode 100644 lib/Model/ProductsResponse.php create mode 100644 lib/Model/PutRole.php create mode 100644 lib/Model/PutRoleAllOf.php create mode 100644 lib/Model/PutRoleAllOfData.php create mode 100644 lib/Model/PutRolePipelinesBody.php create mode 100644 lib/Model/RecentDataProduct.php create mode 100644 lib/Model/RecentsActivity.php create mode 100644 lib/Model/RecentsActivityType.php create mode 100644 lib/Model/RecentsDeal.php create mode 100644 lib/Model/RecentsFile.php create mode 100644 lib/Model/RecentsFilter.php create mode 100644 lib/Model/RecentsNote.php create mode 100644 lib/Model/RecentsOrganization.php create mode 100644 lib/Model/RecentsPerson.php create mode 100644 lib/Model/RecentsPipeline.php create mode 100644 lib/Model/RecentsProduct.php create mode 100644 lib/Model/RecentsStage.php create mode 100644 lib/Model/RecentsUser.php create mode 100644 lib/Model/RelatedDealData.php create mode 100644 lib/Model/RelatedDealDataDEALID.php create mode 100644 lib/Model/RelatedFollowerData.php create mode 100644 lib/Model/RelatedOrganizationData.php create mode 100644 lib/Model/RelatedOrganizationDataWithActiveFlag.php create mode 100644 lib/Model/RelatedOrganizationName.php create mode 100644 lib/Model/RelatedPersonData.php create mode 100644 lib/Model/RelatedPersonDataWithActiveFlag.php create mode 100644 lib/Model/RelatedPictureData.php create mode 100644 lib/Model/RelatedUserData.php create mode 100644 lib/Model/RelationshipOrganizationInfoItem.php create mode 100644 lib/Model/RelationshipOrganizationInfoItemAllOf.php create mode 100644 lib/Model/RelationshipOrganizationInfoItemWithActiveFlag.php create mode 100644 lib/Model/RequiredNameObject.php create mode 100644 lib/Model/RequredTitleParameter.php create mode 100644 lib/Model/ResponseCallLogObject.php create mode 100644 lib/Model/ResponseCallLogObjectAllOf.php create mode 100644 lib/Model/RoleAssignment.php create mode 100644 lib/Model/RoleAssignmentAllOf.php create mode 100644 lib/Model/RoleSettings.php create mode 100644 lib/Model/RolesAdditionalData.php create mode 100644 lib/Model/RolesAdditionalDataPagination.php create mode 100644 lib/Model/SinglePermissionSetsItem.php create mode 100644 lib/Model/SinglePermissionSetsItemAllOf.php create mode 100644 lib/Model/Stage.php create mode 100644 lib/Model/StageConversions.php create mode 100644 lib/Model/StageDetails.php create mode 100644 lib/Model/StageWithPipelineInfo.php create mode 100644 lib/Model/StageWithPipelineInfoAllOf.php create mode 100644 lib/Model/SubRole.php create mode 100644 lib/Model/SubRoleAllOf.php create mode 100644 lib/Model/SubscriptionAddonsResponse.php create mode 100644 lib/Model/SubscriptionAddonsResponseAllOf.php create mode 100644 lib/Model/SubscriptionInstallmentCreateRequest.php create mode 100644 lib/Model/SubscriptionInstallmentUpdateRequest.php create mode 100644 lib/Model/SubscriptionItem.php create mode 100644 lib/Model/SubscriptionRecurringCancelRequest.php create mode 100644 lib/Model/SubscriptionRecurringCreateRequest.php create mode 100644 lib/Model/SubscriptionRecurringUpdateRequest.php create mode 100644 lib/Model/SubscriptionsIdResponse.php create mode 100644 lib/Model/SubscriptionsIdResponseAllOf.php create mode 100644 lib/Model/Team.php create mode 100644 lib/Model/TeamAllOf.php create mode 100644 lib/Model/TeamId.php create mode 100644 lib/Model/Teams.php create mode 100644 lib/Model/TeamsAllOf.php create mode 100644 lib/Model/Unauthorized.php create mode 100644 lib/Model/UpdateActivityResponse200.php create mode 100644 lib/Model/UpdateDealProduct.php create mode 100644 lib/Model/UpdateDealRequest.php create mode 100644 lib/Model/UpdateFile.php create mode 100644 lib/Model/UpdateFilterRequest.php create mode 100644 lib/Model/UpdateLeadLabelRequest.php create mode 100644 lib/Model/UpdateLeadRequest.php create mode 100644 lib/Model/UpdateOrganization.php create mode 100644 lib/Model/UpdateOrganizationAllOf.php create mode 100644 lib/Model/UpdatePerson.php create mode 100644 lib/Model/UpdatePersonAllOf.php create mode 100644 lib/Model/UpdatePersonResponse.php create mode 100644 lib/Model/UpdateProductField.php create mode 100644 lib/Model/UpdateProductRequestBody.php create mode 100644 lib/Model/UpdateProductResponse.php create mode 100644 lib/Model/UpdateStageRequest.php create mode 100644 lib/Model/UpdateStageRequestAllOf.php create mode 100644 lib/Model/UpdateTeam.php create mode 100644 lib/Model/UpdateTeamAllOf.php create mode 100644 lib/Model/UpdateTeamWithAdditionalProperties.php create mode 100644 lib/Model/UpdateUserRequest.php create mode 100644 lib/Model/User.php create mode 100644 lib/Model/UserAccess.php create mode 100644 lib/Model/UserAllOf.php create mode 100644 lib/Model/UserAssignmentToPermissionSet.php create mode 100644 lib/Model/UserAssignmentsToPermissionSet.php create mode 100644 lib/Model/UserAssignmentsToPermissionSetAllOf.php create mode 100644 lib/Model/UserConnections.php create mode 100644 lib/Model/UserConnectionsAllOf.php create mode 100644 lib/Model/UserConnectionsAllOfData.php create mode 100644 lib/Model/UserData.php create mode 100644 lib/Model/UserDataWithId.php create mode 100644 lib/Model/UserIDs.php create mode 100644 lib/Model/UserIDsAllOf.php create mode 100644 lib/Model/UserMe.php create mode 100644 lib/Model/UserMeAllOf.php create mode 100644 lib/Model/UserPermissions.php create mode 100644 lib/Model/UserPermissionsAllOf.php create mode 100644 lib/Model/UserPermissionsItem.php create mode 100644 lib/Model/UserSettings.php create mode 100644 lib/Model/UserSettingsAllOf.php create mode 100644 lib/Model/UserSettingsItem.php create mode 100644 lib/Model/Users.php create mode 100644 lib/Model/UsersAllOf.php create mode 100644 lib/Model/VisibleTo.php create mode 100644 lib/Model/Webhook.php create mode 100644 lib/Model/WebhookAllOf.php create mode 100644 lib/Model/WebhookBadRequest.php create mode 100644 lib/Model/WebhookBadRequestAllOf.php create mode 100644 lib/Model/Webhooks.php create mode 100644 lib/Model/WebhooksAllOf.php create mode 100644 lib/Model/WebhooksDeleteForbiddenSchema.php create mode 100644 lib/Model/WebhooksDeleteForbiddenSchemaAllOf.php create mode 100644 lib/ObjectSerializer.php create mode 100644 package.json create mode 100644 phpstan.neon delete mode 100644 src/APIException.php delete mode 100644 src/APIHelper.php delete mode 100644 src/Client.php delete mode 100644 src/Configuration.php delete mode 100644 src/Controllers/ActivitiesController.php delete mode 100644 src/Controllers/ActivityFieldsController.php delete mode 100644 src/Controllers/ActivityTypesController.php delete mode 100644 src/Controllers/BaseController.php delete mode 100644 src/Controllers/CallLogsController.php delete mode 100644 src/Controllers/CurrenciesController.php delete mode 100644 src/Controllers/DealFieldsController.php delete mode 100644 src/Controllers/DealsController.php delete mode 100644 src/Controllers/FilesController.php delete mode 100644 src/Controllers/FiltersController.php delete mode 100644 src/Controllers/GlobalMessagesController.php delete mode 100644 src/Controllers/GoalsController.php delete mode 100644 src/Controllers/ItemSearchController.php delete mode 100644 src/Controllers/MailMessagesController.php delete mode 100644 src/Controllers/MailThreadsController.php delete mode 100644 src/Controllers/NoteFieldsController.php delete mode 100644 src/Controllers/NotesController.php delete mode 100644 src/Controllers/OAuthAuthorizationController.php delete mode 100644 src/Controllers/OrganizationFieldsController.php delete mode 100644 src/Controllers/OrganizationRelationshipsController.php delete mode 100644 src/Controllers/OrganizationsController.php delete mode 100644 src/Controllers/PermissionSetsController.php delete mode 100644 src/Controllers/PersonFieldsController.php delete mode 100644 src/Controllers/PersonsController.php delete mode 100644 src/Controllers/PipelinesController.php delete mode 100644 src/Controllers/ProductFieldsController.php delete mode 100644 src/Controllers/ProductsController.php delete mode 100644 src/Controllers/RecentsController.php delete mode 100644 src/Controllers/RolesController.php delete mode 100644 src/Controllers/StagesController.php delete mode 100644 src/Controllers/TeamsController.php delete mode 100644 src/Controllers/UserConnectionsController.php delete mode 100644 src/Controllers/UserSettingsController.php delete mode 100644 src/Controllers/UsersController.php delete mode 100644 src/Controllers/WebhooksController.php delete mode 100644 src/Environments.php delete mode 100644 src/Exceptions/FailResponseException.php delete mode 100644 src/Exceptions/OAuthProviderException.php delete mode 100644 src/Exceptions/SchemaException.php delete mode 100644 src/Exceptions/UnauthorizedException.php delete mode 100644 src/Exceptions/Webhooks403ErrorException.php delete mode 100644 src/Http/HttpCallBack.php delete mode 100644 src/Http/HttpContext.php delete mode 100644 src/Http/HttpMethod.php delete mode 100644 src/Http/HttpRequest.php delete mode 100644 src/Http/HttpResponse.php delete mode 100644 src/Models/Activity.php delete mode 100644 src/Models/AddedDealFollower.php delete mode 100644 src/Models/AdditionalData.php delete mode 100644 src/Models/AdditionalData2.php delete mode 100644 src/Models/AdditionalData3.php delete mode 100644 src/Models/AdditionalData4.php delete mode 100644 src/Models/AdditionalData5.php delete mode 100644 src/Models/AdditionalDataWithPaginationDetails.php delete mode 100644 src/Models/Age.php delete mode 100644 src/Models/AssigneeTypeEnum.php delete mode 100644 src/Models/AverageTimeToWon.php delete mode 100644 src/Models/BaseCurrency.php delete mode 100644 src/Models/BaseDeal.php delete mode 100644 src/Models/BaseMailThread.php delete mode 100644 src/Models/BaseMailThreadMessages.php delete mode 100644 src/Models/BaseNote.php delete mode 100644 src/Models/BaseNoteDealTitle.php delete mode 100644 src/Models/BaseResponse.php delete mode 100644 src/Models/BaseRole.php delete mode 100644 src/Models/BaseTeam.php delete mode 100644 src/Models/BaseUser.php delete mode 100644 src/Models/BaseUserMe.php delete mode 100644 src/Models/BasicDeal.php delete mode 100644 src/Models/BasicDealProduct.php delete mode 100644 src/Models/BasicGoal.php delete mode 100644 src/Models/BasicOrganization.php delete mode 100644 src/Models/BasicPerson.php delete mode 100644 src/Models/BasicPersonField.php delete mode 100644 src/Models/BasicProductField.php delete mode 100644 src/Models/CommonMailThread.php delete mode 100644 src/Models/CreateTeam.php delete mode 100644 src/Models/CreatorUserId.php delete mode 100644 src/Models/Currencies.php delete mode 100644 src/Models/Data.php delete mode 100644 src/Models/Data1.php delete mode 100644 src/Models/Data10.php delete mode 100644 src/Models/Data11.php delete mode 100644 src/Models/Data12.php delete mode 100644 src/Models/Data13.php delete mode 100644 src/Models/Data14.php delete mode 100644 src/Models/Data15.php delete mode 100644 src/Models/Data16.php delete mode 100644 src/Models/Data17.php delete mode 100644 src/Models/Data18.php delete mode 100644 src/Models/Data19.php delete mode 100644 src/Models/Data2.php delete mode 100644 src/Models/Data20.php delete mode 100644 src/Models/Data21.php delete mode 100644 src/Models/Data22.php delete mode 100644 src/Models/Data23.php delete mode 100644 src/Models/Data24.php delete mode 100644 src/Models/Data25.php delete mode 100644 src/Models/Data26.php delete mode 100644 src/Models/Data27.php delete mode 100644 src/Models/Data29.php delete mode 100644 src/Models/Data3.php delete mode 100644 src/Models/Data4.php delete mode 100644 src/Models/Data5.php delete mode 100644 src/Models/Data6.php delete mode 100644 src/Models/Data7.php delete mode 100644 src/Models/Data8.php delete mode 100644 src/Models/Data9.php delete mode 100644 src/Models/Deal.php delete mode 100644 src/Models/DealDefaultVisibilityEnum.php delete mode 100644 src/Models/DealNonStrictModeFields.php delete mode 100644 src/Models/DealOrganizationData.php delete mode 100644 src/Models/DealPersonData.php delete mode 100644 src/Models/DealStrictModeFields.php delete mode 100644 src/Models/DealUserData.php delete mode 100644 src/Models/DeleteDeal.php delete mode 100644 src/Models/DeleteDealFollower.php delete mode 100644 src/Models/DeleteDealParticipant.php delete mode 100644 src/Models/DeleteDealProduct.php delete mode 100644 src/Models/DeleteMultipleDeals.php delete mode 100644 src/Models/DeleteMultipleProductFieldsResponse.php delete mode 100644 src/Models/DeleteNote.php delete mode 100644 src/Models/DeleteProductFieldResponse.php delete mode 100644 src/Models/DeleteProductFollowerResponse.php delete mode 100644 src/Models/DeleteRole.php delete mode 100644 src/Models/DeleteRoleAssignment.php delete mode 100644 src/Models/Email.php delete mode 100644 src/Models/EventActionEnum.php delete mode 100644 src/Models/EventObjectEnum.php delete mode 100644 src/Models/ExpectedOutcomeTrackingMetricEnum.php delete mode 100644 src/Models/FieldType.php delete mode 100644 src/Models/FieldType1Enum.php delete mode 100644 src/Models/FieldType4Enum.php delete mode 100644 src/Models/FieldType6Enum.php delete mode 100644 src/Models/FileTypeEnum.php delete mode 100644 src/Models/FilterTypeEnum.php delete mode 100644 src/Models/FolderEnum.php delete mode 100644 src/Models/FullRole.php delete mode 100644 src/Models/GetAddProductAttachementDetails.php delete mode 100644 src/Models/GetAddedDeal.php delete mode 100644 src/Models/GetAllProductFieldsResponse.php delete mode 100644 src/Models/GetDeal.php delete mode 100644 src/Models/GetDeals.php delete mode 100644 src/Models/GetDealsByName.php delete mode 100644 src/Models/GetDealsSummary.php delete mode 100644 src/Models/GetDealsTimeline.php delete mode 100644 src/Models/GetDuplicatedDeal.php delete mode 100644 src/Models/GetMergedDeal.php delete mode 100644 src/Models/GetNotes.php delete mode 100644 src/Models/GetProductAttachementDetails.php delete mode 100644 src/Models/GetProductFieldResponse.php delete mode 100644 src/Models/GetRole.php delete mode 100644 src/Models/GetRoleAssignments.php delete mode 100644 src/Models/GetRoleSettings.php delete mode 100644 src/Models/GetRoleSubroles.php delete mode 100644 src/Models/GetRoles.php delete mode 100644 src/Models/GlobalMessageBaseResponse.php delete mode 100644 src/Models/GlobalMessageData.php delete mode 100644 src/Models/GlobalMessageDelete.php delete mode 100644 src/Models/GlobalMessageGet.php delete mode 100644 src/Models/GlobalMessageUserData.php delete mode 100644 src/Models/IconKeyEnum.php delete mode 100644 src/Models/Interval2Enum.php delete mode 100644 src/Models/IntervalEnum.php delete mode 100644 src/Models/ItemType2Enum.php delete mode 100644 src/Models/ItemTypeEnum.php delete mode 100644 src/Models/ItemsEnum.php delete mode 100644 src/Models/Language.php delete mode 100644 src/Models/MailMessage.php delete mode 100644 src/Models/MailMessageData.php delete mode 100644 src/Models/MailParticipant.php delete mode 100644 src/Models/MailServiceBaseResponse.php delete mode 100644 src/Models/MailThread.php delete mode 100644 src/Models/MailThreadDelete.php delete mode 100644 src/Models/MailThreadMessages.php delete mode 100644 src/Models/MailThreadOne.php delete mode 100644 src/Models/MailThreadParticipant.php delete mode 100644 src/Models/MailThreadPut.php delete mode 100644 src/Models/MailTrackingStatusEnum.php delete mode 100644 src/Models/NewDeal.php delete mode 100644 src/Models/NewDealProduct.php delete mode 100644 src/Models/NewFollowerResponse.php delete mode 100644 src/Models/NewGoal.php delete mode 100644 src/Models/NewOrganization.php delete mode 100644 src/Models/NewOrganizationField.php delete mode 100644 src/Models/NewPerson.php delete mode 100644 src/Models/NewPersonField.php delete mode 100644 src/Models/NewProductField.php delete mode 100644 src/Models/Note.php delete mode 100644 src/Models/NoteCreatorUser.php delete mode 100644 src/Models/NumberBooleanEnum.php delete mode 100644 src/Models/OAuthProviderErrorEnum.php delete mode 100644 src/Models/OAuthToken.php delete mode 100644 src/Models/OrderByEnum.php delete mode 100644 src/Models/OrgId.php delete mode 100644 src/Models/Organization.php delete mode 100644 src/Models/OrganizationRelationship.php delete mode 100644 src/Models/Pagination.php delete mode 100644 src/Models/Pagination1.php delete mode 100644 src/Models/Parties.php delete mode 100644 src/Models/PermissionSets.php delete mode 100644 src/Models/PermissionSetsItem.php delete mode 100644 src/Models/Person.php delete mode 100644 src/Models/PersonId.php delete mode 100644 src/Models/Phone.php delete mode 100644 src/Models/Pipeline.php delete mode 100644 src/Models/PostNote.php delete mode 100644 src/Models/PostRoleAssignment.php delete mode 100644 src/Models/PostRoleSettings.php delete mode 100644 src/Models/PostRoles.php delete mode 100644 src/Models/ProductAttachementFields.php delete mode 100644 src/Models/ProductField.php delete mode 100644 src/Models/PutRole.php delete mode 100644 src/Models/RelatedObjects.php delete mode 100644 src/Models/RemoteLocationEnum.php delete mode 100644 src/Models/RoleAssignment.php delete mode 100644 src/Models/RoleSettings.php delete mode 100644 src/Models/RolesAdditionalData.php delete mode 100644 src/Models/RottenFlagEnum.php delete mode 100644 src/Models/Schema1.php delete mode 100644 src/Models/SettingKeyEnum.php delete mode 100644 src/Models/SinglePermissionSetsItem.php delete mode 100644 src/Models/Stage.php delete mode 100644 src/Models/Status2Enum.php delete mode 100644 src/Models/Status3Enum.php delete mode 100644 src/Models/StatusEnum.php delete mode 100644 src/Models/StayInPipelineStages.php delete mode 100644 src/Models/SubRole.php delete mode 100644 src/Models/Teams.php delete mode 100644 src/Models/Totals.php delete mode 100644 src/Models/Type2Enum.php delete mode 100644 src/Models/TypeEnum.php delete mode 100644 src/Models/TypeNameEnum.php delete mode 100644 src/Models/UpdateTeam.php delete mode 100644 src/Models/User.php delete mode 100644 src/Models/UserAssignmentToPermissionSet.php delete mode 100644 src/Models/UserAssignmentsToPermissionSet.php delete mode 100644 src/Models/UserConnections.php delete mode 100644 src/Models/UserIDs.php delete mode 100644 src/Models/UserId.php delete mode 100644 src/Models/UserMe.php delete mode 100644 src/Models/Users.php delete mode 100644 src/Models/ValuesTotal.php delete mode 100644 src/Models/VisibleToEnum.php delete mode 100644 src/Models/WebhooksResponse.php delete mode 100644 src/Models/WebhooksResponse1.php delete mode 100644 src/Models/WeightedValuesTotal.php delete mode 100644 src/OAuthManager.php delete mode 100644 src/Servers.php delete mode 100644 src/Utils/CamelCaseHelper.php delete mode 100644 src/Utils/DateTimeHelper.php delete mode 100644 src/Utils/JsonSerializer.php create mode 100644 test/Activities/ActivityApiTest.php create mode 100644 test/CallLogs/CallLogsApiTest.php create mode 100644 test/Deals/DealsApiTest.php create mode 100644 test/Leads/LeadsApiTest.php create mode 100644 test/MailThreads/MailThreadsApiTest.php create mode 100644 test/Pest.php create mode 100644 test/Recents/RecentsApiTest.php create mode 100644 test/Stages/StagesApiTest.php create mode 100644 test/TestCase.php delete mode 100644 tests/Controllers/ActivitiesControllerTest.php delete mode 100644 tests/Controllers/ActivityFieldsControllerTest.php delete mode 100644 tests/Controllers/ActivityTypesControllerTest.php delete mode 100644 tests/Controllers/CurrenciesControllerTest.php delete mode 100644 tests/Controllers/DealFieldsControllerTest.php delete mode 100644 tests/Controllers/DealsControllerTest.php delete mode 100644 tests/Controllers/FilesControllerTest.php delete mode 100644 tests/Controllers/FiltersControllerTest.php delete mode 100644 tests/Controllers/GoalsControllerTest.php delete mode 100644 tests/Controllers/MailThreadsControllerTest.php delete mode 100644 tests/Controllers/NoteFieldsControllerTest.php delete mode 100644 tests/Controllers/NotesControllerTest.php delete mode 100644 tests/Controllers/OrganizationFieldsControllerTest.php delete mode 100644 tests/Controllers/OrganizationRelationshipsControllerTest.php delete mode 100644 tests/Controllers/OrganizationsControllerTest.php delete mode 100644 tests/Controllers/PermissionSetsControllerTest.php delete mode 100644 tests/Controllers/PersonFieldsControllerTest.php delete mode 100644 tests/Controllers/PersonsControllerTest.php delete mode 100644 tests/Controllers/PipelinesControllerTest.php delete mode 100644 tests/Controllers/ProductFieldsControllerTest.php delete mode 100644 tests/Controllers/ProductsControllerTest.php delete mode 100644 tests/Controllers/RolesControllerTest.php delete mode 100644 tests/Controllers/StagesControllerTest.php delete mode 100644 tests/Controllers/TeamsControllerTest.php delete mode 100644 tests/Controllers/UserConnectionsControllerTest.php delete mode 100644 tests/Controllers/UserSettingsControllerTest.php delete mode 100644 tests/Controllers/UsersControllerTest.php delete mode 100644 tests/Controllers/WebhooksControllerTest.php delete mode 100644 tests/HttpCallBackCatcher.php delete mode 100644 tests/TestHelper.php delete mode 100644 tests/bootstrap.php diff --git a/.gitattributes b/.gitattributes index b85c6d93..6380a1d3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,9 @@ # Ignore dev/testing files for distribution builds -/tests export-ignore +/test export-ignore .gitattributes export-ignore .gitignore export-ignore phpunit.xml export-ignore +phpunit.xml.dist export-ignore +phpstan.neon export-ignore CODEOWNERS export-ignore repository.json export-ignore diff --git a/.gitignore b/.gitignore index bca85ffa..f43b5c55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,17 @@ -# System, IDE, misc -.DS_Store -.idea -.vscode -composer.* -vendor \ No newline at end of file +# 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 +composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache + +# IDE +.idea \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /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 00000000..34d9bde6 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,1556 @@ +.gitignore +.php_cs +.travis.yml +MIGRATION-5.x.md +README.md +composer.json +docs/Api/ActivitiesApi.md +docs/Api/ActivityFieldsApi.md +docs/Api/ActivityTypesApi.md +docs/Api/BillingApi.md +docs/Api/CallLogsApi.md +docs/Api/ChannelsApi.md +docs/Api/CurrenciesApi.md +docs/Api/DealFieldsApi.md +docs/Api/DealsApi.md +docs/Api/FilesApi.md +docs/Api/FiltersApi.md +docs/Api/GoalsApi.md +docs/Api/ItemSearchApi.md +docs/Api/LeadLabelsApi.md +docs/Api/LeadSourcesApi.md +docs/Api/LeadsApi.md +docs/Api/LegacyTeamsApi.md +docs/Api/MailboxApi.md +docs/Api/NoteFieldsApi.md +docs/Api/NotesApi.md +docs/Api/OrganizationFieldsApi.md +docs/Api/OrganizationRelationshipsApi.md +docs/Api/OrganizationsApi.md +docs/Api/PermissionSetsApi.md +docs/Api/PersonFieldsApi.md +docs/Api/PersonsApi.md +docs/Api/PipelinesApi.md +docs/Api/ProductFieldsApi.md +docs/Api/ProductsApi.md +docs/Api/RecentsApi.md +docs/Api/RolesApi.md +docs/Api/StagesApi.md +docs/Api/SubscriptionsApi.md +docs/Api/UserConnectionsApi.md +docs/Api/UserSettingsApi.md +docs/Api/UsersApi.md +docs/Api/WebhooksApi.md +docs/Model/ActivityCollectionResponseObject.md +docs/Model/ActivityCollectionResponseObjectAllOf.md +docs/Model/ActivityDistributionData.md +docs/Model/ActivityDistributionDataActivityDistribution.md +docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.md +docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md +docs/Model/ActivityDistributionDataWithAdditionalData.md +docs/Model/ActivityInfo.md +docs/Model/ActivityObjectFragment.md +docs/Model/ActivityPostObject.md +docs/Model/ActivityPostObjectAllOf.md +docs/Model/ActivityPutObject.md +docs/Model/ActivityPutObjectAllOf.md +docs/Model/ActivityRecordAdditionalData.md +docs/Model/ActivityResponseObject.md +docs/Model/ActivityResponseObjectAllOf.md +docs/Model/ActivityTypeBulkDeleteResponse.md +docs/Model/ActivityTypeBulkDeleteResponseAllOf.md +docs/Model/ActivityTypeBulkDeleteResponseAllOfData.md +docs/Model/ActivityTypeCreateRequest.md +docs/Model/ActivityTypeCreateUpdateDeleteResponse.md +docs/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.md +docs/Model/ActivityTypeListResponse.md +docs/Model/ActivityTypeListResponseAllOf.md +docs/Model/ActivityTypeObjectResponse.md +docs/Model/ActivityTypeUpdateRequest.md +docs/Model/AddActivityResponse200.md +docs/Model/AddActivityResponse200RelatedObjects.md +docs/Model/AddDealFollowerRequest.md +docs/Model/AddDealParticipantRequest.md +docs/Model/AddFile.md +docs/Model/AddFilterRequest.md +docs/Model/AddFollowerToPersonResponse.md +docs/Model/AddFollowerToPersonResponseAllOf.md +docs/Model/AddFollowerToPersonResponseAllOfData.md +docs/Model/AddLeadLabelRequest.md +docs/Model/AddLeadRequest.md +docs/Model/AddNewPipeline.md +docs/Model/AddNewPipelineAllOf.md +docs/Model/AddNoteRequest.md +docs/Model/AddNoteRequestAllOf.md +docs/Model/AddOrUpdateGoalResponse200.md +docs/Model/AddOrUpdateLeadLabelResponse200.md +docs/Model/AddOrUpdateRoleSettingRequest.md +docs/Model/AddOrganizationFollowerRequest.md +docs/Model/AddOrganizationRelationshipRequest.md +docs/Model/AddPersonFollowerRequest.md +docs/Model/AddPersonPictureResponse.md +docs/Model/AddPersonPictureResponseAllOf.md +docs/Model/AddPersonResponse.md +docs/Model/AddPersonResponseAllOf.md +docs/Model/AddProductAttachmentDetails.md +docs/Model/AddProductAttachmentDetailsAllOf.md +docs/Model/AddProductFollowerRequest.md +docs/Model/AddProductRequestBody.md +docs/Model/AddRole.md +docs/Model/AddRoleAssignmentRequest.md +docs/Model/AddTeamUserRequest.md +docs/Model/AddUserRequest.md +docs/Model/AddWebhookRequest.md +docs/Model/AddedDealFollower.md +docs/Model/AddedDealFollowerData.md +docs/Model/AdditionalBaseOrganizationItemInfo.md +docs/Model/AdditionalData.md +docs/Model/AdditionalDataWithCursorPagination.md +docs/Model/AdditionalDataWithOffsetPagination.md +docs/Model/AdditionalDataWithPaginationDetails.md +docs/Model/AdditionalMergePersonInfo.md +docs/Model/AdditionalPersonInfo.md +docs/Model/AllOrganizationRelationshipsGetResponse.md +docs/Model/AllOrganizationRelationshipsGetResponseAllOf.md +docs/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.md +docs/Model/AllOrganizationsGetResponse.md +docs/Model/AllOrganizationsGetResponseAllOf.md +docs/Model/AllOrganizationsGetResponseAllOfRelatedObjects.md +docs/Model/ArrayPrices.md +docs/Model/Assignee.md +docs/Model/BaseComment.md +docs/Model/BaseCurrency.md +docs/Model/BaseDeal.md +docs/Model/BaseFollowerItem.md +docs/Model/BaseMailThread.md +docs/Model/BaseMailThreadAllOf.md +docs/Model/BaseMailThreadAllOfParties.md +docs/Model/BaseMailThreadMessages.md +docs/Model/BaseMailThreadMessagesAllOf.md +docs/Model/BaseNote.md +docs/Model/BaseNoteDealTitle.md +docs/Model/BaseNoteOrganization.md +docs/Model/BaseNotePerson.md +docs/Model/BaseOrganizationItem.md +docs/Model/BaseOrganizationItemFields.md +docs/Model/BaseOrganizationItemWithEditNameFlag.md +docs/Model/BaseOrganizationItemWithEditNameFlagAllOf.md +docs/Model/BaseOrganizationRelationshipItem.md +docs/Model/BasePersonItem.md +docs/Model/BasePersonItemEmail.md +docs/Model/BasePersonItemPhone.md +docs/Model/BasePipeline.md +docs/Model/BasePipelineWithSelectedFlag.md +docs/Model/BasePipelineWithSelectedFlagAllOf.md +docs/Model/BaseProduct.md +docs/Model/BaseResponse.md +docs/Model/BaseResponseWithStatus.md +docs/Model/BaseResponseWithStatusAllOf.md +docs/Model/BaseRole.md +docs/Model/BaseStage.md +docs/Model/BaseTeam.md +docs/Model/BaseTeamAdditionalProperties.md +docs/Model/BaseUser.md +docs/Model/BaseUserMe.md +docs/Model/BaseUserMeAllOf.md +docs/Model/BaseUserMeAllOfLanguage.md +docs/Model/BaseWebhook.md +docs/Model/BasicDeal.md +docs/Model/BasicDealProduct.md +docs/Model/BasicGoal.md +docs/Model/BasicOrganization.md +docs/Model/BasicPerson.md +docs/Model/BasicPersonEmail.md +docs/Model/BulkDeleteResponse.md +docs/Model/BulkDeleteResponseAllOf.md +docs/Model/BulkDeleteResponseAllOfData.md +docs/Model/CalculatedFields.md +docs/Model/CallLogObject.md +docs/Model/CallLogResponse200.md +docs/Model/CallLogResponse400.md +docs/Model/CallLogResponse403.md +docs/Model/CallLogResponse404.md +docs/Model/CallLogResponse409.md +docs/Model/CallLogResponse410.md +docs/Model/CallLogResponse500.md +docs/Model/CallLogsResponse.md +docs/Model/CallLogsResponseAdditionalData.md +docs/Model/ChannelObject.md +docs/Model/ChannelObjectResponse.md +docs/Model/ChannelObjectResponseData.md +docs/Model/CommentPostPutObject.md +docs/Model/CommonMailThread.md +docs/Model/CreateRemoteFileAndLinkItToItem.md +docs/Model/CreateTeam.md +docs/Model/Currencies.md +docs/Model/DealCollectionResponseObject.md +docs/Model/DealCountAndActivityInfo.md +docs/Model/DealFlowResponse.md +docs/Model/DealFlowResponseAllOf.md +docs/Model/DealFlowResponseAllOfData.md +docs/Model/DealFlowResponseAllOfRelatedObjects.md +docs/Model/DealListActivitiesResponse.md +docs/Model/DealListActivitiesResponseAllOf.md +docs/Model/DealListActivitiesResponseAllOfRelatedObjects.md +docs/Model/DealNonStrict.md +docs/Model/DealNonStrictModeFields.md +docs/Model/DealNonStrictModeFieldsCreatorUserId.md +docs/Model/DealNonStrictWithDetails.md +docs/Model/DealNonStrictWithDetailsAllOf.md +docs/Model/DealNonStrictWithDetailsAllOfAge.md +docs/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.md +docs/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.md +docs/Model/DealOrganizationData.md +docs/Model/DealOrganizationDataWithId.md +docs/Model/DealOrganizationDataWithIdAllOf.md +docs/Model/DealParticipantCountInfo.md +docs/Model/DealParticipants.md +docs/Model/DealPersonData.md +docs/Model/DealPersonDataEmail.md +docs/Model/DealPersonDataPhone.md +docs/Model/DealPersonDataWithId.md +docs/Model/DealPersonDataWithIdAllOf.md +docs/Model/DealProductUnitDuration.md +docs/Model/DealSearchItem.md +docs/Model/DealSearchItemItem.md +docs/Model/DealSearchItemItemOrganization.md +docs/Model/DealSearchItemItemOwner.md +docs/Model/DealSearchItemItemPerson.md +docs/Model/DealSearchItemItemStage.md +docs/Model/DealSearchResponse.md +docs/Model/DealSearchResponseAllOf.md +docs/Model/DealSearchResponseAllOfData.md +docs/Model/DealStrict.md +docs/Model/DealStrictModeFields.md +docs/Model/DealStrictWithMergeId.md +docs/Model/DealStrictWithMergeIdAllOf.md +docs/Model/DealSummary.md +docs/Model/DealSummaryPerCurrency.md +docs/Model/DealSummaryPerCurrencyFull.md +docs/Model/DealSummaryPerCurrencyFullCURRENCYID.md +docs/Model/DealSummaryPerStages.md +docs/Model/DealSummaryPerStagesSTAGEID.md +docs/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.md +docs/Model/DealTitleParameter.md +docs/Model/DealUserData.md +docs/Model/DealUserDataWithId.md +docs/Model/DealUserDataWithIdAllOf.md +docs/Model/DealsCountAndActivityInfo.md +docs/Model/DealsCountInfo.md +docs/Model/DealsMovementsInfo.md +docs/Model/DealsMovementsInfoFormattedValues.md +docs/Model/DealsMovementsInfoValues.md +docs/Model/DeleteActivitiesResponse200.md +docs/Model/DeleteActivitiesResponse200Data.md +docs/Model/DeleteActivityResponse200.md +docs/Model/DeleteActivityResponse200Data.md +docs/Model/DeleteChannelSuccess.md +docs/Model/DeleteComment.md +docs/Model/DeleteConversationSuccess.md +docs/Model/DeleteDeal.md +docs/Model/DeleteDealData.md +docs/Model/DeleteDealFollower.md +docs/Model/DeleteDealFollowerData.md +docs/Model/DeleteDealParticipant.md +docs/Model/DeleteDealParticipantData.md +docs/Model/DeleteDealProduct.md +docs/Model/DeleteDealProductData.md +docs/Model/DeleteFile.md +docs/Model/DeleteFileData.md +docs/Model/DeleteGoalResponse200.md +docs/Model/DeleteMultipleDeals.md +docs/Model/DeleteMultipleDealsData.md +docs/Model/DeleteMultipleProductFieldsResponse.md +docs/Model/DeleteMultipleProductFieldsResponseData.md +docs/Model/DeleteNote.md +docs/Model/DeletePersonResponse.md +docs/Model/DeletePersonResponseAllOf.md +docs/Model/DeletePersonResponseAllOfData.md +docs/Model/DeletePersonsInBulkResponse.md +docs/Model/DeletePersonsInBulkResponseAllOf.md +docs/Model/DeletePersonsInBulkResponseAllOfData.md +docs/Model/DeletePipelineResponse200.md +docs/Model/DeletePipelineResponse200Data.md +docs/Model/DeleteProductFieldResponse.md +docs/Model/DeleteProductFieldResponseData.md +docs/Model/DeleteProductFollowerResponse.md +docs/Model/DeleteProductFollowerResponseData.md +docs/Model/DeleteProductResponse.md +docs/Model/DeleteProductResponseData.md +docs/Model/DeleteResponse.md +docs/Model/DeleteResponseAllOf.md +docs/Model/DeleteResponseAllOfData.md +docs/Model/DeleteRole.md +docs/Model/DeleteRoleAllOf.md +docs/Model/DeleteRoleAllOfData.md +docs/Model/DeleteRoleAssignment.md +docs/Model/DeleteRoleAssignmentAllOf.md +docs/Model/DeleteRoleAssignmentAllOfData.md +docs/Model/DeleteRoleAssignmentRequest.md +docs/Model/DeleteStageResponse200.md +docs/Model/DeleteStageResponse200Data.md +docs/Model/DeleteStagesResponse200.md +docs/Model/DeleteStagesResponse200Data.md +docs/Model/DeleteTeamUserRequest.md +docs/Model/Duration.md +docs/Model/EditPipeline.md +docs/Model/EditPipelineAllOf.md +docs/Model/EmailInfo.md +docs/Model/ExpectedOutcome.md +docs/Model/FailResponse.md +docs/Model/Field.md +docs/Model/FieldCreateRequest.md +docs/Model/FieldCreateRequestAllOf.md +docs/Model/FieldResponse.md +docs/Model/FieldResponseAllOf.md +docs/Model/FieldType.md +docs/Model/FieldTypeAsString.md +docs/Model/FieldUpdateRequest.md +docs/Model/FieldsResponse.md +docs/Model/FieldsResponseAllOf.md +docs/Model/FileData.md +docs/Model/FileItem.md +docs/Model/FilterGetItem.md +docs/Model/FilterType.md +docs/Model/FiltersBulkDeleteResponse.md +docs/Model/FiltersBulkDeleteResponseAllOf.md +docs/Model/FiltersBulkDeleteResponseAllOfData.md +docs/Model/FiltersBulkGetResponse.md +docs/Model/FiltersBulkGetResponseAllOf.md +docs/Model/FiltersDeleteResponse.md +docs/Model/FiltersDeleteResponseAllOf.md +docs/Model/FiltersDeleteResponseAllOfData.md +docs/Model/FiltersGetResponse.md +docs/Model/FiltersGetResponseAllOf.md +docs/Model/FiltersPostResponse.md +docs/Model/FiltersPostResponseAllOf.md +docs/Model/FiltersPostResponseAllOfData.md +docs/Model/FindGoalResponse.md +docs/Model/FollowerData.md +docs/Model/FollowerDataWithID.md +docs/Model/FollowerDataWithIDAllOf.md +docs/Model/FullRole.md +docs/Model/FullRoleAllOf.md +docs/Model/GetActivitiesCollectionResponse200.md +docs/Model/GetActivitiesResponse200.md +docs/Model/GetActivitiesResponse200RelatedObjects.md +docs/Model/GetActivityResponse200.md +docs/Model/GetAddProductAttachementDetails.md +docs/Model/GetAddUpdateStage.md +docs/Model/GetAddedDeal.md +docs/Model/GetAllFiles.md +docs/Model/GetAllPersonsResponse.md +docs/Model/GetAllPersonsResponseAllOf.md +docs/Model/GetAllPipelines.md +docs/Model/GetAllPipelinesAllOf.md +docs/Model/GetAllProductFieldsResponse.md +docs/Model/GetComments.md +docs/Model/GetDeal.md +docs/Model/GetDealAdditionalData.md +docs/Model/GetDeals.md +docs/Model/GetDealsCollection.md +docs/Model/GetDealsConversionRatesInPipeline.md +docs/Model/GetDealsConversionRatesInPipelineAllOf.md +docs/Model/GetDealsConversionRatesInPipelineAllOfData.md +docs/Model/GetDealsMovementsInPipeline.md +docs/Model/GetDealsMovementsInPipelineAllOf.md +docs/Model/GetDealsMovementsInPipelineAllOfData.md +docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.md +docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md +docs/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md +docs/Model/GetDealsRelatedObjects.md +docs/Model/GetDealsSummary.md +docs/Model/GetDealsSummaryData.md +docs/Model/GetDealsSummaryDataValuesTotal.md +docs/Model/GetDealsSummaryDataWeightedValuesTotal.md +docs/Model/GetDealsTimeline.md +docs/Model/GetDealsTimelineData.md +docs/Model/GetDealsTimelineDataTotals.md +docs/Model/GetDuplicatedDeal.md +docs/Model/GetGoalResultResponse200.md +docs/Model/GetGoalsResponse200.md +docs/Model/GetLeadLabelsResponse200.md +docs/Model/GetLeadSourcesResponse200.md +docs/Model/GetLeadSourcesResponse200Data.md +docs/Model/GetLeadsResponse200.md +docs/Model/GetMergedDeal.md +docs/Model/GetNotes.md +docs/Model/GetOneFile.md +docs/Model/GetOnePipeline.md +docs/Model/GetOnePipelineAllOf.md +docs/Model/GetOneStage.md +docs/Model/GetPersonDetailsResponse.md +docs/Model/GetPersonDetailsResponseAllOf.md +docs/Model/GetPersonDetailsResponseAllOfAdditionalData.md +docs/Model/GetProductAttachementDetails.md +docs/Model/GetProductFieldResponse.md +docs/Model/GetRecents.md +docs/Model/GetRecentsAdditionalData.md +docs/Model/GetRole.md +docs/Model/GetRoleAllOf.md +docs/Model/GetRoleAllOfAdditionalData.md +docs/Model/GetRoleAssignments.md +docs/Model/GetRoleAssignmentsAllOf.md +docs/Model/GetRolePipelines.md +docs/Model/GetRolePipelinesAllOf.md +docs/Model/GetRolePipelinesAllOfData.md +docs/Model/GetRoleSettings.md +docs/Model/GetRoleSettingsAllOf.md +docs/Model/GetRoles.md +docs/Model/GetRolesAllOf.md +docs/Model/GetStageDeals.md +docs/Model/GetStages.md +docs/Model/GoalResults.md +docs/Model/GoalType.md +docs/Model/GoalsResponseComponent.md +docs/Model/IconKey.md +docs/Model/InlineResponse200.md +docs/Model/InlineResponse400.md +docs/Model/InlineResponse4001.md +docs/Model/InlineResponse4001AdditionalData.md +docs/Model/InlineResponse400AdditionalData.md +docs/Model/InlineResponse403.md +docs/Model/InlineResponse4031.md +docs/Model/InlineResponse4031AdditionalData.md +docs/Model/InlineResponse403AdditionalData.md +docs/Model/InlineResponse404.md +docs/Model/InlineResponse404AdditionalData.md +docs/Model/ItemSearchAdditionalData.md +docs/Model/ItemSearchAdditionalDataPagination.md +docs/Model/ItemSearchFieldResponse.md +docs/Model/ItemSearchFieldResponseAllOf.md +docs/Model/ItemSearchFieldResponseAllOfData.md +docs/Model/ItemSearchItem.md +docs/Model/ItemSearchResponse.md +docs/Model/ItemSearchResponseAllOf.md +docs/Model/ItemSearchResponseAllOfData.md +docs/Model/LeadIdResponse200.md +docs/Model/LeadIdResponse200Data.md +docs/Model/LeadLabelColor.md +docs/Model/LeadLabelResponse.md +docs/Model/LeadResponse.md +docs/Model/LeadResponse404.md +docs/Model/LeadSearchItem.md +docs/Model/LeadSearchItemItem.md +docs/Model/LeadSearchItemItemOrganization.md +docs/Model/LeadSearchItemItemOwner.md +docs/Model/LeadSearchItemItemPerson.md +docs/Model/LeadSearchResponse.md +docs/Model/LeadSearchResponseAllOf.md +docs/Model/LeadSearchResponseAllOfData.md +docs/Model/LeadValue.md +docs/Model/LinkRemoteFileToItem.md +docs/Model/ListActivitiesResponse.md +docs/Model/ListActivitiesResponseAllOf.md +docs/Model/ListDealsResponse.md +docs/Model/ListDealsResponseAllOf.md +docs/Model/ListDealsResponseAllOfRelatedObjects.md +docs/Model/ListFilesResponse.md +docs/Model/ListFilesResponseAllOf.md +docs/Model/ListFollowersResponse.md +docs/Model/ListFollowersResponseAllOf.md +docs/Model/ListFollowersResponseAllOfData.md +docs/Model/ListMailMessagesResponse.md +docs/Model/ListMailMessagesResponseAllOf.md +docs/Model/ListMailMessagesResponseAllOfData.md +docs/Model/ListPermittedUsersResponse.md +docs/Model/ListPermittedUsersResponse1.md +docs/Model/ListPermittedUsersResponse1AllOf.md +docs/Model/ListPermittedUsersResponseAllOf.md +docs/Model/ListPermittedUsersResponseAllOfData.md +docs/Model/ListPersonProductsResponse.md +docs/Model/ListPersonProductsResponseAllOf.md +docs/Model/ListPersonProductsResponseAllOfDEALID.md +docs/Model/ListPersonProductsResponseAllOfData.md +docs/Model/ListPersonsResponse.md +docs/Model/ListPersonsResponseAllOf.md +docs/Model/ListPersonsResponseAllOfRelatedObjects.md +docs/Model/ListProductAdditionalData.md +docs/Model/ListProductAdditionalDataAllOf.md +docs/Model/ListProductFilesResponse.md +docs/Model/ListProductFilesResponseAllOf.md +docs/Model/ListProductFollowersResponse.md +docs/Model/ListProductFollowersResponseAllOf.md +docs/Model/ListProductFollowersResponseAllOfData.md +docs/Model/ListProductsResponse.md +docs/Model/ListProductsResponseAllOf.md +docs/Model/ListProductsResponseAllOfData.md +docs/Model/ListProductsResponseAllOfRelatedObjects.md +docs/Model/MailMessage.md +docs/Model/MailMessageAllOf.md +docs/Model/MailMessageData.md +docs/Model/MailMessageItemForList.md +docs/Model/MailMessageItemForListAllOf.md +docs/Model/MailParticipant.md +docs/Model/MailServiceBaseResponse.md +docs/Model/MailThread.md +docs/Model/MailThreadAllOf.md +docs/Model/MailThreadDelete.md +docs/Model/MailThreadDeleteAllOf.md +docs/Model/MailThreadDeleteAllOfData.md +docs/Model/MailThreadMessages.md +docs/Model/MailThreadMessagesAllOf.md +docs/Model/MailThreadOne.md +docs/Model/MailThreadOneAllOf.md +docs/Model/MailThreadParticipant.md +docs/Model/MailThreadPut.md +docs/Model/MailThreadPutAllOf.md +docs/Model/MarketingStatus.md +docs/Model/MergeDealsRequest.md +docs/Model/MergeOrganizationsRequest.md +docs/Model/MergePersonDealRelatedInfo.md +docs/Model/MergePersonItem.md +docs/Model/MergePersonsRequest.md +docs/Model/MergePersonsResponse.md +docs/Model/MergePersonsResponseAllOf.md +docs/Model/MessageObject.md +docs/Model/MessageObjectAttachments.md +docs/Model/NewDeal.md +docs/Model/NewDealAllOf.md +docs/Model/NewDealProduct.md +docs/Model/NewFollowerResponse.md +docs/Model/NewFollowerResponseData.md +docs/Model/NewGoal.md +docs/Model/NewOrganization.md +docs/Model/NewOrganizationAllOf.md +docs/Model/NewPerson.md +docs/Model/NewPersonAllOf.md +docs/Model/NewProductField.md +docs/Model/Note.md +docs/Model/NoteAllOf.md +docs/Model/NoteConnectToParams.md +docs/Model/NoteCreatorUser.md +docs/Model/NoteField.md +docs/Model/NoteFieldOptions.md +docs/Model/NoteFieldsResponse.md +docs/Model/NoteFieldsResponseAllOf.md +docs/Model/NoteParams.md +docs/Model/NumberBoolean.md +docs/Model/NumberBooleanDefault0.md +docs/Model/NumberBooleanDefault1.md +docs/Model/ObjectPrices.md +docs/Model/OneLeadResponse200.md +docs/Model/OptionalNameObject.md +docs/Model/OrgAndOwnerId.md +docs/Model/OrganizationAddressInfo.md +docs/Model/OrganizationCountAndAddressInfo.md +docs/Model/OrganizationCountInfo.md +docs/Model/OrganizationData.md +docs/Model/OrganizationDataWithId.md +docs/Model/OrganizationDataWithIdAllOf.md +docs/Model/OrganizationDataWithIdAndActiveFlag.md +docs/Model/OrganizationDataWithIdAndActiveFlagAllOf.md +docs/Model/OrganizationDeleteResponse.md +docs/Model/OrganizationDeleteResponseData.md +docs/Model/OrganizationDetailsGetResponse.md +docs/Model/OrganizationDetailsGetResponseAllOf.md +docs/Model/OrganizationDetailsGetResponseAllOfAdditionalData.md +docs/Model/OrganizationFlowResponse.md +docs/Model/OrganizationFlowResponseAllOf.md +docs/Model/OrganizationFlowResponseAllOfData.md +docs/Model/OrganizationFlowResponseAllOfRelatedObjects.md +docs/Model/OrganizationFollowerDeleteResponse.md +docs/Model/OrganizationFollowerDeleteResponseData.md +docs/Model/OrganizationFollowerItem.md +docs/Model/OrganizationFollowerItemAllOf.md +docs/Model/OrganizationFollowerPostResponse.md +docs/Model/OrganizationFollowersListResponse.md +docs/Model/OrganizationItem.md +docs/Model/OrganizationItemAllOf.md +docs/Model/OrganizationPostResponse.md +docs/Model/OrganizationPostResponseAllOf.md +docs/Model/OrganizationRelationship.md +docs/Model/OrganizationRelationshipDeleteResponse.md +docs/Model/OrganizationRelationshipDeleteResponseAllOf.md +docs/Model/OrganizationRelationshipDeleteResponseAllOfData.md +docs/Model/OrganizationRelationshipDetails.md +docs/Model/OrganizationRelationshipGetResponse.md +docs/Model/OrganizationRelationshipGetResponseAllOf.md +docs/Model/OrganizationRelationshipPostResponse.md +docs/Model/OrganizationRelationshipPostResponseAllOf.md +docs/Model/OrganizationRelationshipUpdateResponse.md +docs/Model/OrganizationRelationshipWithCalculatedFields.md +docs/Model/OrganizationSearchItem.md +docs/Model/OrganizationSearchItemItem.md +docs/Model/OrganizationSearchResponse.md +docs/Model/OrganizationSearchResponseAllOf.md +docs/Model/OrganizationSearchResponseAllOfData.md +docs/Model/OrganizationUpdateResponse.md +docs/Model/OrganizationUpdateResponseAllOf.md +docs/Model/OrganizationsDeleteResponse.md +docs/Model/OrganizationsDeleteResponseData.md +docs/Model/OrganizationsMergeResponse.md +docs/Model/OrganizationsMergeResponseData.md +docs/Model/Owner.md +docs/Model/OwnerAllOf.md +docs/Model/PaginationDetails.md +docs/Model/PaginationDetailsAllOf.md +docs/Model/Params.md +docs/Model/PaymentItem.md +docs/Model/PaymentsResponse.md +docs/Model/PaymentsResponseAllOf.md +docs/Model/PermissionSets.md +docs/Model/PermissionSetsAllOf.md +docs/Model/PermissionSetsItem.md +docs/Model/PersonCountAndEmailInfo.md +docs/Model/PersonCountEmailDealAndActivityInfo.md +docs/Model/PersonCountInfo.md +docs/Model/PersonData.md +docs/Model/PersonDataEmail.md +docs/Model/PersonDataPhone.md +docs/Model/PersonDataWithActiveFlag.md +docs/Model/PersonDataWithActiveFlagAllOf.md +docs/Model/PersonFlowResponse.md +docs/Model/PersonFlowResponseAllOf.md +docs/Model/PersonFlowResponseAllOfData.md +docs/Model/PersonItem.md +docs/Model/PersonListProduct.md +docs/Model/PersonNameCountAndEmailInfo.md +docs/Model/PersonNameCountAndEmailInfoWithIds.md +docs/Model/PersonNameCountAndEmailInfoWithIdsAllOf.md +docs/Model/PersonNameInfo.md +docs/Model/PersonNameInfoWithOrgAndOwnerId.md +docs/Model/PersonSearchItem.md +docs/Model/PersonSearchItemItem.md +docs/Model/PersonSearchItemItemOrganization.md +docs/Model/PersonSearchItemItemOwner.md +docs/Model/PersonSearchResponse.md +docs/Model/PersonSearchResponseAllOf.md +docs/Model/PersonSearchResponseAllOfData.md +docs/Model/PictureData.md +docs/Model/PictureDataPictures.md +docs/Model/PictureDataWithID.md +docs/Model/PictureDataWithIDAllOf.md +docs/Model/PictureDataWithValue.md +docs/Model/PictureDataWithValueAllOf.md +docs/Model/Pipeline.md +docs/Model/PipelineDetails.md +docs/Model/PipelineDetailsAllOf.md +docs/Model/PostComment.md +docs/Model/PostDealParticipants.md +docs/Model/PostGoalResponse.md +docs/Model/PostNote.md +docs/Model/PostRoleAssignment.md +docs/Model/PostRoleAssignmentAllOf.md +docs/Model/PostRoleAssignmentAllOfData.md +docs/Model/PostRoleSettings.md +docs/Model/PostRoleSettingsAllOf.md +docs/Model/PostRoleSettingsAllOfData.md +docs/Model/PostRoles.md +docs/Model/PostRolesAllOf.md +docs/Model/PostRolesAllOfData.md +docs/Model/ProductAttachementFields.md +docs/Model/ProductAttachmentDetails.md +docs/Model/ProductBaseDeal.md +docs/Model/ProductField.md +docs/Model/ProductFieldAllOf.md +docs/Model/ProductFileItem.md +docs/Model/ProductListItem.md +docs/Model/ProductRequest.md +docs/Model/ProductResponse.md +docs/Model/ProductSearchItem.md +docs/Model/ProductSearchItemItem.md +docs/Model/ProductSearchItemItemOwner.md +docs/Model/ProductSearchResponse.md +docs/Model/ProductSearchResponseAllOf.md +docs/Model/ProductSearchResponseAllOfData.md +docs/Model/ProductWithArrayPrices.md +docs/Model/ProductWithObjectPrices.md +docs/Model/ProductsResponse.md +docs/Model/PutRole.md +docs/Model/PutRoleAllOf.md +docs/Model/PutRoleAllOfData.md +docs/Model/PutRolePipelinesBody.md +docs/Model/RecentDataProduct.md +docs/Model/RecentsActivity.md +docs/Model/RecentsActivityType.md +docs/Model/RecentsDeal.md +docs/Model/RecentsFile.md +docs/Model/RecentsFilter.md +docs/Model/RecentsNote.md +docs/Model/RecentsOrganization.md +docs/Model/RecentsPerson.md +docs/Model/RecentsPipeline.md +docs/Model/RecentsProduct.md +docs/Model/RecentsStage.md +docs/Model/RecentsUser.md +docs/Model/RelatedDealData.md +docs/Model/RelatedDealDataDEALID.md +docs/Model/RelatedFollowerData.md +docs/Model/RelatedOrganizationData.md +docs/Model/RelatedOrganizationDataWithActiveFlag.md +docs/Model/RelatedOrganizationName.md +docs/Model/RelatedPersonData.md +docs/Model/RelatedPersonDataWithActiveFlag.md +docs/Model/RelatedPictureData.md +docs/Model/RelatedUserData.md +docs/Model/RelationshipOrganizationInfoItem.md +docs/Model/RelationshipOrganizationInfoItemAllOf.md +docs/Model/RelationshipOrganizationInfoItemWithActiveFlag.md +docs/Model/RequiredNameObject.md +docs/Model/RequredTitleParameter.md +docs/Model/ResponseCallLogObject.md +docs/Model/ResponseCallLogObjectAllOf.md +docs/Model/RoleAssignment.md +docs/Model/RoleAssignmentAllOf.md +docs/Model/RoleSettings.md +docs/Model/RolesAdditionalData.md +docs/Model/RolesAdditionalDataPagination.md +docs/Model/SinglePermissionSetsItem.md +docs/Model/SinglePermissionSetsItemAllOf.md +docs/Model/Stage.md +docs/Model/StageConversions.md +docs/Model/StageDetails.md +docs/Model/StageWithPipelineInfo.md +docs/Model/StageWithPipelineInfoAllOf.md +docs/Model/SubRole.md +docs/Model/SubRoleAllOf.md +docs/Model/SubscriptionAddonsResponse.md +docs/Model/SubscriptionAddonsResponseAllOf.md +docs/Model/SubscriptionInstallmentCreateRequest.md +docs/Model/SubscriptionInstallmentUpdateRequest.md +docs/Model/SubscriptionItem.md +docs/Model/SubscriptionRecurringCancelRequest.md +docs/Model/SubscriptionRecurringCreateRequest.md +docs/Model/SubscriptionRecurringUpdateRequest.md +docs/Model/SubscriptionsIdResponse.md +docs/Model/SubscriptionsIdResponseAllOf.md +docs/Model/Team.md +docs/Model/TeamAllOf.md +docs/Model/TeamId.md +docs/Model/Teams.md +docs/Model/TeamsAllOf.md +docs/Model/Unauthorized.md +docs/Model/UpdateActivityResponse200.md +docs/Model/UpdateDealProduct.md +docs/Model/UpdateDealRequest.md +docs/Model/UpdateFile.md +docs/Model/UpdateFilterRequest.md +docs/Model/UpdateLeadLabelRequest.md +docs/Model/UpdateLeadRequest.md +docs/Model/UpdateOrganization.md +docs/Model/UpdateOrganizationAllOf.md +docs/Model/UpdatePerson.md +docs/Model/UpdatePersonAllOf.md +docs/Model/UpdatePersonResponse.md +docs/Model/UpdateProductField.md +docs/Model/UpdateProductRequestBody.md +docs/Model/UpdateProductResponse.md +docs/Model/UpdateStageRequest.md +docs/Model/UpdateStageRequestAllOf.md +docs/Model/UpdateTeam.md +docs/Model/UpdateTeamAllOf.md +docs/Model/UpdateTeamWithAdditionalProperties.md +docs/Model/UpdateUserRequest.md +docs/Model/User.md +docs/Model/UserAccess.md +docs/Model/UserAllOf.md +docs/Model/UserAssignmentToPermissionSet.md +docs/Model/UserAssignmentsToPermissionSet.md +docs/Model/UserAssignmentsToPermissionSetAllOf.md +docs/Model/UserConnections.md +docs/Model/UserConnectionsAllOf.md +docs/Model/UserConnectionsAllOfData.md +docs/Model/UserData.md +docs/Model/UserDataWithId.md +docs/Model/UserIDs.md +docs/Model/UserIDsAllOf.md +docs/Model/UserMe.md +docs/Model/UserMeAllOf.md +docs/Model/UserPermissions.md +docs/Model/UserPermissionsAllOf.md +docs/Model/UserPermissionsItem.md +docs/Model/UserSettings.md +docs/Model/UserSettingsAllOf.md +docs/Model/UserSettingsItem.md +docs/Model/Users.md +docs/Model/UsersAllOf.md +docs/Model/VisibleTo.md +docs/Model/Webhook.md +docs/Model/WebhookAllOf.md +docs/Model/WebhookBadRequest.md +docs/Model/WebhookBadRequestAllOf.md +docs/Model/Webhooks.md +docs/Model/WebhooksAllOf.md +docs/Model/WebhooksDeleteForbiddenSchema.md +docs/Model/WebhooksDeleteForbiddenSchemaAllOf.md +git_push.sh +lib/Api/ActivitiesApi.php +lib/Api/ActivityFieldsApi.php +lib/Api/ActivityTypesApi.php +lib/Api/BillingApi.php +lib/Api/CallLogsApi.php +lib/Api/ChannelsApi.php +lib/Api/CurrenciesApi.php +lib/Api/DealFieldsApi.php +lib/Api/DealsApi.php +lib/Api/FilesApi.php +lib/Api/FiltersApi.php +lib/Api/GoalsApi.php +lib/Api/ItemSearchApi.php +lib/Api/LeadLabelsApi.php +lib/Api/LeadSourcesApi.php +lib/Api/LeadsApi.php +lib/Api/LegacyTeamsApi.php +lib/Api/MailboxApi.php +lib/Api/NoteFieldsApi.php +lib/Api/NotesApi.php +lib/Api/OrganizationFieldsApi.php +lib/Api/OrganizationRelationshipsApi.php +lib/Api/OrganizationsApi.php +lib/Api/PermissionSetsApi.php +lib/Api/PersonFieldsApi.php +lib/Api/PersonsApi.php +lib/Api/PipelinesApi.php +lib/Api/ProductFieldsApi.php +lib/Api/ProductsApi.php +lib/Api/RecentsApi.php +lib/Api/RolesApi.php +lib/Api/StagesApi.php +lib/Api/SubscriptionsApi.php +lib/Api/UserConnectionsApi.php +lib/Api/UserSettingsApi.php +lib/Api/UsersApi.php +lib/Api/WebhooksApi.php +lib/ApiException.php +lib/Configuration.php +lib/Exceptions/OAuthProviderException.php +lib/HeaderSelector.php +lib/Model/ActivityCollectionResponseObject.php +lib/Model/ActivityCollectionResponseObjectAllOf.php +lib/Model/ActivityDistributionData.php +lib/Model/ActivityDistributionDataActivityDistribution.php +lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.php +lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.php +lib/Model/ActivityDistributionDataWithAdditionalData.php +lib/Model/ActivityInfo.php +lib/Model/ActivityObjectFragment.php +lib/Model/ActivityPostObject.php +lib/Model/ActivityPostObjectAllOf.php +lib/Model/ActivityPutObject.php +lib/Model/ActivityPutObjectAllOf.php +lib/Model/ActivityRecordAdditionalData.php +lib/Model/ActivityResponseObject.php +lib/Model/ActivityResponseObjectAllOf.php +lib/Model/ActivityTypeBulkDeleteResponse.php +lib/Model/ActivityTypeBulkDeleteResponseAllOf.php +lib/Model/ActivityTypeBulkDeleteResponseAllOfData.php +lib/Model/ActivityTypeCreateRequest.php +lib/Model/ActivityTypeCreateUpdateDeleteResponse.php +lib/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.php +lib/Model/ActivityTypeListResponse.php +lib/Model/ActivityTypeListResponseAllOf.php +lib/Model/ActivityTypeObjectResponse.php +lib/Model/ActivityTypeUpdateRequest.php +lib/Model/AddActivityResponse200.php +lib/Model/AddActivityResponse200RelatedObjects.php +lib/Model/AddDealFollowerRequest.php +lib/Model/AddDealParticipantRequest.php +lib/Model/AddFile.php +lib/Model/AddFilterRequest.php +lib/Model/AddFollowerToPersonResponse.php +lib/Model/AddFollowerToPersonResponseAllOf.php +lib/Model/AddFollowerToPersonResponseAllOfData.php +lib/Model/AddLeadLabelRequest.php +lib/Model/AddLeadRequest.php +lib/Model/AddNewPipeline.php +lib/Model/AddNewPipelineAllOf.php +lib/Model/AddNoteRequest.php +lib/Model/AddNoteRequestAllOf.php +lib/Model/AddOrUpdateGoalResponse200.php +lib/Model/AddOrUpdateLeadLabelResponse200.php +lib/Model/AddOrUpdateRoleSettingRequest.php +lib/Model/AddOrganizationFollowerRequest.php +lib/Model/AddOrganizationRelationshipRequest.php +lib/Model/AddPersonFollowerRequest.php +lib/Model/AddPersonPictureResponse.php +lib/Model/AddPersonPictureResponseAllOf.php +lib/Model/AddPersonResponse.php +lib/Model/AddPersonResponseAllOf.php +lib/Model/AddProductAttachmentDetails.php +lib/Model/AddProductAttachmentDetailsAllOf.php +lib/Model/AddProductFollowerRequest.php +lib/Model/AddProductRequestBody.php +lib/Model/AddRole.php +lib/Model/AddRoleAssignmentRequest.php +lib/Model/AddTeamUserRequest.php +lib/Model/AddUserRequest.php +lib/Model/AddWebhookRequest.php +lib/Model/AddedDealFollower.php +lib/Model/AddedDealFollowerData.php +lib/Model/AdditionalBaseOrganizationItemInfo.php +lib/Model/AdditionalData.php +lib/Model/AdditionalDataWithCursorPagination.php +lib/Model/AdditionalDataWithOffsetPagination.php +lib/Model/AdditionalDataWithPaginationDetails.php +lib/Model/AdditionalMergePersonInfo.php +lib/Model/AdditionalPersonInfo.php +lib/Model/AllOrganizationRelationshipsGetResponse.php +lib/Model/AllOrganizationRelationshipsGetResponseAllOf.php +lib/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.php +lib/Model/AllOrganizationsGetResponse.php +lib/Model/AllOrganizationsGetResponseAllOf.php +lib/Model/AllOrganizationsGetResponseAllOfRelatedObjects.php +lib/Model/AnyOfRecents.php +lib/Model/ArrayPrices.php +lib/Model/Assignee.php +lib/Model/BaseComment.php +lib/Model/BaseCurrency.php +lib/Model/BaseDeal.php +lib/Model/BaseFollowerItem.php +lib/Model/BaseMailThread.php +lib/Model/BaseMailThreadAllOf.php +lib/Model/BaseMailThreadAllOfParties.php +lib/Model/BaseMailThreadMessages.php +lib/Model/BaseMailThreadMessagesAllOf.php +lib/Model/BaseNote.php +lib/Model/BaseNoteDealTitle.php +lib/Model/BaseNoteOrganization.php +lib/Model/BaseNotePerson.php +lib/Model/BaseOrganizationItem.php +lib/Model/BaseOrganizationItemFields.php +lib/Model/BaseOrganizationItemWithEditNameFlag.php +lib/Model/BaseOrganizationItemWithEditNameFlagAllOf.php +lib/Model/BaseOrganizationRelationshipItem.php +lib/Model/BasePersonItem.php +lib/Model/BasePersonItemEmail.php +lib/Model/BasePersonItemPhone.php +lib/Model/BasePipeline.php +lib/Model/BasePipelineWithSelectedFlag.php +lib/Model/BasePipelineWithSelectedFlagAllOf.php +lib/Model/BaseProduct.php +lib/Model/BaseResponse.php +lib/Model/BaseResponseWithStatus.php +lib/Model/BaseResponseWithStatusAllOf.php +lib/Model/BaseRole.php +lib/Model/BaseStage.php +lib/Model/BaseTeam.php +lib/Model/BaseTeamAdditionalProperties.php +lib/Model/BaseUser.php +lib/Model/BaseUserMe.php +lib/Model/BaseUserMeAllOf.php +lib/Model/BaseUserMeAllOfLanguage.php +lib/Model/BaseWebhook.php +lib/Model/BasicDeal.php +lib/Model/BasicDealProduct.php +lib/Model/BasicGoal.php +lib/Model/BasicOrganization.php +lib/Model/BasicPerson.php +lib/Model/BasicPersonEmail.php +lib/Model/BulkDeleteResponse.php +lib/Model/BulkDeleteResponseAllOf.php +lib/Model/BulkDeleteResponseAllOfData.php +lib/Model/CalculatedFields.php +lib/Model/CallLogObject.php +lib/Model/CallLogResponse200.php +lib/Model/CallLogResponse400.php +lib/Model/CallLogResponse403.php +lib/Model/CallLogResponse404.php +lib/Model/CallLogResponse409.php +lib/Model/CallLogResponse410.php +lib/Model/CallLogResponse500.php +lib/Model/CallLogsResponse.php +lib/Model/CallLogsResponseAdditionalData.php +lib/Model/ChannelObject.php +lib/Model/ChannelObjectResponse.php +lib/Model/ChannelObjectResponseData.php +lib/Model/CommentPostPutObject.php +lib/Model/CommonMailThread.php +lib/Model/CreateRemoteFileAndLinkItToItem.php +lib/Model/CreateTeam.php +lib/Model/Currencies.php +lib/Model/DealCollectionResponseObject.php +lib/Model/DealCountAndActivityInfo.php +lib/Model/DealFlowResponse.php +lib/Model/DealFlowResponseAllOf.php +lib/Model/DealFlowResponseAllOfData.php +lib/Model/DealFlowResponseAllOfRelatedObjects.php +lib/Model/DealListActivitiesResponse.php +lib/Model/DealListActivitiesResponseAllOf.php +lib/Model/DealListActivitiesResponseAllOfRelatedObjects.php +lib/Model/DealNonStrict.php +lib/Model/DealNonStrictModeFields.php +lib/Model/DealNonStrictModeFieldsCreatorUserId.php +lib/Model/DealNonStrictWithDetails.php +lib/Model/DealNonStrictWithDetailsAllOf.php +lib/Model/DealNonStrictWithDetailsAllOfAge.php +lib/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.php +lib/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.php +lib/Model/DealOrganizationData.php +lib/Model/DealOrganizationDataWithId.php +lib/Model/DealOrganizationDataWithIdAllOf.php +lib/Model/DealParticipantCountInfo.php +lib/Model/DealParticipants.php +lib/Model/DealPersonData.php +lib/Model/DealPersonDataEmail.php +lib/Model/DealPersonDataPhone.php +lib/Model/DealPersonDataWithId.php +lib/Model/DealPersonDataWithIdAllOf.php +lib/Model/DealProductUnitDuration.php +lib/Model/DealSearchItem.php +lib/Model/DealSearchItemItem.php +lib/Model/DealSearchItemItemOrganization.php +lib/Model/DealSearchItemItemOwner.php +lib/Model/DealSearchItemItemPerson.php +lib/Model/DealSearchItemItemStage.php +lib/Model/DealSearchResponse.php +lib/Model/DealSearchResponseAllOf.php +lib/Model/DealSearchResponseAllOfData.php +lib/Model/DealStrict.php +lib/Model/DealStrictModeFields.php +lib/Model/DealStrictWithMergeId.php +lib/Model/DealStrictWithMergeIdAllOf.php +lib/Model/DealSummary.php +lib/Model/DealSummaryPerCurrency.php +lib/Model/DealSummaryPerCurrencyFull.php +lib/Model/DealSummaryPerCurrencyFullCURRENCYID.php +lib/Model/DealSummaryPerStages.php +lib/Model/DealSummaryPerStagesSTAGEID.php +lib/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.php +lib/Model/DealTitleParameter.php +lib/Model/DealUserData.php +lib/Model/DealUserDataWithId.php +lib/Model/DealUserDataWithIdAllOf.php +lib/Model/DealsCountAndActivityInfo.php +lib/Model/DealsCountInfo.php +lib/Model/DealsMovementsInfo.php +lib/Model/DealsMovementsInfoFormattedValues.php +lib/Model/DealsMovementsInfoValues.php +lib/Model/DeleteActivitiesResponse200.php +lib/Model/DeleteActivitiesResponse200Data.php +lib/Model/DeleteActivityResponse200.php +lib/Model/DeleteActivityResponse200Data.php +lib/Model/DeleteChannelSuccess.php +lib/Model/DeleteComment.php +lib/Model/DeleteConversationSuccess.php +lib/Model/DeleteDeal.php +lib/Model/DeleteDealData.php +lib/Model/DeleteDealFollower.php +lib/Model/DeleteDealFollowerData.php +lib/Model/DeleteDealParticipant.php +lib/Model/DeleteDealParticipantData.php +lib/Model/DeleteDealProduct.php +lib/Model/DeleteDealProductData.php +lib/Model/DeleteFile.php +lib/Model/DeleteFileData.php +lib/Model/DeleteGoalResponse200.php +lib/Model/DeleteMultipleDeals.php +lib/Model/DeleteMultipleDealsData.php +lib/Model/DeleteMultipleProductFieldsResponse.php +lib/Model/DeleteMultipleProductFieldsResponseData.php +lib/Model/DeleteNote.php +lib/Model/DeletePersonResponse.php +lib/Model/DeletePersonResponseAllOf.php +lib/Model/DeletePersonResponseAllOfData.php +lib/Model/DeletePersonsInBulkResponse.php +lib/Model/DeletePersonsInBulkResponseAllOf.php +lib/Model/DeletePersonsInBulkResponseAllOfData.php +lib/Model/DeletePipelineResponse200.php +lib/Model/DeletePipelineResponse200Data.php +lib/Model/DeleteProductFieldResponse.php +lib/Model/DeleteProductFieldResponseData.php +lib/Model/DeleteProductFollowerResponse.php +lib/Model/DeleteProductFollowerResponseData.php +lib/Model/DeleteProductResponse.php +lib/Model/DeleteProductResponseData.php +lib/Model/DeleteResponse.php +lib/Model/DeleteResponseAllOf.php +lib/Model/DeleteResponseAllOfData.php +lib/Model/DeleteRole.php +lib/Model/DeleteRoleAllOf.php +lib/Model/DeleteRoleAllOfData.php +lib/Model/DeleteRoleAssignment.php +lib/Model/DeleteRoleAssignmentAllOf.php +lib/Model/DeleteRoleAssignmentAllOfData.php +lib/Model/DeleteRoleAssignmentRequest.php +lib/Model/DeleteStageResponse200.php +lib/Model/DeleteStageResponse200Data.php +lib/Model/DeleteStagesResponse200.php +lib/Model/DeleteStagesResponse200Data.php +lib/Model/DeleteTeamUserRequest.php +lib/Model/Duration.php +lib/Model/EditPipeline.php +lib/Model/EditPipelineAllOf.php +lib/Model/EmailInfo.php +lib/Model/ExpectedOutcome.php +lib/Model/FailResponse.php +lib/Model/Field.php +lib/Model/FieldCreateRequest.php +lib/Model/FieldCreateRequestAllOf.php +lib/Model/FieldResponse.php +lib/Model/FieldResponseAllOf.php +lib/Model/FieldType.php +lib/Model/FieldTypeAsString.php +lib/Model/FieldUpdateRequest.php +lib/Model/FieldsResponse.php +lib/Model/FieldsResponseAllOf.php +lib/Model/FileData.php +lib/Model/FileItem.php +lib/Model/FilterGetItem.php +lib/Model/FilterType.php +lib/Model/FiltersBulkDeleteResponse.php +lib/Model/FiltersBulkDeleteResponseAllOf.php +lib/Model/FiltersBulkDeleteResponseAllOfData.php +lib/Model/FiltersBulkGetResponse.php +lib/Model/FiltersBulkGetResponseAllOf.php +lib/Model/FiltersDeleteResponse.php +lib/Model/FiltersDeleteResponseAllOf.php +lib/Model/FiltersDeleteResponseAllOfData.php +lib/Model/FiltersGetResponse.php +lib/Model/FiltersGetResponseAllOf.php +lib/Model/FiltersPostResponse.php +lib/Model/FiltersPostResponseAllOf.php +lib/Model/FiltersPostResponseAllOfData.php +lib/Model/FindGoalResponse.php +lib/Model/FollowerData.php +lib/Model/FollowerDataWithID.php +lib/Model/FollowerDataWithIDAllOf.php +lib/Model/FullRole.php +lib/Model/FullRoleAllOf.php +lib/Model/GetActivitiesCollectionResponse200.php +lib/Model/GetActivitiesResponse200.php +lib/Model/GetActivitiesResponse200RelatedObjects.php +lib/Model/GetActivityResponse200.php +lib/Model/GetAddProductAttachementDetails.php +lib/Model/GetAddUpdateStage.php +lib/Model/GetAddedDeal.php +lib/Model/GetAllFiles.php +lib/Model/GetAllPersonsResponse.php +lib/Model/GetAllPersonsResponseAllOf.php +lib/Model/GetAllPipelines.php +lib/Model/GetAllPipelinesAllOf.php +lib/Model/GetAllProductFieldsResponse.php +lib/Model/GetComments.php +lib/Model/GetDeal.php +lib/Model/GetDealAdditionalData.php +lib/Model/GetDeals.php +lib/Model/GetDealsCollection.php +lib/Model/GetDealsConversionRatesInPipeline.php +lib/Model/GetDealsConversionRatesInPipelineAllOf.php +lib/Model/GetDealsConversionRatesInPipelineAllOfData.php +lib/Model/GetDealsMovementsInPipeline.php +lib/Model/GetDealsMovementsInPipelineAllOf.php +lib/Model/GetDealsMovementsInPipelineAllOfData.php +lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.php +lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.php +lib/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.php +lib/Model/GetDealsRelatedObjects.php +lib/Model/GetDealsSummary.php +lib/Model/GetDealsSummaryData.php +lib/Model/GetDealsSummaryDataValuesTotal.php +lib/Model/GetDealsSummaryDataWeightedValuesTotal.php +lib/Model/GetDealsTimeline.php +lib/Model/GetDealsTimelineData.php +lib/Model/GetDealsTimelineDataTotals.php +lib/Model/GetDuplicatedDeal.php +lib/Model/GetGoalResultResponse200.php +lib/Model/GetGoalsResponse200.php +lib/Model/GetLeadLabelsResponse200.php +lib/Model/GetLeadSourcesResponse200.php +lib/Model/GetLeadSourcesResponse200Data.php +lib/Model/GetLeadsResponse200.php +lib/Model/GetMergedDeal.php +lib/Model/GetNotes.php +lib/Model/GetOneFile.php +lib/Model/GetOnePipeline.php +lib/Model/GetOnePipelineAllOf.php +lib/Model/GetOneStage.php +lib/Model/GetPersonDetailsResponse.php +lib/Model/GetPersonDetailsResponseAllOf.php +lib/Model/GetPersonDetailsResponseAllOfAdditionalData.php +lib/Model/GetProductAttachementDetails.php +lib/Model/GetProductFieldResponse.php +lib/Model/GetRecents.php +lib/Model/GetRecentsAdditionalData.php +lib/Model/GetRole.php +lib/Model/GetRoleAllOf.php +lib/Model/GetRoleAllOfAdditionalData.php +lib/Model/GetRoleAssignments.php +lib/Model/GetRoleAssignmentsAllOf.php +lib/Model/GetRolePipelines.php +lib/Model/GetRolePipelinesAllOf.php +lib/Model/GetRolePipelinesAllOfData.php +lib/Model/GetRoleSettings.php +lib/Model/GetRoleSettingsAllOf.php +lib/Model/GetRoles.php +lib/Model/GetRolesAllOf.php +lib/Model/GetStageDeals.php +lib/Model/GetStages.php +lib/Model/GoalResults.php +lib/Model/GoalType.php +lib/Model/GoalsResponseComponent.php +lib/Model/IconKey.php +lib/Model/InlineResponse200.php +lib/Model/InlineResponse400.php +lib/Model/InlineResponse4001.php +lib/Model/InlineResponse4001AdditionalData.php +lib/Model/InlineResponse400AdditionalData.php +lib/Model/InlineResponse403.php +lib/Model/InlineResponse4031.php +lib/Model/InlineResponse4031AdditionalData.php +lib/Model/InlineResponse403AdditionalData.php +lib/Model/InlineResponse404.php +lib/Model/InlineResponse404AdditionalData.php +lib/Model/ItemSearchAdditionalData.php +lib/Model/ItemSearchAdditionalDataPagination.php +lib/Model/ItemSearchFieldResponse.php +lib/Model/ItemSearchFieldResponseAllOf.php +lib/Model/ItemSearchFieldResponseAllOfData.php +lib/Model/ItemSearchItem.php +lib/Model/ItemSearchResponse.php +lib/Model/ItemSearchResponseAllOf.php +lib/Model/ItemSearchResponseAllOfData.php +lib/Model/LeadIdResponse200.php +lib/Model/LeadIdResponse200Data.php +lib/Model/LeadLabelColor.php +lib/Model/LeadLabelResponse.php +lib/Model/LeadResponse.php +lib/Model/LeadResponse404.php +lib/Model/LeadSearchItem.php +lib/Model/LeadSearchItemItem.php +lib/Model/LeadSearchItemItemOrganization.php +lib/Model/LeadSearchItemItemOwner.php +lib/Model/LeadSearchItemItemPerson.php +lib/Model/LeadSearchResponse.php +lib/Model/LeadSearchResponseAllOf.php +lib/Model/LeadSearchResponseAllOfData.php +lib/Model/LeadValue.php +lib/Model/LinkRemoteFileToItem.php +lib/Model/ListActivitiesResponse.php +lib/Model/ListActivitiesResponseAllOf.php +lib/Model/ListDealsResponse.php +lib/Model/ListDealsResponseAllOf.php +lib/Model/ListDealsResponseAllOfRelatedObjects.php +lib/Model/ListFilesResponse.php +lib/Model/ListFilesResponseAllOf.php +lib/Model/ListFollowersResponse.php +lib/Model/ListFollowersResponseAllOf.php +lib/Model/ListFollowersResponseAllOfData.php +lib/Model/ListMailMessagesResponse.php +lib/Model/ListMailMessagesResponseAllOf.php +lib/Model/ListMailMessagesResponseAllOfData.php +lib/Model/ListPermittedUsersResponse.php +lib/Model/ListPermittedUsersResponse1.php +lib/Model/ListPermittedUsersResponse1AllOf.php +lib/Model/ListPermittedUsersResponseAllOf.php +lib/Model/ListPermittedUsersResponseAllOfData.php +lib/Model/ListPersonProductsResponse.php +lib/Model/ListPersonProductsResponseAllOf.php +lib/Model/ListPersonProductsResponseAllOfDEALID.php +lib/Model/ListPersonProductsResponseAllOfData.php +lib/Model/ListPersonsResponse.php +lib/Model/ListPersonsResponseAllOf.php +lib/Model/ListPersonsResponseAllOfRelatedObjects.php +lib/Model/ListProductAdditionalData.php +lib/Model/ListProductAdditionalDataAllOf.php +lib/Model/ListProductFilesResponse.php +lib/Model/ListProductFilesResponseAllOf.php +lib/Model/ListProductFollowersResponse.php +lib/Model/ListProductFollowersResponseAllOf.php +lib/Model/ListProductFollowersResponseAllOfData.php +lib/Model/ListProductsResponse.php +lib/Model/ListProductsResponseAllOf.php +lib/Model/ListProductsResponseAllOfData.php +lib/Model/ListProductsResponseAllOfRelatedObjects.php +lib/Model/MailMessage.php +lib/Model/MailMessageAllOf.php +lib/Model/MailMessageData.php +lib/Model/MailMessageItemForList.php +lib/Model/MailMessageItemForListAllOf.php +lib/Model/MailParticipant.php +lib/Model/MailServiceBaseResponse.php +lib/Model/MailThread.php +lib/Model/MailThreadAllOf.php +lib/Model/MailThreadDelete.php +lib/Model/MailThreadDeleteAllOf.php +lib/Model/MailThreadDeleteAllOfData.php +lib/Model/MailThreadMessages.php +lib/Model/MailThreadMessagesAllOf.php +lib/Model/MailThreadOne.php +lib/Model/MailThreadOneAllOf.php +lib/Model/MailThreadParticipant.php +lib/Model/MailThreadPut.php +lib/Model/MailThreadPutAllOf.php +lib/Model/MarketingStatus.php +lib/Model/MergeDealsRequest.php +lib/Model/MergeOrganizationsRequest.php +lib/Model/MergePersonDealRelatedInfo.php +lib/Model/MergePersonItem.php +lib/Model/MergePersonsRequest.php +lib/Model/MergePersonsResponse.php +lib/Model/MergePersonsResponseAllOf.php +lib/Model/MessageObject.php +lib/Model/MessageObjectAttachments.php +lib/Model/ModelInterface.php +lib/Model/NewDeal.php +lib/Model/NewDealAllOf.php +lib/Model/NewDealProduct.php +lib/Model/NewFollowerResponse.php +lib/Model/NewFollowerResponseData.php +lib/Model/NewGoal.php +lib/Model/NewOrganization.php +lib/Model/NewOrganizationAllOf.php +lib/Model/NewPerson.php +lib/Model/NewPersonAllOf.php +lib/Model/NewProductField.php +lib/Model/Note.php +lib/Model/NoteAllOf.php +lib/Model/NoteConnectToParams.php +lib/Model/NoteCreatorUser.php +lib/Model/NoteField.php +lib/Model/NoteFieldOptions.php +lib/Model/NoteFieldsResponse.php +lib/Model/NoteFieldsResponseAllOf.php +lib/Model/NoteParams.php +lib/Model/NumberBoolean.php +lib/Model/NumberBooleanDefault0.php +lib/Model/NumberBooleanDefault1.php +lib/Model/ObjectPrices.php +lib/Model/OneLeadResponse200.php +lib/Model/OptionalNameObject.php +lib/Model/OrgAndOwnerId.php +lib/Model/OrganizationAddressInfo.php +lib/Model/OrganizationCountAndAddressInfo.php +lib/Model/OrganizationCountInfo.php +lib/Model/OrganizationData.php +lib/Model/OrganizationDataWithId.php +lib/Model/OrganizationDataWithIdAllOf.php +lib/Model/OrganizationDataWithIdAndActiveFlag.php +lib/Model/OrganizationDataWithIdAndActiveFlagAllOf.php +lib/Model/OrganizationDeleteResponse.php +lib/Model/OrganizationDeleteResponseData.php +lib/Model/OrganizationDetailsGetResponse.php +lib/Model/OrganizationDetailsGetResponseAllOf.php +lib/Model/OrganizationDetailsGetResponseAllOfAdditionalData.php +lib/Model/OrganizationFlowResponse.php +lib/Model/OrganizationFlowResponseAllOf.php +lib/Model/OrganizationFlowResponseAllOfData.php +lib/Model/OrganizationFlowResponseAllOfRelatedObjects.php +lib/Model/OrganizationFollowerDeleteResponse.php +lib/Model/OrganizationFollowerDeleteResponseData.php +lib/Model/OrganizationFollowerItem.php +lib/Model/OrganizationFollowerItemAllOf.php +lib/Model/OrganizationFollowerPostResponse.php +lib/Model/OrganizationFollowersListResponse.php +lib/Model/OrganizationItem.php +lib/Model/OrganizationItemAllOf.php +lib/Model/OrganizationPostResponse.php +lib/Model/OrganizationPostResponseAllOf.php +lib/Model/OrganizationRelationship.php +lib/Model/OrganizationRelationshipDeleteResponse.php +lib/Model/OrganizationRelationshipDeleteResponseAllOf.php +lib/Model/OrganizationRelationshipDeleteResponseAllOfData.php +lib/Model/OrganizationRelationshipDetails.php +lib/Model/OrganizationRelationshipGetResponse.php +lib/Model/OrganizationRelationshipGetResponseAllOf.php +lib/Model/OrganizationRelationshipPostResponse.php +lib/Model/OrganizationRelationshipPostResponseAllOf.php +lib/Model/OrganizationRelationshipUpdateResponse.php +lib/Model/OrganizationRelationshipWithCalculatedFields.php +lib/Model/OrganizationSearchItem.php +lib/Model/OrganizationSearchItemItem.php +lib/Model/OrganizationSearchResponse.php +lib/Model/OrganizationSearchResponseAllOf.php +lib/Model/OrganizationSearchResponseAllOfData.php +lib/Model/OrganizationUpdateResponse.php +lib/Model/OrganizationUpdateResponseAllOf.php +lib/Model/OrganizationsDeleteResponse.php +lib/Model/OrganizationsDeleteResponseData.php +lib/Model/OrganizationsMergeResponse.php +lib/Model/OrganizationsMergeResponseData.php +lib/Model/Owner.php +lib/Model/OwnerAllOf.php +lib/Model/PaginationDetails.php +lib/Model/PaginationDetailsAllOf.php +lib/Model/Params.php +lib/Model/PaymentItem.php +lib/Model/PaymentsResponse.php +lib/Model/PaymentsResponseAllOf.php +lib/Model/PermissionSets.php +lib/Model/PermissionSetsAllOf.php +lib/Model/PermissionSetsItem.php +lib/Model/PersonCountAndEmailInfo.php +lib/Model/PersonCountEmailDealAndActivityInfo.php +lib/Model/PersonCountInfo.php +lib/Model/PersonData.php +lib/Model/PersonDataEmail.php +lib/Model/PersonDataPhone.php +lib/Model/PersonDataWithActiveFlag.php +lib/Model/PersonDataWithActiveFlagAllOf.php +lib/Model/PersonFlowResponse.php +lib/Model/PersonFlowResponseAllOf.php +lib/Model/PersonFlowResponseAllOfData.php +lib/Model/PersonItem.php +lib/Model/PersonListProduct.php +lib/Model/PersonNameCountAndEmailInfo.php +lib/Model/PersonNameCountAndEmailInfoWithIds.php +lib/Model/PersonNameCountAndEmailInfoWithIdsAllOf.php +lib/Model/PersonNameInfo.php +lib/Model/PersonNameInfoWithOrgAndOwnerId.php +lib/Model/PersonSearchItem.php +lib/Model/PersonSearchItemItem.php +lib/Model/PersonSearchItemItemOrganization.php +lib/Model/PersonSearchItemItemOwner.php +lib/Model/PersonSearchResponse.php +lib/Model/PersonSearchResponseAllOf.php +lib/Model/PersonSearchResponseAllOfData.php +lib/Model/PictureData.php +lib/Model/PictureDataPictures.php +lib/Model/PictureDataWithID.php +lib/Model/PictureDataWithIDAllOf.php +lib/Model/PictureDataWithValue.php +lib/Model/PictureDataWithValueAllOf.php +lib/Model/Pipeline.php +lib/Model/PipelineDetails.php +lib/Model/PipelineDetailsAllOf.php +lib/Model/PostComment.php +lib/Model/PostDealParticipants.php +lib/Model/PostGoalResponse.php +lib/Model/PostNote.php +lib/Model/PostRoleAssignment.php +lib/Model/PostRoleAssignmentAllOf.php +lib/Model/PostRoleAssignmentAllOfData.php +lib/Model/PostRoleSettings.php +lib/Model/PostRoleSettingsAllOf.php +lib/Model/PostRoleSettingsAllOfData.php +lib/Model/PostRoles.php +lib/Model/PostRolesAllOf.php +lib/Model/PostRolesAllOfData.php +lib/Model/ProductAttachementFields.php +lib/Model/ProductAttachmentDetails.php +lib/Model/ProductBaseDeal.php +lib/Model/ProductField.php +lib/Model/ProductFieldAllOf.php +lib/Model/ProductFileItem.php +lib/Model/ProductListItem.php +lib/Model/ProductRequest.php +lib/Model/ProductResponse.php +lib/Model/ProductSearchItem.php +lib/Model/ProductSearchItemItem.php +lib/Model/ProductSearchItemItemOwner.php +lib/Model/ProductSearchResponse.php +lib/Model/ProductSearchResponseAllOf.php +lib/Model/ProductSearchResponseAllOfData.php +lib/Model/ProductWithArrayPrices.php +lib/Model/ProductWithObjectPrices.php +lib/Model/ProductsResponse.php +lib/Model/PutRole.php +lib/Model/PutRoleAllOf.php +lib/Model/PutRoleAllOfData.php +lib/Model/PutRolePipelinesBody.php +lib/Model/RecentDataProduct.php +lib/Model/RecentsActivity.php +lib/Model/RecentsActivityType.php +lib/Model/RecentsDeal.php +lib/Model/RecentsFile.php +lib/Model/RecentsFilter.php +lib/Model/RecentsNote.php +lib/Model/RecentsOrganization.php +lib/Model/RecentsPerson.php +lib/Model/RecentsPipeline.php +lib/Model/RecentsProduct.php +lib/Model/RecentsStage.php +lib/Model/RecentsUser.php +lib/Model/RelatedDealData.php +lib/Model/RelatedDealDataDEALID.php +lib/Model/RelatedFollowerData.php +lib/Model/RelatedOrganizationData.php +lib/Model/RelatedOrganizationDataWithActiveFlag.php +lib/Model/RelatedOrganizationName.php +lib/Model/RelatedPersonData.php +lib/Model/RelatedPersonDataWithActiveFlag.php +lib/Model/RelatedPictureData.php +lib/Model/RelatedUserData.php +lib/Model/RelationshipOrganizationInfoItem.php +lib/Model/RelationshipOrganizationInfoItemAllOf.php +lib/Model/RelationshipOrganizationInfoItemWithActiveFlag.php +lib/Model/RequiredNameObject.php +lib/Model/RequredTitleParameter.php +lib/Model/ResponseCallLogObject.php +lib/Model/ResponseCallLogObjectAllOf.php +lib/Model/RoleAssignment.php +lib/Model/RoleAssignmentAllOf.php +lib/Model/RoleSettings.php +lib/Model/RolesAdditionalData.php +lib/Model/RolesAdditionalDataPagination.php +lib/Model/SinglePermissionSetsItem.php +lib/Model/SinglePermissionSetsItemAllOf.php +lib/Model/Stage.php +lib/Model/StageConversions.php +lib/Model/StageDetails.php +lib/Model/StageWithPipelineInfo.php +lib/Model/StageWithPipelineInfoAllOf.php +lib/Model/SubRole.php +lib/Model/SubRoleAllOf.php +lib/Model/SubscriptionAddonsResponse.php +lib/Model/SubscriptionAddonsResponseAllOf.php +lib/Model/SubscriptionInstallmentCreateRequest.php +lib/Model/SubscriptionInstallmentUpdateRequest.php +lib/Model/SubscriptionItem.php +lib/Model/SubscriptionRecurringCancelRequest.php +lib/Model/SubscriptionRecurringCreateRequest.php +lib/Model/SubscriptionRecurringUpdateRequest.php +lib/Model/SubscriptionsIdResponse.php +lib/Model/SubscriptionsIdResponseAllOf.php +lib/Model/Team.php +lib/Model/TeamAllOf.php +lib/Model/TeamId.php +lib/Model/Teams.php +lib/Model/TeamsAllOf.php +lib/Model/Unauthorized.php +lib/Model/UpdateActivityResponse200.php +lib/Model/UpdateDealProduct.php +lib/Model/UpdateDealRequest.php +lib/Model/UpdateFile.php +lib/Model/UpdateFilterRequest.php +lib/Model/UpdateLeadLabelRequest.php +lib/Model/UpdateLeadRequest.php +lib/Model/UpdateOrganization.php +lib/Model/UpdateOrganizationAllOf.php +lib/Model/UpdatePerson.php +lib/Model/UpdatePersonAllOf.php +lib/Model/UpdatePersonResponse.php +lib/Model/UpdateProductField.php +lib/Model/UpdateProductRequestBody.php +lib/Model/UpdateProductResponse.php +lib/Model/UpdateStageRequest.php +lib/Model/UpdateStageRequestAllOf.php +lib/Model/UpdateTeam.php +lib/Model/UpdateTeamAllOf.php +lib/Model/UpdateTeamWithAdditionalProperties.php +lib/Model/UpdateUserRequest.php +lib/Model/User.php +lib/Model/UserAccess.php +lib/Model/UserAllOf.php +lib/Model/UserAssignmentToPermissionSet.php +lib/Model/UserAssignmentsToPermissionSet.php +lib/Model/UserAssignmentsToPermissionSetAllOf.php +lib/Model/UserConnections.php +lib/Model/UserConnectionsAllOf.php +lib/Model/UserConnectionsAllOfData.php +lib/Model/UserData.php +lib/Model/UserDataWithId.php +lib/Model/UserIDs.php +lib/Model/UserIDsAllOf.php +lib/Model/UserMe.php +lib/Model/UserMeAllOf.php +lib/Model/UserPermissions.php +lib/Model/UserPermissionsAllOf.php +lib/Model/UserPermissionsItem.php +lib/Model/UserSettings.php +lib/Model/UserSettingsAllOf.php +lib/Model/UserSettingsItem.php +lib/Model/Users.php +lib/Model/UsersAllOf.php +lib/Model/VisibleTo.php +lib/Model/Webhook.php +lib/Model/WebhookAllOf.php +lib/Model/WebhookBadRequest.php +lib/Model/WebhookBadRequestAllOf.php +lib/Model/Webhooks.php +lib/Model/WebhooksAllOf.php +lib/Model/WebhooksDeleteForbiddenSchema.php +lib/Model/WebhooksDeleteForbiddenSchemaAllOf.php +lib/ObjectSerializer.php +phpstan.neon +phpunit.xml diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..e230c839 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..b0a49831 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [5.0.0-beta.0](https://github.com/pipedrive/client-php/compare/4.0.10...5.0.0-beta.0) (2023-06-14) + +### Changed +- Breaking switch to SDK generated with [openapi-generator](https://openapi-generator.tech/) \ No newline at end of file diff --git a/LICENSE b/LICENSE index 44b47107..1dd26cfd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ (MIT License) -Copyright (C) 2012-2020 by Pipedrive, Inc. +Copyright (C) 2012-2023 by Pipedrive, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MIGRATION-5.x.md b/MIGRATION-5.x.md new file mode 100644 index 00000000..fa8bd083 --- /dev/null +++ b/MIGRATION-5.x.md @@ -0,0 +1,312 @@ +# Migration Guide from 4.x to 5.x + +## Configuration + +### API Token + +Configure authorization in case of `api_token` usage. + + + + + + + + + +
4.x 5.x
No configuration needed, api_token should have been set when the Client instance was created. + +Default configuration should be updated by setting the api key with the `api_token` prefix. + +```php +use Pipedrive\Configuration; + +$config = new Configuration(); +$config->setApiKey('api_token', 'YOUR_API_TOKEN'); +``` +
+ +### OAuth + +Configure authorization in case of OAuth 2.0 usage. + + + + + + + + + +
4.x 5.x
+OAuth 2.0 configuration properties should have been set
when Client instance was created. + +Stored user tokens have to be set by re-assigning `$token` object with custom values: + +```php + +use Pipedrive\Configuration; + +Configuration::$token = (object) [ + 'accessToken' => 'USER_ACCESS_TOKEN', + 'refreshToken' => 'USER_REFRESH_TOKEN', + 'expiry' => 'USER_ACCESS_TOKEN_EXPIRATION_MS', + 'tokenType' => 'Bearer', +]; +``` + +`$oAuthTokenUpdateCallback` has to be defined to handle callback update tokens in storage. + +```php +Configuration::$oAuthTokenUpdateCallback = function($token) { + // use session or some other way to persist the $token +}; +``` +
+Default configuration should be updated with OAuth 2.0 properties. + +```php +use Pipedrive\Configuration; + +$config = new Configuration(); +$config->setClientId('YOUR_APP_CLIENT_ID'); +$config->setClientSecret('YOUR_APP_CLIENT_SECRET'); +$config->setOauthRedirectUri('YOUR_APP_REDIRECT_URI'); +$config->setOAuthTokenUpdateCallback(function () { + // use session or some other way to persist the $token +}); +``` + +Stored user tokens have to be set with `updateOAuthRelatedFields` method of `Configuration` instance: +```php +$config->updateOAuthRelatedFields([ + 'expires_in' => 'USER_ACCESS_TOKEN_EXPIRATION_MS', + 'access_token' => 'USER_ACCESS_TOKEN', + 'refresh_token' => 'USER_REFRESH_TOKEN', + 'api_domain' => 'USER_API_DOMAIN', +]); +``` +
+
+ +## Authentication + + + + + + + + + +
4.x 5.x
+ Create an instance of Client and navigate the user to authorization URL: + +```php +use Pipedrive\Client; + +$client = new Client(/* ... */); + +$client->auth()->buildAuthorizationUrl()); +``` + +Handle the incoming request, exchange `code` query param and store `$token`. + +```php +use Pipedrive\Client; + +$code = /* get query param value */; + +$client = new Client(/* ... */); + +$token = $client->auth()->authorize($code); +``` + +Update config with your app properties. + +```php +use Pipedrive\Configuration; + +$config = new Configuration(); +/* ... */ + +$config->getAuthorizationPageUrl(); +``` + +Handle incoming request, exchange `code` query param and store `$token`. + +```php +use Pipedrive\Configuration; + +$config = new Configuration(); +/* ... */ + +$config->authorize($code); +``` + +This will automatically set token properties (using `updateOAuthRelatedFields`) and call `setOAuthTokenUpdateCallback` callback. +
+
+ +## API requests + +Here are some examples based on the **deal** entity. + +### List deals + + + + + + + + + +
4.x 5.x
+ +```php +use Pipedrive\Client; + +/* ...configuration needed here... */ + +$client = new Client(/* ... */); +$client->getDeals()->getAllDeals([ + 'limit' => 10, + 'status' => 'open', +]); +``` + + +```php +use Pipedrive\Client; + +$config = new Configuration(); + +/* ...configuration needed here... */ + +$dealsApiInstance = new DealsApi(null, $config); +$response = $dealsApiInstance->getDeals( + null, + null, + null, + 'open', + 0, + 10, +); +``` +
+ +### Add new deal + + + + + + + + + +
4.x 5.x
+ +```php +use Pipedrive\Client; + +/* ...configuration needed here... */ + +$client = new Client(/* ... */); +$response = $client->getDeals()->addADeal([ + 'title' => 'DEAL_TITLE' +]); +``` + + +```php +use Pipedrive\Client; +use Pipedrive\Model\NewDeal; + +$config = new Configuration(); + +/* ...configuration needed here... */ + +$dealsApiInstance = new DealsApi(null, $config); +$response = $dealsApiInstance->addDeal(new NewDeal([ + 'title' => 'DEAL_TITLE', +])); +``` +
+ +### Update deal + + + + + + + + + +
4.x 5.x
+ +```php +use Pipedrive\Client; + +/* ...configuration needed here... */ + +$client = new Client(/* ... */); +$response = $client->getDeals()->updateADeal([ + 'id' => 'DEAL_ID', + 'title' => 'DEAL_TITLE_UPDATED' +]); +``` + + +```php +use Pipedrive\Client; +use Pipedrive\Model\NewDeal; + +$config = new Configuration(); + +/* ...configuration needed here... */ + +$dealId = /* DEAL_ID */; +$dealsApiInstance = new DealsApi(null, $config); +$response = $dealsApiInstance->updateDeal($dealId, new UpdateDealRequest([ + 'title' => 'DEAL_TITLE_UPDATED', +])); +``` +
+ +### Delete deal + + + + + + + + + +
4.x 5.x
+ +```php +use Pipedrive\Client; + +/* ...configuration needed here... */ + +$client = new Client(/* ... */); +$response = $client->getDeals()->deleteADeal('DEAL_ID'); +``` + + +```php +use Pipedrive\Client; + +$config = new Configuration(); + +/* ...configuration needed here... */ + +$dealId = /* DEAL_ID */; +$dealsApiInstance = new DealsApi(null, $config); +$response = $dealsApiInstance->deleteDeal($dealId); +``` +
diff --git a/README.md b/README.md index 0ce85b89..17f47966 100644 --- a/README.md +++ b/README.md @@ -1,8308 +1,1358 @@ -# Pipedrive client for PHP based apps -Pipedrive is a sales pipeline software that gets you organized. It's a powerful sales CRM with effortless sales pipeline management. See www.pipedrive.com for details. - -This is the official Pipedrive API wrapper-client for PHP based apps, distributed by Pipedrive Inc freely under the MIT licence. It provides convenient access to the Pipedrive API, allowing you to operate with objects such as Deals, Persons, Organizations, Products and much more. - -> ⚠️ Version 1 is the initial release of our official php client. It provides its users access to our API in a convenient way using either API tokens or OAuth2. -> -> Please use the [issues page](https://github.com/pipedrive/client-php/issues) for reporting bugs or leaving feedback. Keep in mind most of the code is [automatically generated](https://github.com/pipedrive/client-php/#contributing). - -## Installation - -You can install the package via `composer require` command: - -```shell -composer require pipedrive/pipedrive -``` - -Or simply add it to your composer.json dependences and run `composer update`: - -```json -"require": { - "pipedrive/pipedrive": "^3.0" -} -``` - -## API Documentation - -The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1 - -## Licence - -This Pipedrive API client is distributed under the MIT licence. - -## How to use - -### With a pre-set API token - -```php -getUsers()->getCurrentUserData(); - echo '
';
-    var_dump($response);
-    echo '
'; -} catch (\Pipedrive\APIException $e) { - echo $e; -} -``` - -### With OAuth 2 - -In order to setup authentication in the API client, you need the following information. - -| Parameter | Description | -|-----------|-------------| -| oAuthClientId | OAuth 2 Client ID | -| oAuthClientSecret | OAuth 2 Client Secret | -| oAuthRedirectUri | OAuth 2 Redirection endpoint or Callback Uri | - - -API client can be initialized as following: - -```php -$oAuthClientId = 'oAuthClientId'; // OAuth 2 Client ID -$oAuthClientSecret = 'oAuthClientSecret'; // OAuth 2 Client Secret -$oAuthRedirectUri = 'https://example.com/oauth/callback'; // OAuth 2 Redirection endpoint or Callback Uri - -$client = new Pipedrive\Client($oAuthClientId, $oAuthClientSecret, $oAuthRedirectUri); -``` - -You must now authorize the client. - -### Authorizing your client - -Your application must obtain user authorization before it can execute an endpoint call. -The SDK uses *OAuth 2.0 authorization* to obtain a user's consent to perform an API request on user's behalf. - -#### 1. Obtain user consent - -To obtain user's consent, you must redirect the user to the authorization page. The `buildAuthorizationUrl()` method creates the URL to the authorization page. -```php -$authUrl = $client->auth()->buildAuthorizationUrl(); -header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL)); -``` - -#### 2. Handle the OAuth server response - -Once the user responds to the consent request, the OAuth 2.0 server responds to your application's access request by redirecting the user to the redirect URI specified set in `Configuration`. - -If the user approves the request, the authorization code will be sent as the `code` query string: - -``` -https://example.com/oauth/callback?code=XXXXXXXXXXXXXXXXXXXXXXXXX -``` - -If the user does not approve the request, the response contains an `error` query string: - -``` -https://example.com/oauth/callback?error=access_denied -``` - -#### 3. Authorize the client using the code - -After the server receives the code, it can exchange this for an *access token*. The access token is an object containing information for authorizing client requests and refreshing the token itself. - -```php -try { - $client->auth()->authorize($_GET['code']); -} catch (Pipedrive\Exceptions\OAuthProviderException $ex) { - // handle exception -} -``` - -### Refreshing token - -An access token may expire after sometime. To extend its lifetime, you must refresh the token. - -```php -if ($client->auth()->isTokenExpired()) { - try { - $client->auth()->refreshToken(); - } catch (Pipedrive\Exceptions\OAuthProviderException $ex) { - // handle exception - } -} -``` - -If a token expires, the SDK will attempt to automatically refresh the token before the next endpoint call requiring authentication. - -### Storing an access token for reuse - -It is recommended that you store the access token for reuse. - -You can store the access token in the `$_SESSION` global: - -```php -// store token -$_SESSION['access_token'] = Pipedrive\Configuration::$oAuthToken; -``` - -However, since the the SDK will attempt to automatically refresh the token when it expires, it is recommended that you register a *token update callback* to detect any change to the access token. - -```php -Pipedrive\Configuration::$oAuthTokenUpdateCallback = function($token) { - // use session or some other way to persist the $token - $_SESSION['access_token'] = $token; -}; -``` - -The token update callback will be fired upon authorization as well as token refresh. - -### Creating a client from a stored token - -To authorize a client from a stored access token, just set the access token in `Configuration` along with the other configuration parameters before creating the client: - -```php -// load token later... -Pipedrive\Configuration::$oAuthToken = $_SESSION['access_token']; - -// Set other configuration, then instantiate client -$client = new Pipedrive\Client(); -``` - -### Complete example with OAuth2 - -In this example, the `index.php` will first check if an access token is available for the user. If one is not set, -it redirects the user to `authcallback.php` which will obtain an access token and redirect the user back to the `index.php` page. -Now that an access token is set, `index.php` can use the client to make authorized calls to the server. - -#### `index.php` - -```php -getUsers()->getCurrentUserData(); - echo '
';
-        var_dump($response);
-        echo '
'; - } catch (\Pipedrive\APIException $e) { - echo $e; - } - - // now you can use $client to make endpoint calls - // client will automatically refresh the token when it expires and call the token update callback -} else { - // redirect user to a page that handles authorization - header('Location: ' . filter_var($oAuthRedirectUri, FILTER_SANITIZE_URL)); -} -``` - -#### `authcallback.php` - -```php -auth()->buildAuthorizationUrl(); - header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL)); -} else { - try { - // authorize client (calls token update callback as well) - $token = $client->auth()->authorize($_GET['code']); - - // resume user activity - $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/'; - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); - } catch (Pipedrive\Exceptions\OAuthProviderException $ex) { - // handle exception - } -} -``` - -## Contributing -- Run tests -- Open a pull request - -Please be aware that most of the code is auto-generated. You are welcome to suggest changes and report bugs. However, any updates will have to be implemented in the underlying generator. - -## How to Test - -Unit tests in this SDK can be run using PHPUnit. - -1. First install the dependencies using composer including the `require-dev` dependencies. -2. Run `vendor\bin\phpunit --verbose` from commandline to execute tests. If you have - installed PHPUnit globally, run tests using `phpunit --verbose` instead. - -You can change the PHPUnit test configuration in the `phpunit.xml` file. - -# Class Reference - -## List of Controllers - -* [ActivitiesController](#activities_controller) -* [ActivityFieldsController](#activity_fields_controller) -* [ActivityTypesController](#activity_types_controller) -* [CallLogsController](#call_logs_controller) -* [CurrenciesController](#currencies_controller) -* [DealFieldsController](#deal_fields_controller) -* [DealsController](#deals_controller) -* [FilesController](#files_controller) -* [FiltersController](#filters_controller) -* [GlobalMessagesController](#global_messages_controller) -* [GoalsController](#goals_controller) -* [ItemSearchController](#item_search_controller) -* [MailMessagesController](#mail_messages_controller) -* [MailThreadsController](#mail_threads_controller) -* [NoteFieldsController](#note_fields_controller) -* [NotesController](#notes_controller) -* [OrganizationFieldsController](#organization_fields_controller) -* [OrganizationRelationshipsController](#organization_relationships_controller) -* [OrganizationsController](#organizations_controller) -* [PermissionSetsController](#permission_sets_controller) -* [PersonFieldsController](#person_fields_controller) -* [PersonsController](#persons_controller) -* [PipelinesController](#pipelines_controller) -* [ProductFieldsController](#product_fields_controller) -* [ProductsController](#products_controller) -* [RecentsController](#recents_controller) -* [RolesController](#roles_controller) -* [SearchResultsController](#search_results_controller) -* [StagesController](#stages_controller) -* [TeamsController](#teams_controller) -* [UserConnectionsController](#user_connections_controller) -* [UserSettingsController](#user_settings_controller) -* [UsersController](#users_controller) -* [WebhooksController](#webhooks_controller) - -## ![Class: ](https://apidocs.io/img/class.png ".ActivitiesController") ActivitiesController - -### Get singleton instance - -The singleton instance of the ``` ActivitiesController ``` class can be accessed from the API Client. - -```php -$activities = $client->getActivities(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ActivitiesController.deleteMultipleActivitiesInBulk") deleteMultipleActivitiesInBulk - -> Marks multiple activities as deleted. - - -```php -function deleteMultipleActivitiesInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated IDs that will be deleted | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$activities->deleteMultipleActivitiesInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivitiesController.getAllActivitiesAssignedToAParticularUser") getAllActivitiesAssignedToAParticularUser - -> Returns all activities assigned to a particular user. - - -```php -function getAllActivitiesAssignedToAParticularUser($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| userId | ``` Optional ``` | ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. | -| filterId | ``` Optional ``` | ID of the filter to use (will narrow down results if used together with user_id parameter). | -| type | ``` Optional ``` | Type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the key_string parameter of ActivityTypes. | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| startDate | ``` Optional ``` | Date in format of YYYY-MM-DD from which activities to fetch from. | -| endDate | ``` Optional ``` | Date in format of YYYY-MM-DD until which activities to fetch to. | -| done | ``` Optional ``` | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. | - - - -#### Example Usage - -```php -$userId = 119; -$collect['userId'] = $userId; - -$filterId = 119; -$collect['filterId'] = $filterId; - -$type = 'type'; -$collect['type'] = $type; - -$start = 0; -$collect['start'] = $start; - -$limit = 119; -$collect['limit'] = $limit; - -$startDate = date("D M d, Y G:i"); -$collect['startDate'] = $startDate; - -$endDate = date("D M d, Y G:i"); -$collect['endDate'] = $endDate; - -$done = int::ENUM_0; -$collect['done'] = $done; - - -$activities->getAllActivitiesAssignedToAParticularUser($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivitiesController.addAnActivity") addAnActivity - -> Adds a new activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information on how to add an activity, see this tutorial. - - -```php -function addAnActivity($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| subject | ``` Required ``` | Subject of the activity | -| type | ``` Required ``` | Type of the activity. This is in correlation with the key_string parameter of ActivityTypes. | -| done | ``` Optional ``` | Whether the activity is done or not. 0 = Not done, 1 = Done | -| dueDate | ``` Optional ``` | Due date of the activity. Format: YYYY-MM-DD | -| dueTime | ``` Optional ``` | Due time of the activity in UTC. Format: HH:MM | -| duration | ``` Optional ``` | Duration of the activity. Format: HH:MM | -| userId | ``` Optional ``` | ID of the user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. | -| dealId | ``` Optional ``` | ID of the deal this activity will be associated with | -| personId | ``` Optional ``` | ID of the person this activity will be associated with | -| participants | ``` Optional ``` | List of multiple persons (participants) this activity will be associated with. If omitted, single participant from person_id field is used. It requires a structure as follows: [{"person_id":1,"primary_flag":true}] | -| orgId | ``` Optional ``` | ID of the organization this activity will be associated with | -| note | ``` Optional ``` | Note of the activity (HTML format) | -| busyFlag | ``` Optional ``` | Set the activity as 'Busy' or 'Free'. If the flag is set to true, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with null. When the value of the flag is unset (null), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. Format: true/false | - - - -#### Example Usage - -```php -$subject = 'subject'; -$collect['subject'] = $subject; - -$type = 'type'; -$collect['type'] = $type; - -$done = int::ENUM_0; -$collect['done'] = $done; - -$dueDate = date("D M d, Y G:i"); -$collect['dueDate'] = $dueDate; - -$dueTime = 'due_time'; -$collect['dueTime'] = $dueTime; - -$duration = 'duration'; -$collect['duration'] = $duration; - -$userId = 119; -$collect['userId'] = $userId; - -$dealId = 119; -$collect['dealId'] = $dealId; - -$personId = 119; -$collect['personId'] = $personId; - -$participants = 'participants'; -$collect['participants'] = $participants; - -$orgId = 119; -$collect['orgId'] = $orgId; - -$note = 'note'; -$collect['note'] = $note; - -$busyFlag = true; -$collect['busyFlag'] = $busyFlag; - -$activities->addAnActivity($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivitiesController.deleteAnActivity") deleteAnActivity - -> Deletes an activity. - - -```php -function deleteAnActivity($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the activity | - - - -#### Example Usage - -```php -$id = 119; - -$activities->deleteAnActivity($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivitiesController.getDetailsOfAnActivity") getDetailsOfAnActivity - -> Returns details of a specific activity. - - -```php -function getDetailsOfAnActivity($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the activity | - - - -#### Example Usage - -```php -$id = 119; - -$activities->getDetailsOfAnActivity($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivitiesController.updateEditAnActivity") updateEditAnActivity - -> Modifies an activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). - - -```php -function updateEditAnActivity($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the activity | -| subject | ``` Required ``` | Subject of the activity | -| type | ``` Required ``` | Type of the activity. This is in correlation with the key_string parameter of ActivityTypes. | -| done | ``` Optional ``` | TODO: Add a parameter description | -| dueDate | ``` Optional ``` | Due date of the activity. Format: YYYY-MM-DD | -| dueTime | ``` Optional ``` | Due time of the activity in UTC. Format: HH:MM | -| duration | ``` Optional ``` | Duration of the activity. Format: HH:MM | -| userId | ``` Optional ``` | ID of the user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. | -| dealId | ``` Optional ``` | ID of the deal this activity will be associated with | -| personId | ``` Optional ``` | ID of the person this activity will be associated with | -| participants | ``` Optional ``` | List of multiple persons (participants) this activity will be associated with. If omitted, single participant from person_id field is used. It requires a structure as follows: [{"person_id":1,"primary_flag":true}] | -| orgId | ``` Optional ``` | ID of the organization this activity will be associated with | -| note | ``` Optional ``` | Note of the activity (HTML format) | -| busyFlag | ``` Optional ``` | Set the activity as 'Busy' or 'Free'. If the flag is set to true, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with null. When the value of the flag is unset (null), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. Format: true/false | - - - -#### Example Usage - -```php -$id = 119; -$collect['id'] = $id; - -$subject = 'subject'; -$collect['subject'] = $subject; - -$type = 'type'; -$collect['type'] = $type; - -$done = int::ENUM_0; -$collect['done'] = $done; - -$dueDate = date("D M d, Y G:i"); -$collect['dueDate'] = $dueDate; - -$dueTime = 'due_time'; -$collect['dueTime'] = $dueTime; - -$duration = 'duration'; -$collect['duration'] = $duration; - -$userId = 119; -$collect['userId'] = $userId; - -$dealId = 119; -$collect['dealId'] = $dealId; - -$personId = 119; -$collect['personId'] = $personId; - -$participants = 'participants'; -$collect['participants'] = $participants; - -$orgId = 119; -$collect['orgId'] = $orgId; - -$note = 'note'; -$collect['note'] = $note; - - -$activities->updateEditAnActivity($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".ActivityFieldsController") ActivityFieldsController - -### Get singleton instance - -The singleton instance of the ``` ActivityFieldsController ``` class can be accessed from the API Client. - -```php -$activityFields = $client->getActivityFields(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ActivityFieldsController.getAllFieldsForAnActivity") getAllFieldsForAnActivity - -> Return list of all fields for activity - - -```php -function getAllFieldsForAnActivity() -``` - -#### Example Usage - -```php - -$activityFields->getAllFieldsForAnActivity(); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".ActivityTypesController") ActivityTypesController - -### Get singleton instance - -The singleton instance of the ``` ActivityTypesController ``` class can be accessed from the API Client. - -```php -$activityTypes = $client->getActivityTypes(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ActivityTypesController.deleteMultipleActivityTypesInBulk") deleteMultipleActivityTypesInBulk - -> Marks multiple activity types as deleted. - - -```php -function deleteMultipleActivityTypesInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated activity type IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$activityTypes->deleteMultipleActivityTypesInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivityTypesController.getAllActivityTypes") getAllActivityTypes - -> Returns all activity types - - -```php -function getAllActivityTypes() -``` - -#### Example Usage - -```php - -$activityTypes->getAllActivityTypes(); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivityTypesController.addNewActivityType") addNewActivityType - -> Adds a new activity type, returns the ID, the key_string and the order number of the newly added activity type upon success. - - -```php -function addNewActivityType($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| name | ``` Required ``` | Name of the activity type | -| iconKey | ``` Required ``` | Icon graphic to use for representing this activity type. | -| color | ``` Optional ``` | A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). | - - - -#### Example Usage - -```php -$name = 'name'; -$collect['name'] = $name; - -$iconKey = string::TASK; -$collect['iconKey'] = $iconKey; - -$color = 'color'; -$collect['color'] = $color; - - -$activityTypes->addNewActivityType($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivityTypesController.deleteAnActivityType") deleteAnActivityType - -> Marks an activity type as deleted. - - -```php -function deleteAnActivityType($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the activity type | - - - -#### Example Usage - -```php -$id = 119; - -$activityTypes->deleteAnActivityType($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ActivityTypesController.updateEditActivityType") updateEditActivityType - -> Updates an activity type. - - -```php -function updateEditActivityType($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the activity type | -| name | ``` Optional ``` | Name of the activity type | -| iconKey | ``` Optional ``` | Icon graphic to use for representing this activity type. | -| color | ``` Optional ``` | A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). | -| orderNr | ``` Optional ``` | An order number for this activity type. Order numbers should be used to order the types in the activity type selections. | - - - -#### Example Usage - -```php -$id = 119; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$iconKey = string::TASK; -$collect['iconKey'] = $iconKey; - -$color = 'color'; -$collect['color'] = $color; - -$orderNr = 119; -$collect['orderNr'] = $orderNr; - - -$activityTypes->updateEditActivityType($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".CallLogsController") CallLogsController - -### Get singleton instance - -The singleton instance of the ``` CallLogsController ``` class can be accessed from the API Client. - -```php -$callLogs = $client->getCallLogs(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".CallLogsController.getAllCallLogsAssignedToAParticularUser") getAllCallLogsAssignedToAParticularUser - -> Returns all call logs assigned to a particular user - - -```php -function getAllCallLogsAssignedToAParticularUser($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| start | ``` Optional ``` | For pagination, the position that represents the first result for the page | -| limit | ``` Optional ``` | For pagination, the limit of entries to be returned | - -#### Example Usage - -```php -$start = 0; -$options['start'] = $start; - -$limit = 119; -$options['limit'] = $limit; - -$callLogs->getAllCallLogsAssignedToAParticularUser($options); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".CallLogsController.getDetailsOfACallLog") getDetailsOfACallLog - -> Returns details of a specific call log - - -```php -function getDetailsOfACallLog($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - -#### Example Usage - -```php -$id = 1; - -$callLogs->getDetailsOfACallLog($id); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".CallLogsController.addACallLog") addACallLog - -> Adds a new call log - - -```php -function addACallLog($collect) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| user_id | ```optional``` | The ID of the owner of the call log | -| activity_id | ```optional``` | If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify deal_id, person_id or org_id, as they will be ignored in favor of the values already available in the activity. | -| subject| ```optional``` | Name of the activity this call is attached to | -| duration| ```optional``` | Call duration in seconds | -| outcome| ```required``` | Describes the outcome of the call | -| from_phone_number| ```optional``` | The number that made the call | -| to_phone_number| ```required``` | The number called | -| start_time| ```required``` | The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. | -| end_time | ```required``` | The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. | -| person_id | ```optional``` | The ID of the Person this call is associated with | -| org_id | ```optional``` | The ID of the Organization this call is associated with | -| deal_id | ```optional``` | The ID of the Deal this call is associated with | - -#### Example Usage - -```php - -$subject = 'subject'; -$collect['subject'] = $subject; - -$duration = 60; -$collect['duration'] = $duration; - -$outcome = 'connected' -$collect['outcome'] = $connected; - -$fromPhoneNumber = '+55 555 5555'; -$collect['from_phone_number'] = $fromPhoneNumber; - -$fromPhoneNumber = '+55 555 5556'; -$collect['to_phone_number'] = $fromPhoneNumber; - -$startTime = '2021-01-30 22:30:00'; -$collect['start_time'] = $startTime; - -$endTime = '2021-01-30 22:31:00'; -$collect['end_time'] = $endTime; - -$personId = 1; -$collect['person_id'] = $personId; - -$orgId = 1; -$collect['org_id'] = $orgId; - -$dealId = 1; -$collect['deal_id'] = $dealId; - -$note = 'note'; -$collect['note'] = $note; - -$callLogs->addACallLog($collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".CallLogsController.attachAnAudioFileToTheCallLog") attachAnAudioFileToTheCallLog - -> Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. - - -```php -function attachAnAudioFileToTheCallLog($id, $collect) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ```required``` | The ID received when you create the call log | -| file | ```required``` | Audio file supported by the HTML5 specification | -| mime_type | ```required``` | The mime type of the file, according to html5 standards (eg.: audio/wave for a .wav file )| - -#### Example Usage - -```php - -$id = 'id'; - -$file = "PathToFile"; -$collect['file'] = $file; - -$callLogs->attachAnAudioFileToTheCallLog($id, $collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".CallLogsController.deleteACallLog") deleteACallLog - -> Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. - - -```php -function deleteACallLog($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ```required``` | ID of the callLog | - -#### Example Usage - -```php - -$id = 'id'; - -$callLogs->deleteACallLog($id); - -``` - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".CurrenciesController") CurrenciesController - -### Get singleton instance - -The singleton instance of the ``` CurrenciesController ``` class can be accessed from the API Client. - -```php -$currencies = $client->getCurrencies(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".CurrenciesController.getAllSupportedCurrencies") getAllSupportedCurrencies - -> Returns all supported currencies in given account which should be used when saving monetary values with other objects. The 'code' parameter of the returning objects is the currency code according to ISO 4217 for all non-custom currencies. - - -```php -function getAllSupportedCurrencies($term = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Optional ``` | Optional search term that is searched for from currency's name and/or code. | - - - -#### Example Usage - -```php -$term = 'term'; - -$result = $currencies->getAllSupportedCurrencies($term); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".DealFieldsController") DealFieldsController - -### Get singleton instance - -The singleton instance of the ``` DealFieldsController ``` class can be accessed from the API Client. - -```php -$dealFields = $client->getDealFields(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".DealFieldsController.deleteMultipleDealFieldsInBulk") deleteMultipleDealFieldsInBulk - -> Marks multiple fields as deleted. - - -```php -function deleteMultipleDealFieldsInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated field IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$dealFields->deleteMultipleDealFieldsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealFieldsController.getAllDealFields") getAllDealFields - -> Returns data about all fields deals can have - - -```php -function getAllDealFields($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$start = 0; -$collect['start'] = $start; - -$limit = 119; -$collect['limit'] = $limit; - - -$dealFields->getAllDealFields($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealFieldsController.addANewDealField") addANewDealField - -> Adds a new deal field. For more information on adding a new custom field, see this tutorial. - - -```php -function addANewDealField($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$dealFields->addANewDealField($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealFieldsController.deleteADealField") deleteADealField - -> Marks a field as deleted. For more information on how to delete a custom field, see this tutorial. - - -```php -function deleteADealField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - - - -#### Example Usage - -```php -$id = 119; - -$dealFields->deleteADealField($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealFieldsController.getOneDealField") getOneDealField - -> Returns data about a specific deal field. - - -```php -function getOneDealField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - - - -#### Example Usage - -```php -$id = 119; - -$dealFields->getOneDealField($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealFieldsController.updateADealField") updateADealField - -> Updates a deal field. See an example of updating custom fields’ values in this tutorial. - - -```php -function updateADealField($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | -| name | ``` Required ``` | Name of the field | -| options | ``` Optional ``` | When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array, for example: ["red","blue","lilac"] | - - - -#### Example Usage - -```php -$id = 119; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$options = 'options'; -$collect['options'] = $options; - - -$dealFields->updateADealField($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".DealsController") DealsController - -### Get singleton instance - -The singleton instance of the ``` DealsController ``` class can be accessed from the API Client. - -```php -$deals = $client->getDeals(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.deleteMultipleDealsInBulk") deleteMultipleDealsInBulk - -> Marks multiple deals as deleted. - - -```php -function deleteMultipleDealsInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated IDs that will be deleted | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$result = $deals->deleteMultipleDealsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.getAllDeals") getAllDeals - -> Returns all deals. For more information on how to get all deals, see this tutorial. - - -```php -function getAllDeals($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| userId | ``` Optional ``` | If supplied, only deals matching the given user will be returned. | -| filterId | ``` Optional ``` | ID of the filter to use | -| stageId | ``` Optional ``` | If supplied, only deals within the given stage will be returned. | -| status | ``` Optional ``` ``` DefaultValue ``` | Only fetch deals with specific status. If omitted, all not deleted deals are fetched. | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). | -| ownedByYou | ``` Optional ``` | When supplied, only deals owned by you are returned. However filter_id takes precedence over owned_by_you when both are supplied. | - - - -#### Example Usage - -```php -$userId = 119; -$collect['userId'] = $userId; - -$filterId = 119; -$collect['filterId'] = $filterId; - -$stageId = 119; -$collect['stageId'] = $stageId; - -$status = string::ALL_NOT_DELETED; -$collect['status'] = $status; - -$start = 0; -$collect['start'] = $start; - -$limit = 119; -$collect['limit'] = $limit; - -$sort = 'sort'; -$collect['sort'] = $sort; - -$ownedByYou = int::ENUM_0; -$collect['ownedByYou'] = $ownedByYou; - - -$result = $deals->getAllDeals($collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.searchDeals") searchDeals - -> Searches all Deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found Deals can be filtered by Person ID and Organization ID. - - -```php -function searchDeals($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | The search term to look for. Minimum 2 characters (or 1 if using exact_match). | -| fields | ``` Optional ``` | A comma-separated string array. The fields to perform the search from. Defaults to all of them. | -| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. It is not case sensitive. | -| personId | ``` Optional ``` | Will filter Deals by the provided Person ID. The upper limit of found Deals associated with the Person is 2000. | -| organizationId | ``` Optional ``` | Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. | -| status | ``` Optional ``` | Will filter Deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found Deals associated with the status is 2000. | -| includeFields | ``` Optional ``` | Supports including optional fields in the results which are not provided by default. | -| start | ``` Optional ``` | Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. | -| limit | ``` Optional ``` | Items shown per page | - - -#### Example Usage - -```php -$term = 'term'; -$collect['term'] = $term; - -$results = $deals->searchDeals($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.addADeal") addADeal - -> Adds a new deal. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for 'key' values. For more information on how to add a deal, see this tutorial. - - -```php -function addADeal($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$result = $deals->addADeal($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.getDealsSummary") getDealsSummary - -> Returns summary of all the deals. - - -```php -function getDealsSummary($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| status | ``` Optional ``` | Only fetch deals with specific status. open = Open, won = Won, lost = Lost | -| filterId | ``` Optional ``` | user_id will not be considered. Only deals matching the given filter will be returned. | -| userId | ``` Optional ``` | Only deals matching the given user will be returned. user_id will not be considered if you use filter_id. | -| stageId | ``` Optional ``` | Only deals within the given stage will be returned. | -| pipelineId | ``` Optional ``` | Only deals within the given pipeline will be returned. | - - - -#### Example Usage - -```php -$status = string::OPEN; -$collect['status'] = $status; - -$filterId = 119; -$collect['filterId'] = $filterId; - -$userId = 119; -$collect['userId'] = $userId; - -$stageId = 119; -$collect['stageId'] = $stageId; - - -$result = $deals->getDealsSummary($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.getDealsTimeline") getDealsTimeline - -> Returns open and won deals, grouped by defined interval of time set in a date-type dealField (field_key) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given field_key. - - -```php -function getDealsTimeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| startDate | ``` Required ``` | Date where first interval starts. Format: YYYY-MM-DD | -| interval | ``` Required ``` | Type of interval.
day
Day
week
A full week (7 days) starting from start_date
month
A full month (depending on the number of days in given month) starting from start_date
quarter
A full quarter (3 months) starting from start_date
| -| amount | ``` Required ``` | Number of given intervals, starting from start_date, to fetch. E.g. 3 (months). | -| fieldKey | ``` Required ``` | The name of the date field by which to get deals by. | -| userId | ``` Optional ``` | If supplied, only deals matching the given user will be returned. | -| pipelineId | ``` Optional ``` | If supplied, only deals matching the given pipeline will be returned. | -| filterId | ``` Optional ``` | If supplied, only deals matching the given filter will be returned. | -| excludeDeals | ``` Optional ``` | Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. | -| totalsConvertCurrency | ``` Optional ``` | 3-letter currency code of any of the supported currencies. When supplied, totals_converted is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to 'default_currency' in which case users default currency is used. | - - - -#### Example Usage - -```php -$startDate = date("D M d, Y G:i"); -$collect['startDate'] = $startDate; - -$interval = string::DAY; -$collect['interval'] = $interval; - -$amount = 119; -$collect['amount'] = $amount; - -$fieldKey = 'field_key'; -$collect['fieldKey'] = $fieldKey; - -$userId = 119; -$collect['userId'] = $userId; - -$pipelineId = 119; -$collect['pipelineId'] = $pipelineId; - -$filterId = 119; -$collect['filterId'] = $filterId; - -$excludeDeals = int::ENUM_0; -$collect['excludeDeals'] = $excludeDeals; - -$totalsConvertCurrency = 'totals_convert_currency'; -$collect['totalsConvertCurrency'] = $totalsConvertCurrency; - - -$result = $deals->getDealsTimeline($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.deleteADeal") deleteADeal - -> Marks a deal as deleted. - - -```php -function deleteADeal($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | - - - -#### Example Usage - -```php -$id = 119; - -$result = $deals->deleteADeal($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.getDetailsOfADeal") getDetailsOfADeal - -> Returns details of a specific deal. Note that this also returns some additional fields which are not present when asking for all deals – such as deal age and stay in pipeline stages. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of dealFields. For more information on how to get all details of a deal, see this tutorial. - - -```php -function getDetailsOfADeal($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | - - - -#### Example Usage - -```php -$id = 119; - -$result = $deals->getDetailsOfADeal($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.updateADeal") updateADeal - -> Updates the properties of a deal. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for 'key' values. For more information on how to update a deal, see this tutorial. - - -```php -function updateADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| title | ``` Optional ``` | Deal title | -| value | ``` Optional ``` | Value of the deal. If omitted, value will be set to 0. | -| currency | ``` Optional ``` | Currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. | -| user_id | ``` Optional ``` | ID of the user who will be marked as the owner of this deal. If omitted, the authorized user ID will be used. | -| person_id | ``` Optional ``` | ID of the person this deal will be associated with | -| org_id | ``` Optional ``` | ID of the organization this deal will be associated with | -| stage_id | ``` Optional ``` | ID of the stage this deal will be placed in a pipeline (note that you can't supply the ID of the pipeline as this will be assigned automatically based on stage_id). If omitted, the deal will be placed in the first stage of the default pipeline. | -| status | ``` Optional ``` | open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. | -| expected_close_date | ``` Optional ``` | The expected close date of the Deal. In ISO 8601 format: YYYY-MM-DD. | -| probability | ``` Optional ``` | Deal success probability percentage. Used/shown only when deal_probability for the pipeline of the deal is enabled. | -| lost_reason | ``` Optional ``` | Optional message about why the deal was lost (to be used when status=lost) | -| visible_to | ``` Optional ``` | Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
1
Owner & followers (private)
3
Entire company (shared)
| - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$title = 'title'; -$collect['title'] = $title; - -$value = 'value'; -$collect['value'] = $value; - -$currency = 'currency'; -$collect['currency'] = $currency; - -$userId = 27; -$collect['user_id'] = $userId; - -$personId = 27; -$collect['person_id'] = $personId; - -$orgId = 27; -$collect['org_id'] = $orgId; - -$stageId = 27; -$collect['stage_id'] = $stageId; - -$status = string::OPEN; -$collect['status'] = $status; - -$probability = 27.9633801840075; -$collect['probability'] = $probability; - -$lostReason = 'lost_reason'; -$collect['lost_reason'] = $lostReason; - -$visibleTo = int::ENUM_1; -$collect['visible_to'] = $visibleTo; - - -$result = $deals->updateADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listActivitiesAssociatedWithADeal") listActivitiesAssociatedWithADeal - -> Lists activities associated with a deal. - - -```php -function listActivitiesAssociatedWithADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| done | ``` Optional ``` | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. | -| exclude | ``` Optional ``` | A comma-separated string of activity IDs to exclude from result | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - -$done = int::ENUM_0; -$collect['done'] = $done; - -$exclude = 'exclude'; -$collect['exclude'] = $exclude; - - -$deals->listActivitiesAssociatedWithADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.createDuplicateDeal") createDuplicateDeal - -> Duplicate a deal - - -```php -function createDuplicateDeal($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | - - - -#### Example Usage - -```php -$id = 27; - -$result = $deals->createDuplicateDeal($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listFilesAttachedToADeal") listFilesAttachedToADeal - -> Lists files associated with a deal. - - -```php -function listFilesAttachedToADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| includeDeletedFiles | ``` Optional ``` | When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - -$includeDeletedFiles = int::ENUM_0; -$collect['includeDeletedFiles'] = $includeDeletedFiles; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$deals->listFilesAttachedToADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listUpdatesAboutADeal") listUpdatesAboutADeal - -> Lists updates about a deal. - - -```php -function listUpdatesAboutADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - - -$deals->listUpdatesAboutADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listFollowersOfADeal") listFollowersOfADeal - -> Lists the followers of a deal. - - -```php -function listFollowersOfADeal($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | - - - -#### Example Usage - -```php -$id = 27; - -$deals->listFollowersOfADeal($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.addAFollowerToADeal") addAFollowerToADeal - -> Adds a follower to a deal. - - -```php -function addAFollowerToADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| userId | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$userId = 27; -$collect['userId'] = $userId; - - -$result = $deals->addAFollowerToADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.deleteAFollowerFromADeal") deleteAFollowerFromADeal - -> Deletes a follower from a deal. - - -```php -function deleteAFollowerFromADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| followerId | ``` Required ``` | ID of the follower | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$followerId = 27; -$collect['followerId'] = $followerId; - - -$result = $deals->deleteAFollowerFromADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listMailMessagesAssociatedWithADeal") listMailMessagesAssociatedWithADeal - -> Lists mail messages associated with a deal. - - -```php -function listMailMessagesAssociatedWithADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - - -$deals->listMailMessagesAssociatedWithADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.updateMergeTwoDeals") updateMergeTwoDeals - -> Merges a deal with another deal. For more information on how to merge two deals, see this tutorial. - - -```php -function updateMergeTwoDeals($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| mergeWithId | ``` Required ``` | ID of the deal that the deal will be merged with | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$mergeWithId = 27; -$collect['mergeWithId'] = $mergeWithId; - - -$result = $deals->updateMergeTwoDeals($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listParticipantsOfADeal") listParticipantsOfADeal - -> Lists participants associated with a deal. - - -```php -function listParticipantsOfADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - - -$deals->listParticipantsOfADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.addAParticipantToADeal") addAParticipantToADeal - -> Adds a participant to a deal. - - -```php -function addAParticipantToADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| personId | ``` Required ``` | ID of the person | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$personId = 27; -$collect['personId'] = $personId; - - -$deals->addAParticipantToADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.deleteAParticipantFromADeal") deleteAParticipantFromADeal - -> Deletes a participant from a deal. - - -```php -function deleteAParticipantFromADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| dealParticipantId | ``` Required ``` | ID of the deal participant | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$dealParticipantId = 27; -$collect['dealParticipantId'] = $dealParticipantId; - - -$result = $deals->deleteAParticipantFromADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listPermittedUsers") listPermittedUsers - -> List users permitted to access a deal - - -```php -function listPermittedUsers($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | - - - -#### Example Usage - -```php -$id = 27; - -$deals->listPermittedUsers($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listAllPersonsAssociatedWithADeal") listAllPersonsAssociatedWithADeal - -> Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant. - - -```php -function listAllPersonsAssociatedWithADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - - -$deals->listAllPersonsAssociatedWithADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.listProductsAttachedToADeal") listProductsAttachedToADeal - -> Lists products attached to a deal. - - -```php -function listProductsAttachedToADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| includeProductData | ``` Optional ``` | Whether to fetch product data along with each attached product (1) or not (0, default). | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - -$includeProductData = int::ENUM_0; -$collect['includeProductData'] = $includeProductData; - - -$deals->listProductsAttachedToADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct") addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct
_alias_ `addAProductToADeal` - -> Adds a product to the deal. - - -```php -function addAProductToADeal($options); -function addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($options); -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| body | ``` Required ``` | [Body object](https://developers.pipedrive.com/docs/api/v1/Deals#addDealProduct) that has all required body parameters | - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$body = array('key' => 'value'); -$collect['body'] = $body; - -$result = $deals->addAProductToADeal($collect); -// OR -// $result = $deals->addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal") updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal
_alias_ `updateTheProductAttachedToADeal` - -> Updates product attachment details. - - -```php -function updateTheProductAttachedToADeal($options); -function updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($options); -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| productAttachmentId | ``` Required ``` | The ID of the deal-product (the ID of the product attached to the deal) | -| productId | ``` Required ``` | The ID of the product to use | -| itemPrice | ``` Required ``` | Price at which this product will be added to the deal | -| quantity | ``` Required ``` | Quantity – e.g. how many items of this product will be added to the deal | -| discountPercentage | ``` Optional ``` | Discount %. If omitted, will be set to 0 | -| duration | ``` Optional ``` | Duration of the product (when product durations are not enabled for the company or if omitted, defaults to 1) | -| productVariationId | ``` Optional ``` | ID of the product variation to use. When omitted, no variation will be used. | -| comments | ``` Optional ``` | Any textual comment associated with this product-deal attachment. Visible and editable in the application UI. | -| enabledFlag | ``` Optional ``` | Whether the product is enabled on the deal or not. This makes it possible to add products to a deal with specific price and discount criteria - but keep them disabled, which refrains them from being included in deal price calculation. When omitted, the product will be marked as enabled by default. | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$productAttachmentId = 27; -$collect['productAttachmentId'] = $productAttachmentId; - -$productId = 2; -$collect['productId'] = $productId; - -$itemPrice = 27.9633801840075; -$collect['itemPrice'] = $itemPrice; - -$quantity = 27; -$collect['quantity'] = $quantity; - -$discountPercentage = 27.9633801840075; -$collect['discountPercentage'] = $discountPercentage; - -$duration = 27.9633801840075; -$collect['duration'] = $duration; - -$productVariationId = 27; -$collect['productVariationId'] = $productVariationId; - -$comments = 'comments'; -$collect['comments'] = $comments; - -$enabledFlag = int::ENUM_0; -$collect['enabledFlag'] = $enabledFlag; - -$result = $deals->updateTheProductAttachedToADeal($collect); -// OR -// $result = $deals->updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".DealsController.deleteAnAttachedProductFromADeal") deleteAnAttachedProductFromADeal - -> Deletes a product attachment from a deal, using the product_attachment_id. - - -```php -function deleteAnAttachedProductFromADeal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the deal | -| productAttachmentId | ``` Required ``` | Product attachment ID. This is returned as product_attachment_id after attaching a product to a deal or as id when listing the products attached to a deal. | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$productAttachmentId = 27; -$collect['productAttachmentId'] = $productAttachmentId; - - -$result = $deals->deleteAnAttachedProductFromADeal($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".FilesController") FilesController - -### Get singleton instance - -The singleton instance of the ``` FilesController ``` class can be accessed from the API Client. - -```php -$files = $client->getFiles(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.getAllFiles") getAllFiles - -> Returns data about all files. - - -```php -function getAllFiles($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| includeDeletedFiles | ``` Optional ``` | When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. | - - - -#### Example Usage - -```php -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - -$includeDeletedFiles = int::ENUM_0; -$collect['includeDeletedFiles'] = $includeDeletedFiles; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$files->getAllFiles($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.addFile") addFile - -> Lets you upload a file and associate it with Deal, Person, Organization, Activity or Product. For more information on how to add a file, see this tutorial. - - -```php -function addFile($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| file | ``` Required ``` | A single file, supplied in the multipart/form-data encoding and contained within the given boundaries. | -| dealId | ``` Optional ``` | ID of the deal to associate file(s) with | -| personId | ``` Optional ``` | ID of the person to associate file(s) with | -| orgId | ``` Optional ``` | ID of the organization to associate file(s) with | -| productId | ``` Optional ``` | ID of the product to associate file(s) with | -| activityId | ``` Optional ``` | ID of the activity to associate file(s) with | -| noteId | ``` Optional ``` | ID of the note to associate file(s) with | - - - -#### Example Usage - -```php -$file = "PathToFile"; -$collect['file'] = $file; - -$dealId = 27; -$collect['dealId'] = $dealId; - -$personId = 27; -$collect['personId'] = $personId; - -$orgId = 27; -$collect['orgId'] = $orgId; - -$productId = 27; -$collect['productId'] = $productId; - -$activityId = 27; -$collect['activityId'] = $activityId; - -$noteId = 27; -$collect['noteId'] = $noteId; - - -$files->addFile($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.createARemoteFileAndLinkItToAnItem") createARemoteFileAndLinkItToAnItem - -> Creates a new empty file in the remote location (googledrive) that will be linked to the item you supply. For more information on how to add a remote file, see this tutorial. - - -```php -function createARemoteFileAndLinkItToAnItem($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| fileType | ``` Required ``` | The file type | -| title | ``` Required ``` | The title of the file | -| itemType | ``` Required ``` | The item type | -| itemId | ``` Required ``` | ID of the item to associate the file with | -| remoteLocation | ``` Required ``` | The location type to send the file to. Only googledrive is supported at the moment. | - - - -#### Example Usage - -```php -$fileType = string::GDOC; -$collect['fileType'] = $fileType; - -$title = 'title'; -$collect['title'] = $title; - -$itemType = string::DEAL; -$collect['itemType'] = $itemType; - -$itemId = 27; -$collect['itemId'] = $itemId; - -$remoteLocation = string::GOOGLEDRIVE; -$collect['remoteLocation'] = $remoteLocation; - - -$files->createARemoteFileAndLinkItToAnItem($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.createLinkARemoteFileToAnItem") createLinkARemoteFileToAnItem - -> Links an existing remote file (googledrive) to the item you supply. For more information on how to link a remote file, see this tutorial. - - -```php -function createLinkARemoteFileToAnItem($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| itemType | ``` Required ``` | The item type | -| itemId | ``` Required ``` | ID of the item to associate the file with | -| remoteId | ``` Required ``` | The remote item id | -| remoteLocation | ``` Required ``` | The location type to send the file to. Only googledrive is supported at the moment. | - - - -#### Example Usage - -```php -$itemType = string::DEAL; -$collect['itemType'] = $itemType; - -$itemId = 27; -$collect['itemId'] = $itemId; - -$remoteId = 'remote_id'; -$collect['remoteId'] = $remoteId; - -$remoteLocation = string::GOOGLEDRIVE; -$collect['remoteLocation'] = $remoteLocation; - - -$files->createLinkARemoteFileToAnItem($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.deleteAFile") deleteAFile - -> Marks a file as deleted. - - -```php -function deleteAFile($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the file | - - - -#### Example Usage - -```php -$id = 27; - -$files->deleteAFile($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.getOneFile") getOneFile - -> Returns data about a specific file. - - -```php -function getOneFile($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the file | - - - -#### Example Usage - -```php -$id = 27; - -$files->getOneFile($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.updateFileDetails") updateFileDetails - -> Updates the properties of a file. - - -```php -function updateFileDetails($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the file | -| name | ``` Optional ``` | Visible name of the file | -| description | ``` Optional ``` | Description of the file | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$description = 'description'; -$collect['description'] = $description; - - -$files->updateFileDetails($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FilesController.getDownloadOneFile") getDownloadOneFile - -> Initializes a file download. - - -```php -function getDownloadOneFile($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the file | - - - -#### Example Usage - -```php -$id = 27; - -$files->getDownloadOneFile($id); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".FiltersController") FiltersController - -### Get singleton instance - -The singleton instance of the ``` FiltersController ``` class can be accessed from the API Client. - -```php -$filters = $client->getFilters(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.deleteMultipleFiltersInBulk") deleteMultipleFiltersInBulk - -> Marks multiple filters as deleted. - - -```php -function deleteMultipleFiltersInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated filter IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$filters->deleteMultipleFiltersInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.getAllFilters") getAllFilters - -> Returns data about all filters - - -```php -function getAllFilters($type = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| type | ``` Optional ``` | Types of filters to fetch | - - - -#### Example Usage - -```php -$type = string::DEALS; - -$filters->getAllFilters($type); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.addANewFilter") addANewFilter - -> Adds a new filter, returns the ID upon success. Note that in the conditions json object only one first-level condition group is supported, and it must be glued with 'AND', and only two second level condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other combinations do not work (yet) but the syntax supports introducing them in future. For more information on how to add a new filter, see this tutorial. - - -```php -function addANewFilter($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| name | ``` Required ``` | Filter name | -| conditions | ``` Required ``` | Filter conditions as a JSON object. It requires a minimum structure as follows: {"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. Replace CONDITION_OBJECTS with JSON objects of the following structure: {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or leave the array empty. Depending on the object type you should use another API endpoint to get field_id. There are five types of objects you can choose from: "person", "deal", "organization", "product", "activity" and you can use these types of operators depending on what type of a field you have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT LIKE '%$'". To get a better understanding of how filters work try creating them directly from the Pipedrive application. | -| type | ``` Required ``` | Type of filter to create. | - - - -#### Example Usage - -```php -$name = 'name'; -$collect['name'] = $name; - -$conditions = 'conditions'; -$collect['conditions'] = $conditions; - -$type = string::DEALS; -$collect['type'] = $type; - - -$filters->addANewFilter($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.getAllFilterHelpers") getAllFilterHelpers - -> Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information on how filter’s helpers can be used, see this tutorial. - - -```php -function getAllFilterHelpers() -``` - -#### Example Usage - -```php - -$filters->getAllFilterHelpers(); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.deleteAFilter") deleteAFilter - -> Marks a filter as deleted. - - -```php -function deleteAFilter($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the filter | - - - -#### Example Usage - -```php -$id = 27; - -$filters->deleteAFilter($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.getOneFilter") getOneFilter - -> Returns data about a specific filter. Note that this also returns the condition lines of the filter. - - -```php -function getOneFilter($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the filter | - - - -#### Example Usage - -```php -$id = 27; - -$filters->getOneFilter($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".FiltersController.updateFilter") updateFilter - -> Updates existing filter. - - -```php -function updateFilter($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the filter | -| conditions | ``` Required ``` | Filter conditions as a JSON object. It requires a minimum structure as follows: {"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. Replace CONDITION_OBJECTS with JSON objects of the following structure: {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or leave the array empty. Depending on the object type you should use another API endpoint to get field_id. There are five types of objects you can choose from: "person", "deal", "organization", "product", "activity" and you can use these types of operators depending on what type of a field you have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT LIKE '%$'". To get a better understanding of how filters work try creating them directly from the Pipedrive application. | -| name | ``` Optional ``` | Filter name | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$conditions = 'conditions'; -$collect['conditions'] = $conditions; - -$name = 'name'; -$collect['name'] = $name; - - -$filters->updateFilter($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".GlobalMessagesController") GlobalMessagesController - -### Get singleton instance - -The singleton instance of the ``` GlobalMessagesController ``` class can be accessed from the API Client. - -```php -$globalMessages = $client->getGlobalMessages(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".GlobalMessagesController.getGlobalMessages") getGlobalMessages - -> Returns data about global messages to display for the authorized user. - - -```php -function getGlobalMessages($limit = 1) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| limit | ``` Optional ``` ``` DefaultValue ``` | Number of messages to get from 1 to 100. The message number 1 is returned by default. | - - - -#### Example Usage - -```php -$limit = 1; - -$result = $globalMessages->getGlobalMessages($limit); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".GlobalMessagesController.deleteDismissAGlobalMessage") deleteDismissAGlobalMessage - -> Removes global message from being shown, if message is dismissible - - -```php -function deleteDismissAGlobalMessage($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of global message to be dismissed. | - - - -#### Example Usage - -```php -$id = 27; - -$result = $globalMessages->deleteDismissAGlobalMessage($id); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".GoalsController") GoalsController - -### Get singleton instance - -The singleton instance of the ``` GoalsController ``` class can be accessed from the API Client. - -```php -$goals = $client->getGoals(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".GoalsController.addANewGoal") addANewGoal - -> Adds a new goal. - - -```php -function addANewGoal($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$goals->addANewGoal($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".GoalsController.findGoals") findGoals - -> Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. - - -```php -function findGoals($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| typeName | ``` Optional ``` | Type of the goal. If provided, everyone's goals will be returned. | -| title | ``` Optional ``` | Title of the goal. | -| isActive | ``` Optional ``` ``` DefaultValue ``` | Whether goal is active or not. | -| assigneeId | ``` Optional ``` | ID of the user who's goal to fetch. When omitted, only your goals will be returned. | -| assigneeType | ``` Optional ``` | Type of the goal's assignee. If provided, everyone's goals will be returned. | -| expectedOutcomeTarget | ``` Optional ``` | Numeric value of the outcome. If provided, everyone's goals will be returned. | -| expectedOutcomeTrackingMetric | ``` Optional ``` | Tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. | -| expectedOutcomeCurrencyId | ``` Optional ``` | Numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. | -| typeParamsPipelineId | ``` Optional ``` | ID of the pipeline or `null` for all pipelines. If provided, everyone's goals will be returned. | -| typeParamsStageId | ``` Optional ``` | ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. | -| typeParamsActivityTypeId | ``` Optional ``` | ID of the activity type. Applicable to only `activities_completed` or `activities_added` types of goals. If provided, everyone's goals will be returned. | -| periodStart | ``` Optional ``` | Start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. | -| periodEnd | ``` Optional ``` | End date of the period for which to find goals. Date in format of YYYY-MM-DD. | - - - -#### Example Usage - -```php -$typeName = string::DEALS_WON; -$collect['typeName'] = $typeName; - -$title = 'title'; -$collect['title'] = $title; - -$isActive = true; -$collect['isActive'] = $isActive; - -$assigneeId = 27; -$collect['assigneeId'] = $assigneeId; - -$assigneeType = string::PERSON; -$collect['assigneeType'] = $assigneeType; - -$expectedOutcomeTarget = 27.9633801840075; -$collect['expectedOutcomeTarget'] = $expectedOutcomeTarget; - -$expectedOutcomeTrackingMetric = string::QUANTITY; -$collect['expectedOutcomeTrackingMetric'] = $expectedOutcomeTrackingMetric; - -$expectedOutcomeCurrencyId = 27; -$collect['expectedOutcomeCurrencyId'] = $expectedOutcomeCurrencyId; - -$typeParamsPipelineId = 27; -$collect['typeParamsPipelineId'] = $typeParamsPipelineId; - -$typeParamsStageId = 27; -$collect['typeParamsStageId'] = $typeParamsStageId; - -$typeParamsActivityTypeId = 27; -$collect['typeParamsActivityTypeId'] = $typeParamsActivityTypeId; - -$periodStart = date("D M d, Y G:i"); -$collect['periodStart'] = $periodStart; - -$periodEnd = date("D M d, Y G:i"); -$collect['periodEnd'] = $periodEnd; - - -$goals->findGoals($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".GoalsController.updateExistingGoal") updateExistingGoal - -> Updates existing goal. - - -```php -function updateExistingGoal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the goal to be updated. | -| title | ``` Optional ``` | Title of the goal. | -| assignee | ``` Optional ``` | Who is this goal assigned to. It requires the following JSON structure: { "id": "1", "type": "person" }. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. | -| type | ``` Optional ``` | Type of the goal. It requires the following JSON structure: { "name": "deals_started", "params": { "pipeline_id": 1 } }. Type can be one of: `deals_won`,`deals_progressed`,`activities_completed`,`activities_added` or `deals_started`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. To track goal in all pipelines set `pipeline_id` as `null`. | -| expectedOutcome | ``` Optional ``` | Expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: { "target": "50", "tracking_metric": "quantity" } or { "target": "50", "tracking_metric": "sum", "currency_id": 1 }. `currency_id` should only be added to `sum` type of goals. | -| duration | ``` Optional ``` | Date when the goal starts and ends. It requires the following JSON structure: { "start": "2019-01-01", "end": "2022-12-31" }. Date in format of YYYY-MM-DD. | -| interval | ``` Optional ``` | Date when the goal starts and ends. It requires the following JSON structure: { "start": "2019-01-01", "end": "2022-12-31" }. Date in format of YYYY-MM-DD. | - - - -#### Example Usage - -```php -$id = 'id'; -$collect['id'] = $id; - -$title = 'title'; -$collect['title'] = $title; - -$assignee = array('key' => 'value'); -$collect['assignee'] = $assignee; - -$type = array('key' => 'value'); -$collect['type'] = $type; - -$expectedOutcome = array('key' => 'value'); -$collect['expectedOutcome'] = $expectedOutcome; - -$duration = array('key' => 'value'); -$collect['duration'] = $duration; - -$interval = string::WEEKLY; -$collect['interval'] = $interval; - - -$goals->updateExistingGoal($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".GoalsController.deleteExistingGoal") deleteExistingGoal - -> Marks goal as deleted. - - -```php -function deleteExistingGoal($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the goal to be deleted. | - - - -#### Example Usage - -```php -$id = 'id'; - -$goals->deleteExistingGoal($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".GoalsController.getResultOfAGoal") getResultOfAGoal - -> Gets progress of a goal for specified period. - - -```php -function getResultOfAGoal($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the goal that the results are looked for. | -| periodStart | ``` Required ``` | Start date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. | -| periodEnd | ``` Required ``` | End date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. | - - - -#### Example Usage - -```php -$id = 'id'; -$collect['id'] = $id; - -$periodStart = date("D M d, Y G:i"); -$collect['periodStart'] = $periodStart; - -$periodEnd = date("D M d, Y G:i"); -$collect['periodEnd'] = $periodEnd; - - -$goals->getResultOfAGoal($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".ItemSearchController") ItemSearchController - -### Get singleton instance - -The singleton instance of the ```ItemSearchController``` class can be accessed from the API Client. - -```php -$itemSearch = $client->getItemSearch(); -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ItemSearchController.performASearchFromMultipleItemTypes") performASearchFromMultipleItemTypes - -> Perform a search from multiple item types - - -```php -function performASearchFromMultipleItemTypes($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | Search term to look for, minimum 2 characters. | -| itemTypes | ``` Optional ``` | A comma-separated string array. The type of items to perform the search from. Defaults to all. | -| fields | ``` Optional ``` | A comma-separated string array. The fields to perform the search from. Defaults to all. | -| searchForRelatedItems | ``` Optional ``` | When enabled, the response will include up to 100 newest related Leads and 100 newest related Deals for each found Person and Organization and up to 100 newest related Persons for each found Organization. | -| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. It is not case sensitive. | -| includeFields | ``` Optional ``` | A comma-separated string array. Supports including optional fields in the results which are not provided by default.| -| start | ``` Optional ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - -#### Example Usage - -```php -$term = 'term'; -$collect['term'] = $term; - -$results = $itemSearch->performASearchFromMultipleItemTypes($collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ItemSearchController.performASearchUsingASpecificFieldFromAnItemType") performASearchUsingASpecificFieldFromAnItemType - -> Perform a search using a specific field from an item type - - -```php -function performASearchUsingASpecificFieldFromAnItemType($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | The search term to look for. Minimum 2 characters (or 1 if using exact_match). | -| fieldType | ``` Required ``` | The type of the field to perform the search from | -| fieldKey | ``` Required ``` | The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). | -| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. The search is case sensitive. | -| returnItemIds | ``` Optional ``` | Whether to return the IDs of the matching items or not. When not set or set to 0 or false, only distinct values of the searched field are returned. When set to 1 or true, the ID of each found item is returned. | -| start | ``` Optional ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - -#### Example Usage - -```php - -$collect['term'] = 'term'; -$collect['fieldType'] = 'dealField'; -$collect['fieldKey'] = 'title'; - -$results = $itemSearch->performASearchUsingASpecificFieldFromAnItemType($collect); - -``` - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".MailMessagesController") MailMessagesController - -### Get singleton instance - -The singleton instance of the ``` MailMessagesController ``` class can be accessed from the API Client. - -```php -$mailMessages = $client->getMailMessages(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".MailMessagesController.getOneMailMessage") getOneMailMessage - -> Returns data about specific mail message. - - -```php -function getOneMailMessage($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the mail message to fetch. | -| includeBody | ``` Optional ``` | Whether to include full message body or not. 0 = Don't include, 1 = Include | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$includeBody = int::ENUM_0; -$collect['includeBody'] = $includeBody; - - -$result = $mailMessages->getOneMailMessage($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".MailThreadsController") MailThreadsController - -### Get singleton instance - -The singleton instance of the ``` MailThreadsController ``` class can be accessed from the API Client. - -```php -$mailThreads = $client->getMailThreads(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".MailThreadsController.getMailThreads") getMailThreads - -> Returns mail threads in specified folder ordered by most recent message within. - - -```php -function getMailThreads($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| folder | ``` Required ``` ``` DefaultValue ``` | Type of folder to fetch. | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$folder = string::INBOX; -$collect['folder'] = $folder; - -$start = 0; -$collect['start'] = $start; - -$limit = 27; -$collect['limit'] = $limit; - - -$result = $mailThreads->getMailThreads($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".MailThreadsController.deleteMailThread") deleteMailThread - -> Marks mail thread as deleted. - - -```php -function deleteMailThread($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the mail thread | - - - -#### Example Usage - -```php -$id = 27; - -$result = $mailThreads->deleteMailThread($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".MailThreadsController.getOneMailThread") getOneMailThread - -> Returns specific mail thread. - - -```php -function getOneMailThread($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the mail thread | - - - -#### Example Usage - -```php -$id = 27; - -$result = $mailThreads->getOneMailThread($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".MailThreadsController.updateMailThreadDetails") updateMailThreadDetails - -> Updates the properties of a mail thread. - - -```php -function updateMailThreadDetails($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the mail thread | -| dealId | ``` Optional ``` | ID of the deal this thread is associated with | -| sharedFlag | ``` Optional ``` | TODO: Add a parameter description | -| readFlag | ``` Optional ``` | TODO: Add a parameter description | -| archivedFlag | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$id = 27; -$collect['id'] = $id; - -$dealId = 27; -$collect['dealId'] = $dealId; - -$sharedFlag = int::ENUM_0; -$collect['sharedFlag'] = $sharedFlag; - -$readFlag = int::ENUM_0; -$collect['readFlag'] = $readFlag; - -$archivedFlag = int::ENUM_0; -$collect['archivedFlag'] = $archivedFlag; - - -$result = $mailThreads->updateMailThreadDetails($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".MailThreadsController.getAllMailMessagesOfMailThread") getAllMailMessagesOfMailThread - -> Get mail messages inside specified mail thread. - - -```php -function getAllMailMessagesOfMailThread($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the mail thread | - - - -#### Example Usage - -```php -$id = 27; - -$result = $mailThreads->getAllMailMessagesOfMailThread($id); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".NoteFieldsController") NoteFieldsController - -### Get singleton instance - -The singleton instance of the ``` NoteFieldsController ``` class can be accessed from the API Client. - -```php -$noteFields = $client->getNoteFields(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".NoteFieldsController.getAllFieldsForANote") getAllFieldsForANote - -> Return list of all fields for note - - -```php -function getAllFieldsForANote() -``` - -#### Example Usage - -```php - -$noteFields->getAllFieldsForANote(); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".NotesController") NotesController - -### Get singleton instance - -The singleton instance of the ``` NotesController ``` class can be accessed from the API Client. - -```php -$notes = $client->getNotes(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".NotesController.getAllNotes") getAllNotes - -> Returns all notes. - - -```php -function getAllNotes($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| userId | ``` Optional ``` | ID of the user whose notes to fetch. If omitted, notes by all users will be returned. | -| leadId | ``` Optional ``` | ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. | -| dealId | ``` Optional ``` | ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. | -| personId | ``` Optional ``` | ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. | -| orgId | ``` Optional ``` | ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, content, add_time, update_time. | -| startDate | ``` Optional ``` | Date in format of YYYY-MM-DD from which notes to fetch from. | -| endDate | ``` Optional ``` | Date in format of YYYY-MM-DD until which notes to fetch to. | -| pinnedToLeadlFlag | ``` Optional ``` | If set, then results are filtered by note to lead pinning state. | -| pinnedToDealFlag | ``` Optional ``` | If set, then results are filtered by note to deal pinning state. | -| pinnedToOrganizationFlag | ``` Optional ``` | If set, then results are filtered by note to organization pinning state. | -| pinnedToPersonFlag | ``` Optional ``` | If set, then results are filtered by note to person pinning state. | - - - -#### Example Usage - -```php -$userId = 69; -$collect['userId'] = $userId; - -$leadId = 'adf21080-0e10-11eb-879b-05d71fb426ec'; -$collect['leadId'] = $leadId; - -$dealId = 69; -$collect['dealId'] = $dealId; - -$personId = 69; -$collect['personId'] = $personId; - -$orgId = 69; -$collect['orgId'] = $orgId; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - -$sort = 'sort'; -$collect['sort'] = $sort; - -$startDate = date("D M d, Y G:i"); -$collect['startDate'] = $startDate; - -$endDate = date("D M d, Y G:i"); -$collect['endDate'] = $endDate; - -$pinnedToLeadFlag = int::ENUM_0; -$collect['pinnedToLeadFlag'] = $pinnedToLeadFlag; - -$pinnedToDealFlag = int::ENUM_0; -$collect['pinnedToDealFlag'] = $pinnedToDealFlag; - -$pinnedToOrganizationFlag = int::ENUM_0; -$collect['pinnedToOrganizationFlag'] = $pinnedToOrganizationFlag; - -$pinnedToPersonFlag = int::ENUM_0; -$collect['pinnedToPersonFlag'] = $pinnedToPersonFlag; - - -$result = $notes->getAllNotes($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".NotesController.addANote") addANote - -> Adds a new note. - - -```php -function addANote($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| content | ``` Required ``` | Content of the note in HTML format. Subject to sanitization on the back-end. | -| userId | ``` Optional ``` | ID of the user who will be marked as the author of this note. Only an admin can change the author. | -| leadId | ``` Optional ``` | ID of the lead the note will be attached to. | -| dealId | ``` Optional ``` | ID of the deal the note will be attached to. | -| personId | ``` Optional ``` | ID of the person this note will be attached to. | -| orgId | ``` Optional ``` | ID of the organization this note will be attached to. | -| addTime | ``` Optional ``` | Optional creation date & time of the Note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | -| pinnedToLeadFlag | ``` Optional ``` | If set, then results are filtered by note to lead pinning state (lead_id is also required). | -| pinnedToDealFlag | ``` Optional ``` | If set, then results are filtered by note to deal pinning state (deal_id is also required). | -| pinnedToOrganizationFlag | ``` Optional ``` | If set, then results are filtered by note to organization pinning state (org_id is also required). | -| pinnedToPersonFlag | ``` Optional ``` | If set, then results are filtered by note to person pinning state (person_id is also required). | - - - -#### Example Usage - -```php -$content = 'content'; -$collect['content'] = $content; - -$userId = 69; -$collect['userId'] = $userId; - -$leadId = 'adf21080-0e10-11eb-879b-05d71fb426ec'; -$collect['leadId'] = $leadId; - -$dealId = 69; -$collect['dealId'] = $dealId; - -$personId = 69; -$collect['personId'] = $personId; - -$orgId = 69; -$collect['orgId'] = $orgId; - -$addTime = 'add_time'; -$collect['addTime'] = $addTime; - -$pinnedToLeadFlag = int::ENUM_0; -$collect['pinnedToLeadFlag'] = $pinnedToLeadFlag; - -$pinnedToDealFlag = int::ENUM_0; -$collect['pinnedToDealFlag'] = $pinnedToDealFlag; - -$pinnedToOrganizationFlag = int::ENUM_0; -$collect['pinnedToOrganizationFlag'] = $pinnedToOrganizationFlag; - -$pinnedToPersonFlag = int::ENUM_0; -$collect['pinnedToPersonFlag'] = $pinnedToPersonFlag; - - -$result = $notes->addANote($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".NotesController.deleteANote") deleteANote - -> Deletes a specific note. - - -```php -function deleteANote($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the note | - - - -#### Example Usage - -```php -$id = 69; - -$result = $notes->deleteANote($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".NotesController.getOneNote") getOneNote - -> Returns details about a specific note. - - -```php -function getOneNote($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the note | - - - -#### Example Usage - -```php -$id = 69; - -$result = $notes->getOneNote($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".NotesController.updateANote") updateANote - -> Updates a note. - - -```php -function updateANote($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the note | -| content | ``` Required ``` | Content of the note in HTML format. Subject to sanitization on the back-end. | -| userId | ``` Optional ``` | ID of the user who will be marked as the author of this note. Only an admin can change the author. | -| leadId | ``` Optional ``` | ID of the lead the note will be attached to. | -| dealId | ``` Optional ``` | ID of the deal the note will be attached to. | -| personId | ``` Optional ``` | ID of the person this note will be attached to. | -| orgId | ``` Optional ``` | ID of the organization this note will be attached to. | -| addTime | ``` Optional ``` | Optional creation date & time of the Note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | -| pinnedToLeadFlag | ``` Optional ``` | If set, then results are filtered by note to lead pinning state (lead_id is also required). | -| pinnedToDealFlag | ``` Optional ``` | If set, then results are filtered by note to deal pinning state (deal_id is also required). | -| pinnedToOrganizationFlag | ``` Optional ``` | If set, then results are filtered by note to organization pinning state (org_id is also required). | -| pinnedToPersonFlag | ``` Optional ``` | If set, then results are filtered by note to person pinning state (person_id is also required). | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$content = 'content'; -$collect['content'] = $content; - -$userId = 69; -$collect['userId'] = $userId; - -$leadId = 'adf21080-0e10-11eb-879b-05d71fb426ec'; -$collect['leadId'] = $leadId; - -$dealId = 69; -$collect['dealId'] = $dealId; - -$personId = 69; -$collect['personId'] = $personId; - -$orgId = 69; -$collect['orgId'] = $orgId; - -$addTime = 'add_time'; -$collect['addTime'] = $addTime; - -$pinnedToLeadFlag = int::ENUM_0; -$collect['pinnedToLeadFlag'] = $pinnedToLeadFlag; - -$pinnedToDealFlag = int::ENUM_0; -$collect['pinnedToDealFlag'] = $pinnedToDealFlag; - -$pinnedToOrganizationFlag = int::ENUM_0; -$collect['pinnedToOrganizationFlag'] = $pinnedToOrganizationFlag; - -$pinnedToPersonFlag = int::ENUM_0; -$collect['pinnedToPersonFlag'] = $pinnedToPersonFlag; - - -$result = $notes->updateANote($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".OrganizationFieldsController") OrganizationFieldsController - -### Get singleton instance - -The singleton instance of the ``` OrganizationFieldsController ``` class can be accessed from the API Client. - -```php -$organizationFields = $client->getOrganizationFields(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationFieldsController.deleteMultipleOrganizationFieldsInBulk") deleteMultipleOrganizationFieldsInBulk - -> Marks multiple fields as deleted. - - -```php -function deleteMultipleOrganizationFieldsInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated field IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$organizationFields->deleteMultipleOrganizationFieldsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationFieldsController.getAllOrganizationFields") getAllOrganizationFields - -> Returns data about all organization fields - - -```php -function getAllOrganizationFields() -``` - -#### Example Usage - -```php - -$organizationFields->getAllOrganizationFields(); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationFieldsController.addANewOrganizationField") addANewOrganizationField - -> Adds a new organization field. For more information on adding a new custom field, see this tutorial. - - -```php -function addANewOrganizationField($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$organizationFields->addANewOrganizationField($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationFieldsController.deleteAnOrganizationField") deleteAnOrganizationField - -> Marks a field as deleted. For more information on how to delete a custom field, see this tutorial. - - -```php -function deleteAnOrganizationField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - - - -#### Example Usage - -```php -$id = 69; - -$organizationFields->deleteAnOrganizationField($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationFieldsController.getOneOrganizationField") getOneOrganizationField - -> Returns data about a specific organization field. - - -```php -function getOneOrganizationField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - - - -#### Example Usage - -```php -$id = 69; - -$organizationFields->getOneOrganizationField($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationFieldsController.updateAnOrganizationField") updateAnOrganizationField - -> Updates an organization field. See an example of updating custom fields’ values in this tutorial. - - -```php -function updateAnOrganizationField($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | -| name | ``` Required ``` | Name of the field | -| options | ``` Optional ``` | When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{"id":123,"label":"Existing Item"},{"label":"New Item"}] | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$options = 'options'; -$collect['options'] = $options; - - -$organizationFields->updateAnOrganizationField($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".OrganizationRelationshipsController") OrganizationRelationshipsController - -### Get singleton instance - -The singleton instance of the ``` OrganizationRelationshipsController ``` class can be accessed from the API Client. - -```php -$organizationRelationships = $client->getOrganizationRelationships(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationRelationshipsController.getAllRelationshipsForOrganization") getAllRelationshipsForOrganization - -> Gets all of the relationships for a supplied organization id. - - -```php -function getAllRelationshipsForOrganization($orgId) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| orgId | ``` Required ``` | ID of the organization to get relationships for | - - - -#### Example Usage - -```php -$orgId = 69; - -$organizationRelationships->getAllRelationshipsForOrganization($orgId); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationRelationshipsController.createAnOrganizationRelationship") createAnOrganizationRelationship - -> Creates and returns an organization relationship. - - -```php -function createAnOrganizationRelationship($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$organizationRelationships->createAnOrganizationRelationship($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationRelationshipsController.deleteAnOrganizationRelationship") deleteAnOrganizationRelationship - -> Deletes an organization relationship and returns the deleted id. - - -```php -function deleteAnOrganizationRelationship($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization relationship | - - - -#### Example Usage - -```php -$id = 69; - -$organizationRelationships->deleteAnOrganizationRelationship($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationRelationshipsController.getOneOrganizationRelationship") getOneOrganizationRelationship - -> Finds and returns an organization relationship from its ID. - - -```php -function getOneOrganizationRelationship($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization relationship | -| orgId | ``` Optional ``` | ID of the base organization for the returned calculated values | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$orgId = 69; -$collect['orgId'] = $orgId; - - -$organizationRelationships->getOneOrganizationRelationship($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationRelationshipsController.updateAnOrganizationRelationship") updateAnOrganizationRelationship - -> Updates and returns an organization relationship. - - -```php -function updateAnOrganizationRelationship($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization relationship | -| orgId | ``` Optional ``` | ID of the base organization for the returned calculated values | -| type | ``` Optional ``` | The type of organization relationship. | -| relOwnerOrgId | ``` Optional ``` | The owner of this relationship. If type is 'parent', then the owner is the parent and the linked organization is the daughter. | -| relLinkedOrgId | ``` Optional ``` | The linked organization in this relationship. If type is 'parent', then the linked organization is the daughter. | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$orgId = 69; -$collect['orgId'] = $orgId; - -$type = string::PARENT; -$collect['type'] = $type; - -$relOwnerOrgId = 69; -$collect['relOwnerOrgId'] = $relOwnerOrgId; - -$relLinkedOrgId = 69; -$collect['relLinkedOrgId'] = $relLinkedOrgId; - - -$organizationRelationships->updateAnOrganizationRelationship($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".OrganizationsController") OrganizationsController - -### Get singleton instance - -The singleton instance of the ``` OrganizationsController ``` class can be accessed from the API Client. - -```php -$organizations = $client->getOrganizations(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.deleteMultipleOrganizationsInBulk") deleteMultipleOrganizationsInBulk - -> Marks multiple organizations as deleted. - - -```php -function deleteMultipleOrganizationsInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated IDs that will be deleted | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$organizations->deleteMultipleOrganizationsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.getAllOrganizations") getAllOrganizations - -> Returns all organizations - - -```php -function getAllOrganizations($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| userId | ``` Optional ``` | If supplied, only organizations owned by the given user will be returned. | -| filterId | ``` Optional ``` | ID of the filter to use | -| firstChar | ``` Optional ``` | If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive). | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). | - - - -#### Example Usage - -```php -$userId = 69; -$collect['userId'] = $userId; - -$filterId = 69; -$collect['filterId'] = $filterId; - -$firstChar = 'first_char'; -$collect['firstChar'] = $firstChar; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$organizations->getAllOrganizations($collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.searchOrganizations") searchOrganizations - -> Searches all Organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - - -```php -function searchOrganizations($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | The search term to look for. Minimum 2 characters (or 1 if using exact_match). | -| fields | ``` Optional ``` | A comma-separated string array. The fields to perform the search from. Defaults to all of them. | -| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. It is not case sensitive. | -| start | ``` Optional ``` | Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. | -| limit | ``` Optional ``` | Items shown per page | - - -#### Example Usage - -```php -$term = 'term'; -$collect['term'] = $term; - -$results = $organizations->searchOrganizations($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.addAnOrganization") addAnOrganization - -> Adds a new organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for 'key' values. For more information on how to add an organization, see this tutorial. - - -```php -function addAnOrganization($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$organizations->addAnOrganization($body); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.deleteAnOrganization") deleteAnOrganization - -> Marks an organization as deleted. - - -```php -function deleteAnOrganization($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | - - - -#### Example Usage - -```php -$id = 69; - -$organizations->deleteAnOrganization($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.getDetailsOfAnOrganization") getDetailsOfAnOrganization - -> Returns details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of organizationFields. - - -```php -function getDetailsOfAnOrganization($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | - - - -#### Example Usage - -```php -$id = 69; - -$organizations->getDetailsOfAnOrganization($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.updateAnOrganization") updateAnOrganization - -> Updates the properties of an organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for 'key' values. - - -```php -function updateAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| name | ``` Optional ``` | Organization name | -| ownerId | ``` Optional ``` | ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. | -| visibleTo | ``` Optional ``` | Visibility of the organization. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
1
Owner & followers (private)
3
Entire company (shared)
| - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$ownerId = 69; -$collect['ownerId'] = $ownerId; - -$visibleTo = int::ENUM_1; -$collect['visibleTo'] = $visibleTo; - - -$organizations->updateAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listActivitiesAssociatedWithAnOrganization") listActivitiesAssociatedWithAnOrganization - -> Lists activities associated with an organization. - - -```php -function listActivitiesAssociatedWithAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| done | ``` Optional ``` | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. | -| exclude | ``` Optional ``` | A comma-separated string of activity IDs to exclude from result | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - -$done = int::ENUM_0; -$collect['done'] = $done; - -$exclude = 'exclude'; -$collect['exclude'] = $exclude; - - -$organizations->listActivitiesAssociatedWithAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listDealsAssociatedWithAnOrganization") listDealsAssociatedWithAnOrganization - -> Lists deals associated with an organization. - - -```php -function listDealsAssociatedWithAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| status | ``` Optional ``` ``` DefaultValue ``` | Only fetch deals with specific status. If omitted, all not deleted deals are fetched. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). | -| onlyPrimaryAssociation | ``` Optional ``` | If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - -$status = string::ALL_NOT_DELETED; -$collect['status'] = $status; - -$sort = 'sort'; -$collect['sort'] = $sort; - -$onlyPrimaryAssociation = int::ENUM_0; -$collect['onlyPrimaryAssociation'] = $onlyPrimaryAssociation; - - -$organizations->listDealsAssociatedWithAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listFilesAttachedToAnOrganization") listFilesAttachedToAnOrganization - -> Lists files associated with an organization. - - -```php -function listFilesAttachedToAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| includeDeletedFiles | ``` Optional ``` | When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - -$includeDeletedFiles = int::ENUM_0; -$collect['includeDeletedFiles'] = $includeDeletedFiles; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$organizations->listFilesAttachedToAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listUpdatesAboutAnOrganization") listUpdatesAboutAnOrganization - -> Lists updates about an organization. - - -```php -function listUpdatesAboutAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - - -$organizations->listUpdatesAboutAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listFollowersOfAnOrganization") listFollowersOfAnOrganization - -> Lists the followers of an organization. - - -```php -function listFollowersOfAnOrganization($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | - - - -#### Example Usage - -```php -$id = 69; - -$organizations->listFollowersOfAnOrganization($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.addAFollowerToAnOrganization") addAFollowerToAnOrganization - -> Adds a follower to an organization. - - -```php -function addAFollowerToAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| userId | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$userId = 69; -$collect['userId'] = $userId; - - -$organizations->addAFollowerToAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.deleteAFollowerFromAnOrganization") deleteAFollowerFromAnOrganization - -> Deletes a follower from an organization. You can retrieve the follower_id from the List followers of an organization endpoint. - - -```php -function deleteAFollowerFromAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| followerId | ``` Required ``` | ID of the follower | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$followerId = 69; -$collect['followerId'] = $followerId; - - -$organizations->deleteAFollowerFromAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listMailMessagesAssociatedWithAnOrganization") listMailMessagesAssociatedWithAnOrganization - -> Lists mail messages associated with an organization. - - -```php -function listMailMessagesAssociatedWithAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - - -$organizations->listMailMessagesAssociatedWithAnOrganization($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.updateMergeTwoOrganizations") updateMergeTwoOrganizations - -> Merges an organization with another organization. For more information on how to merge two organizations, see this tutorial. - - -```php -function updateMergeTwoOrganizations($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| mergeWithId | ``` Required ``` | ID of the organization that the organization will be merged with | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$mergeWithId = 69; -$collect['mergeWithId'] = $mergeWithId; - - -$organizations->updateMergeTwoOrganizations($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listPermittedUsers") listPermittedUsers - -> List users permitted to access an organization - - -```php -function listPermittedUsers($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | - - - -#### Example Usage - -```php -$id = 69; - -$organizations->listPermittedUsers($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.listPersonsOfAnOrganization") listPersonsOfAnOrganization - -> Lists persons associated with an organization. - - -```php -function listPersonsOfAnOrganization($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the organization | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - - -$organizations->listPersonsOfAnOrganization($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".PermissionSetsController") PermissionSetsController - -### Get singleton instance - -The singleton instance of the ``` PermissionSetsController ``` class can be accessed from the API Client. - -```php -$permissionSets = $client->getPermissionSets(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".PermissionSetsController.getAllPermissionSets") getAllPermissionSets - -> Get all Permission Sets - - -```php -function getAllPermissionSets() -``` - -#### Example Usage - -```php - -$result = $permissionSets->getAllPermissionSets(); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 404 | If the User ID has no assignments, then it will return NotFound | - - - -### ![Method: ](https://apidocs.io/img/method.png ".PermissionSetsController.getOnePermissionSet") getOnePermissionSet - -> Get one Permission Set - - -```php -function getOnePermissionSet($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the permission set | - - - -#### Example Usage - -```php -$id = 69; - -$result = $permissionSets->getOnePermissionSet($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 404 | If the User ID has no assignments, then it will return NotFound | - - - -### ![Method: ](https://apidocs.io/img/method.png ".PermissionSetsController.listPermissionSetAssignments") listPermissionSetAssignments - -> The list of assignments for a Permission Set - - -```php -function listPermissionSetAssignments($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the permission set | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - - -$result = $permissionSets->listPermissionSetAssignments($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 404 | If the User ID has no assignments, then it will return NotFound | - - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".PersonFieldsController") PersonFieldsController - -### Get singleton instance - -The singleton instance of the ``` PersonFieldsController ``` class can be accessed from the API Client. - -```php -$personFields = $client->getPersonFields(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".PersonFieldsController.deleteMultiplePersonFieldsInBulk") deleteMultiplePersonFieldsInBulk - -> Marks multiple fields as deleted. - - -```php -function deleteMultiplePersonFieldsInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated field IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$personFields->deleteMultiplePersonFieldsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonFieldsController.getAllPersonFields") getAllPersonFields - -> Returns data about all person fields - - -```php -function getAllPersonFields() -``` -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - -#### Example Usage - -```php -$start = 0; -$collect['start'] = $start; - -$limit = 69; -$collect['limit'] = $limit; - -$personFields->getAllPersonFields($collect); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".PersonFieldsController.addANewPersonField") addANewPersonField - -> Adds a new person field. For more information on adding a new custom field, see this tutorial. - - -```php -function addANewPersonField($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$personFields->addANewPersonField($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonFieldsController.deleteAPersonField") deleteAPersonField - -> Marks a field as deleted. For more information on how to delete a custom field, see this tutorial. - - -```php -function deleteAPersonField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - - - -#### Example Usage - -```php -$id = 69; - -$personFields->deleteAPersonField($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonFieldsController.getOnePersonField") getOnePersonField - -> Returns data about a specific person field. - - -```php -function getOnePersonField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | - - - -#### Example Usage - -```php -$id = 69; - -$personFields->getOnePersonField($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonFieldsController.updateAPersonField") updateAPersonField - -> Updates a person field. See an example of updating custom fields’ values in this tutorial. - - -```php -function updateAPersonField($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the field | -| name | ``` Required ``` | Name of the field | -| options | ``` Optional ``` | When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{"id":123,"label":"Existing Item"},{"label":"New Item"}] | - - - -#### Example Usage - -```php -$id = 69; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$options = 'options'; -$collect['options'] = $options; - - -$personFields->updateAPersonField($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".PersonsController") PersonsController - -### Get singleton instance - -The singleton instance of the ``` PersonsController ``` class can be accessed from the API Client. - -```php -$persons = $client->getPersons(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.deleteMultiplePersonsInBulk") deleteMultiplePersonsInBulk - -> Marks multiple persons as deleted. - - -```php -function deleteMultiplePersonsInBulk($ids = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Optional ``` | Comma-separated IDs that will be deleted | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$persons->deleteMultiplePersonsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.getAllPersons") getAllPersons - -> Returns all persons - - -```php -function getAllPersons($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| userId | ``` Optional ``` | If supplied, only persons owned by the given user will be returned. | -| filterId | ``` Optional ``` | ID of the filter to use. | -| firstChar | ``` Optional ``` | If supplied, only persons whose name starts with the specified letter will be returned (case insensitive). | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). | - - - -#### Example Usage - -```php -$userId = 233; -$collect['userId'] = $userId; - -$filterId = 233; -$collect['filterId'] = $filterId; - -$firstChar = 'first_char'; -$collect['firstChar'] = $firstChar; - -$start = 0; -$collect['start'] = $start; - -$limit = 233; -$collect['limit'] = $limit; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$persons->getAllPersons($collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.searchPersons") searchPersons - -> Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found Persons can be filtered by Organization ID. - - -```php -function searchPersons($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | The search term to look for. Minimum 2 characters (or 1 if using exact_match). | -| fields | ``` Optional ``` | A comma-separated string array. The fields to perform the search from. Defaults to all of them. | -| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. It is not case sensitive. | -| organizationId | ``` Optional ``` | Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. | -| includeFields | ``` Optional ``` | Supports including optional fields in the results which are not provided by default. | -| start | ``` Optional ``` | Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. | -| limit | ``` Optional ``` | Items shown per page | - - -#### Example Usage - -```php -$term = 'term'; -$collect['term'] = $term; - -$results = $persons->searchPersons($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.addAPerson") addAPerson - -> Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for 'key' values. - - -```php -function addAPerson($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$persons->addAPerson($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.deleteAPerson") deleteAPerson - -> Marks a person as deleted. - - -```php -function deleteAPerson($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | - - - -#### Example Usage - -```php -$id = 233; - -$persons->deleteAPerson($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.getDetailsOfAPerson") getDetailsOfAPerson - -> Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of personFields. - - -```php -function getDetailsOfAPerson($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | - - - -#### Example Usage - -```php -$id = 233; - -$persons->getDetailsOfAPerson($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.updateAPerson") updateAPerson - -> Updates the properties of a person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for 'key' values. For more information on how to update a person, see this tutorial. - - -```php -function updateAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| name | ``` Optional ``` | Person name | -| ownerId | ``` Optional ``` | ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. | -| orgId | ``` Optional ``` | ID of the organization this person will belong to. | -| email | ``` Optional ``` ``` Collection ``` | Email addresses (one or more) associated with the person, presented in the same manner as received by GET request of a person. | -| phone | ``` Optional ``` ``` Collection ``` | Phone numbers (one or more) associated with the person, presented in the same manner as received by GET request of a person. | -| visibleTo | ``` Optional ``` | Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
1
Owner & followers (private)
3
Entire company (shared)
| - - - -#### Example Usage - -```php -$id = 233; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$ownerId = 233; -$collect['ownerId'] = $ownerId; - -$orgId = 233; -$collect['orgId'] = $orgId; - -$email = array('email'); -$collect['email'] = $email; - -$phone = array('phone'); -$collect['phone'] = $phone; - -$visibleTo = int::ENUM_1; -$collect['visibleTo'] = $visibleTo; - - -$persons->updateAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listActivitiesAssociatedWithAPerson") listActivitiesAssociatedWithAPerson - -> Lists activities associated with a person. - - -```php -function listActivitiesAssociatedWithAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| done | ``` Optional ``` | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. | -| exclude | ``` Optional ``` | A comma-separated string of activity IDs to exclude from result | - - - -#### Example Usage - -```php -$id = 233; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 233; -$collect['limit'] = $limit; - -$done = int::ENUM_0; -$collect['done'] = $done; - -$exclude = 'exclude'; -$collect['exclude'] = $exclude; - - -$persons->listActivitiesAssociatedWithAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listDealsAssociatedWithAPerson") listDealsAssociatedWithAPerson - -> Lists deals associated with a person. - - -```php -function listDealsAssociatedWithAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| status | ``` Optional ``` ``` DefaultValue ``` | Only fetch deals with specific status. If omitted, all not deleted deals are fetched. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). | - - - -#### Example Usage - -```php -$id = 233; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 233; -$collect['limit'] = $limit; - -$status = string::ALL_NOT_DELETED; -$collect['status'] = $status; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$persons->listDealsAssociatedWithAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listFilesAttachedToAPerson") listFilesAttachedToAPerson - -> Lists files associated with a person. - - -```php -function listFilesAttachedToAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| includeDeletedFiles | ``` Optional ``` | When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. | - - - -#### Example Usage - -```php -$id = 233; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 233; -$collect['limit'] = $limit; - -$includeDeletedFiles = int::ENUM_0; -$collect['includeDeletedFiles'] = $includeDeletedFiles; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$persons->listFilesAttachedToAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listUpdatesAboutAPerson") listUpdatesAboutAPerson - -> Lists updates about a person. - - -```php -function listUpdatesAboutAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 233; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 233; -$collect['limit'] = $limit; - - -$persons->listUpdatesAboutAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listFollowersOfAPerson") listFollowersOfAPerson - -> Lists the followers of a person. - - -```php -function listFollowersOfAPerson($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | - - - -#### Example Usage - -```php -$id = 233; - -$persons->listFollowersOfAPerson($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.addAFollowerToAPerson") addAFollowerToAPerson - -> Adds a follower to a person. - - -```php -function addAFollowerToAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| userId | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$userId = 19; -$collect['userId'] = $userId; - - -$persons->addAFollowerToAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.deletesAFollowerFromAPerson") deletesAFollowerFromAPerson - -> Delete a follower from a person - - -```php -function deletesAFollowerFromAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| followerId | ``` Required ``` | ID of the follower | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$followerId = 19; -$collect['followerId'] = $followerId; - - -$persons->deletesAFollowerFromAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listMailMessagesAssociatedWithAPerson") listMailMessagesAssociatedWithAPerson - -> Lists mail messages associated with a person. - - -```php -function listMailMessagesAssociatedWithAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$persons->listMailMessagesAssociatedWithAPerson($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.updateMergeTwoPersons") updateMergeTwoPersons - -> Merges a person with another person. For more information on how to merge two persons, see this tutorial. - - -```php -function updateMergeTwoPersons($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| mergeWithId | ``` Required ``` | ID of the person that the person will be merged with | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$mergeWithId = 19; -$collect['mergeWithId'] = $mergeWithId; - - -$persons->updateMergeTwoPersons($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listPermittedUsers") listPermittedUsers - -> List users permitted to access a person - - -```php -function listPermittedUsers($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | - - - -#### Example Usage - -```php -$id = 19; - -$persons->listPermittedUsers($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.deletePersonPicture") deletePersonPicture - -> Delete person picture - - -```php -function deletePersonPicture($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | - - - -#### Example Usage - -```php -$id = 19; - -$persons->deletePersonPicture($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.addPersonPicture") addPersonPicture - -> Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. - - -```php -function addPersonPicture($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| file | ``` Required ``` | One image supplied in the multipart/form-data encoding. | -| cropX | ``` Optional ``` | X coordinate to where start cropping form (in pixels) | -| cropY | ``` Optional ``` | Y coordinate to where start cropping form (in pixels) | -| cropWidth | ``` Optional ``` | Width of cropping area (in pixels) | -| cropHeight | ``` Optional ``` | Height of cropping area (in pixels) | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$file = "PathToFile"; -$collect['file'] = $file; - -$cropX = 19; -$collect['cropX'] = $cropX; - -$cropY = 19; -$collect['cropY'] = $cropY; - -$cropWidth = 19; -$collect['cropWidth'] = $cropWidth; - -$cropHeight = 19; -$collect['cropHeight'] = $cropHeight; - - -$persons->addPersonPicture($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PersonsController.listProductsAssociatedWithAPerson") listProductsAssociatedWithAPerson - -> Lists products associated with a person. - - -```php -function listProductsAssociatedWithAPerson($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of a person | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$persons->listProductsAssociatedWithAPerson($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".PipelinesController") PipelinesController - -### Get singleton instance - -The singleton instance of the ``` PipelinesController ``` class can be accessed from the API Client. - -```php -$pipelines = $client->getPipelines(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.getAllPipelines") getAllPipelines - -> Returns data about all pipelines - - -```php -function getAllPipelines() -``` - -#### Example Usage - -```php - -$pipelines->getAllPipelines(); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.addANewPipeline") addANewPipeline - -> Adds a new pipeline - - -```php -function addANewPipeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| name | ``` Optional ``` | Name of the pipeline | -| dealProbability | ``` Optional ``` | TODO: Add a parameter description | -| orderNr | ``` Optional ``` | Defines pipelines order. First order(order_nr=0) is the default pipeline. | -| active | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$name = 'name'; -$collect['name'] = $name; - -$dealProbability = int::ENUM_0; -$collect['dealProbability'] = $dealProbability; - -$orderNr = 19; -$collect['orderNr'] = $orderNr; - -$active = int::ENUM_0; -$collect['active'] = $active; - - -$pipelines->addANewPipeline($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.deleteAPipeline") deleteAPipeline - -> Marks a pipeline as deleted. - - -```php -function deleteAPipeline($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the pipeline | - - - -#### Example Usage - -```php -$id = 19; - -$pipelines->deleteAPipeline($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.getOnePipeline") getOnePipeline - -> Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages. - - -```php -function getOnePipeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the pipeline | -| totalsConvertCurrency | ``` Optional ``` | 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$totalsConvertCurrency = 'totals_convert_currency'; -$collect['totalsConvertCurrency'] = $totalsConvertCurrency; - - -$pipelines->getOnePipeline($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.updateEditAPipeline") updateEditAPipeline - -> Updates pipeline properties - - -```php -function updateEditAPipeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the pipeline | -| name | ``` Optional ``` | Name of the pipeline | -| dealProbability | ``` Optional ``` | TODO: Add a parameter description | -| orderNr | ``` Optional ``` | Defines pipelines order. First order(order_nr=0) is the default pipeline. | -| active | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$dealProbability = int::ENUM_0; -$collect['dealProbability'] = $dealProbability; - -$orderNr = 19; -$collect['orderNr'] = $orderNr; - -$active = int::ENUM_0; -$collect['active'] = $active; - - -$pipelines->updateEditAPipeline($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.getDealsConversionRatesInPipeline") getDealsConversionRatesInPipeline - -> Returns all stage-to-stage conversion and pipeline-to-close rates for given time period. - - -```php -function getDealsConversionRatesInPipeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the pipeline | -| startDate | ``` Required ``` | Start of the period. Date in format of YYYY-MM-DD. | -| endDate | ``` Required ``` | End of the period. Date in format of YYYY-MM-DD. | -| userId | ``` Optional ``` | ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$startDate = date("D M d, Y G:i"); -$collect['startDate'] = $startDate; - -$endDate = date("D M d, Y G:i"); -$collect['endDate'] = $endDate; - -$userId = 19; -$collect['userId'] = $userId; - - -$pipelines->getDealsConversionRatesInPipeline($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.getDealsInAPipeline") getDealsInAPipeline - -> Lists deals in a specific pipeline across all its stages - - -```php -function getDealsInAPipeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the pipeline | -| filterId | ``` Optional ``` | If supplied, only deals matching the given filter will be returned. | -| userId | ``` Optional ``` | If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. | -| everyone | ``` Optional ``` | If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. | -| stageId | ``` Optional ``` | If supplied, only deals within the given stage will be returned. | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| getSummary | ``` Optional ``` | Whether to include summary of the pipeline in the additional_data or not. | -| totalsConvertCurrency | ``` Optional ``` | 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. Only works when get_summary parameter flag is enabled. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$filterId = 19; -$collect['filterId'] = $filterId; - -$userId = 19; -$collect['userId'] = $userId; - -$everyone = int::ENUM_0; -$collect['everyone'] = $everyone; - -$stageId = 19; -$collect['stageId'] = $stageId; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - -$getSummary = int::ENUM_0; -$collect['getSummary'] = $getSummary; - -$totalsConvertCurrency = 'totals_convert_currency'; -$collect['totalsConvertCurrency'] = $totalsConvertCurrency; - - -$pipelines->getDealsInAPipeline($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".PipelinesController.getDealsMovementsInPipeline") getDealsMovementsInPipeline - -> Returns statistics for deals movements for given time period. - - -```php -function getDealsMovementsInPipeline($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the pipeline | -| startDate | ``` Required ``` | Start of the period. Date in format of YYYY-MM-DD. | -| endDate | ``` Required ``` | End of the period. Date in format of YYYY-MM-DD. | -| userId | ``` Optional ``` | ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$startDate = date("D M d, Y G:i"); -$collect['startDate'] = $startDate; - -$endDate = date("D M d, Y G:i"); -$collect['endDate'] = $endDate; - -$userId = 19; -$collect['userId'] = $userId; - - -$pipelines->getDealsMovementsInPipeline($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".ProductFieldsController") ProductFieldsController - -### Get singleton instance - -The singleton instance of the ``` ProductFieldsController ``` class can be accessed from the API Client. - -```php -$productFields = $client->getProductFields(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ProductFieldsController.deleteMultipleProductFieldsInBulk") deleteMultipleProductFieldsInBulk - -> Marks multiple fields as deleted. - - -```php -function deleteMultipleProductFieldsInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated field IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$result = $productFields->deleteMultipleProductFieldsInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductFieldsController.getAllProductFields") getAllProductFields - -> Returns data about all product fields - - -```php -function getAllProductFields() -``` - -#### Example Usage - -```php - -$result = $productFields->getAllProductFields(); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductFieldsController.addANewProductField") addANewProductField - -> Adds a new product field. For more information on adding a new custom field, see this tutorial. - - -```php -function addANewProductField($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$result = $productFields->addANewProductField($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductFieldsController.deleteAProductField") deleteAProductField - -> Marks a field as deleted. For more information on how to delete a custom field, see this tutorial. - - -```php -function deleteAProductField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the Product Field | - - - -#### Example Usage - -```php -$id = 19; - -$result = $productFields->deleteAProductField($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 410 | The Product Field with the specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductFieldsController.getOneProductField") getOneProductField - -> Returns data about a specific product field. - - -```php -function getOneProductField($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the Product Field | - - - -#### Example Usage - -```php -$id = 19; - -$result = $productFields->getOneProductField($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 410 | The Product Field with the specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductFieldsController.updateAProductField") updateAProductField - -> Updates a product field. See an example of updating custom fields’ values in this tutorial. - - -```php -function updateAProductField($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the Product Field | -| name | ``` Required ``` | Name of the field | -| options | ``` Optional ``` | When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array, for example: ["red","blue","lilac"] | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$options = 'options'; -$collect['options'] = $options; - - -$result = $productFields->updateAProductField($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".ProductsController") ProductsController - -### Get singleton instance - -The singleton instance of the ``` ProductsController ``` class can be accessed from the API Client. - -```php -$products = $client->getProducts(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.getAllProducts") getAllProducts - -> Returns data about all products. - - -```php -function getAllProducts($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| userId | ``` Optional ``` | If supplied, only products owned by the given user will be returned. | -| filterId | ``` Optional ``` | ID of the filter to use | -| firstChar | ``` Optional ``` | If supplied, only products whose name starts with the specified letter will be returned (case insensitive). | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$userId = 19; -$collect['userId'] = $userId; - -$filterId = 19; -$collect['filterId'] = $filterId; - -$firstChar = 'first_char'; -$collect['firstChar'] = $firstChar; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$result = $products->getAllProducts($collect); - -``` - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.searchProducts") searchProducts - -> Searches all Products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - - -```php -function searchProducts($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | The search term to look for. Minimum 2 characters (or 1 if using exact_match). | -| fields | ``` Optional ``` | A comma-separated string array. The fields to perform the search from. Defaults to all of them. | -| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. It is not case sensitive. | -| includeFields | ``` Optional ``` | Supports including optional fields in the results which are not provided by default. | -| start | ``` Optional ``` | Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. | -| limit | ``` Optional ``` | Items shown per page | - - -#### Example Usage - -```php -$term = 'term'; -$collect['term'] = $term; - -$results = $products->searchProducts($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.addAProduct") addAProduct - -> Adds a new product to the products inventory. For more information on how to add a product, see this tutorial. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the productFields and look for 'key' values. - - -```php -function addAProduct($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$products->addAProduct($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.deleteAProduct") deleteAProduct - -> Marks a product as deleted. - - -```php -function deleteAProduct($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | - - - -#### Example Usage - -```php -$id = 19; - -$products->deleteAProduct($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.getOneProduct") getOneProduct - -> Returns data about a specific product. - - -```php -function getOneProduct($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | - - - -#### Example Usage - -```php -$id = 19; - -$products->getOneProduct($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.updateAProduct") updateAProduct - -> Updates product data. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the productFields and look for 'key' values. - - -```php -function updateAProduct($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | -| name | ``` Optional ``` | Name of the product. | -| code | ``` Optional ``` | Product code. | -| unit | ``` Optional ``` | Unit in which this product is sold | -| tax | ``` Optional ``` | Tax percentage | -| activeFlag | ``` Optional ``` | Whether this product will be made active or not. | -| visibleTo | ``` Optional ``` | Visibility of the product. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
1
Owner & followers (private)
3
Entire company (shared)
| -| ownerId | ``` Optional ``` | ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. | -| prices | ``` Optional ``` | Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional). Note that there can only be one price per product per currency. When 'prices' is omitted altogether, no prices will be set up for the product. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$name = 'name'; -$collect['name'] = $name; - -$code = 'code'; -$collect['code'] = $code; - -$unit = 'unit'; -$collect['unit'] = $unit; - -$tax = 19.9144447454784; -$collect['tax'] = $tax; - -$activeFlag = int::ENUM_0; -$collect['activeFlag'] = $activeFlag; - -$visibleTo = int::ENUM_1; -$collect['visibleTo'] = $visibleTo; - -$ownerId = 19; -$collect['ownerId'] = $ownerId; - -$prices = 'prices'; -$collect['prices'] = $prices; - - -$result = $products->updateAProduct($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.getDealsWhereAProductIsAttachedTo") getDealsWhereAProductIsAttachedTo - -> Returns data about deals that have a product attached to. - - -```php -function getDealsWhereAProductIsAttachedTo($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| status | ``` Optional ``` ``` DefaultValue ``` | Only fetch deals with specific status. If omitted, all not deleted deals are fetched. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - -$status = string::ALL_NOT_DELETED; -$collect['status'] = $status; - - -$result = $products->getDealsWhereAProductIsAttachedTo($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.listFilesAttachedToAProduct") listFilesAttachedToAProduct - -> Lists files associated with a product. - - -```php -function listFilesAttachedToAProduct($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | -| includeDeletedFiles | ``` Optional ``` | When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. | -| sort | ``` Optional ``` | Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - -$includeDeletedFiles = int::ENUM_0; -$collect['includeDeletedFiles'] = $includeDeletedFiles; - -$sort = 'sort'; -$collect['sort'] = $sort; - - -$products->listFilesAttachedToAProduct($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.listFollowersOfAProduct") listFollowersOfAProduct - -> Lists the followers of a Product - - -```php -function listFollowersOfAProduct($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | - - - -#### Example Usage - -```php -$id = 19; - -$result = $products->listFollowersOfAProduct($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.addAFollowerToAProduct") addAFollowerToAProduct - -> Adds a follower to a product. - - -```php -function addAFollowerToAProduct($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | -| userId | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$userId = 19; -$collect['userId'] = $userId; - - -$result = $products->addAFollowerToAProduct($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.deleteAFollowerFromAProduct") deleteAFollowerFromAProduct - -> Deletes a follower from a product. - - -```php -function deleteAFollowerFromAProduct($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | -| followerId | ``` Required ``` | ID of the follower | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$followerId = 19; -$collect['followerId'] = $followerId; - - -$result = $products->deleteAFollowerFromAProduct($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".ProductsController.listPermittedUsers") listPermittedUsers - -> Lists users permitted to access a product. - - -```php -function listPermittedUsers($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the product | - - - -#### Example Usage - -```php -$id = 19; - -$result = $products->listPermittedUsers($id); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".RecentsController") RecentsController - -### Get singleton instance - -The singleton instance of the ``` RecentsController ``` class can be accessed from the API Client. - -```php -$recents = $client->getRecents(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".RecentsController.getRecents") getRecents - -> Returns data about all recent changes occured after given timestamp. - - -```php -function getRecents($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| sinceTimestamp | ``` Required ``` | Timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS | -| items | ``` Optional ``` | Multiple selection of item types to include in query (optional) | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$sinceTimestamp = 'since_timestamp'; -$collect['sinceTimestamp'] = $sinceTimestamp; - -$items = string::ACTIVITY; -$collect['items'] = $items; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$recents->getRecents($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".RolesController") RolesController - -### Get singleton instance - -The singleton instance of the ``` RolesController ``` class can be accessed from the API Client. - -```php -$roles = $client->getRoles(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.getAllRoles") getAllRoles - -> Get all roles - - -```php -function getAllRoles($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$result = $roles->getAllRoles($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.addARole") addARole - -> Add a role - - -```php -function addARole($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$result = $roles->addARole($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.deleteARole") deleteARole - -> Delete a role - - -```php -function deleteARole($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | - - - -#### Example Usage - -```php -$id = 19; - -$result = $roles->deleteARole($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.getOneRole") getOneRole - -> Get one role - - -```php -function getOneRole($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | - - - -#### Example Usage - -```php -$id = 19; - -$result = $roles->getOneRole($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.updateRoleDetails") updateRoleDetails - -> Update role details - - -```php -function updateRoleDetails($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | -| parentRoleId | ``` Optional ``` | The ID of the parent Role | -| name | ``` Optional ``` | The name of the Role | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$parentRoleId = 19; -$collect['parentRoleId'] = $parentRoleId; - -$name = 'name'; -$collect['name'] = $name; - - -$result = $roles->updateRoleDetails($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.deleteARoleAssignment") deleteARoleAssignment - -> Delete assignment from a role - - -```php -function deleteARoleAssignment($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | -| userId | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$userId = 19; -$collect['userId'] = $userId; - - -$result = $roles->deleteARoleAssignment($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.listRoleAssignments") listRoleAssignments - -> List assignments for a role - - -```php -function listRoleAssignments($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$result = $roles->listRoleAssignments($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.addRoleAssignment") addRoleAssignment - -> Add assignment for a role - - -```php -function addRoleAssignment($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | -| userId | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$userId = 19; -$collect['userId'] = $userId; - - -$result = $roles->addRoleAssignment($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.listRoleSubRoles") listRoleSubRoles - -> List role sub-roles - - -```php -function listRoleSubRoles($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$result = $roles->listRoleSubRoles($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.listRoleSettings") listRoleSettings - -> List role settings - - -```php -function listRoleSettings($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | - - - -#### Example Usage - -```php -$id = 19; - -$result = $roles->listRoleSettings($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".RolesController.addOrUpdateRoleSetting") addOrUpdateRoleSetting - -> Add or update role setting - - -```php -function addOrUpdateRoleSetting($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the role | -| settingKey | ``` Required ``` | TODO: Add a parameter description | -| value | ``` Required ``` | Possible values for default_visibility settings: 0...1. | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$settingKey = string::DEAL_DEFAULT_VISIBILITY; -$collect['settingKey'] = $settingKey; - -$value = int::ENUM_0; -$collect['value'] = $value; - - -$result = $roles->addOrUpdateRoleSetting($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".StagesController") StagesController - -### Get singleton instance - -The singleton instance of the ``` StagesController ``` class can be accessed from the API Client. - -```php -$stages = $client->getStages(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.deleteMultipleStagesInBulk") deleteMultipleStagesInBulk - -> Marks multiple stages as deleted. - - -```php -function deleteMultipleStagesInBulk($ids) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| ids | ``` Required ``` | Comma-separated stage IDs to delete | - - - -#### Example Usage - -```php -$ids = 'ids'; - -$stages->deleteMultipleStagesInBulk($ids); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.getAllStages") getAllStages - -> Returns data about all stages - - -```php -function getAllStages($pipelineId = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| pipelineId | ``` Optional ``` | ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. | - - - -#### Example Usage - -```php -$pipelineId = 19; - -$stages->getAllStages($pipelineId); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.addANewStage") addANewStage - -> Adds a new stage, returns the ID upon success. - - -```php -function addANewStage($body = null) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$body = array('key' => 'value'); - -$stages->addANewStage($body); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.deleteAStage") deleteAStage - -> Marks a stage as deleted. - - -```php -function deleteAStage($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the stage | - - - -#### Example Usage - -```php -$id = 19; - -$stages->deleteAStage($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.getOneStage") getOneStage - -> Returns data about a specific stage - - -```php -function getOneStage($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the stage | - - - -#### Example Usage - -```php -$id = 19; - -$stages->getOneStage($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.updateStageDetails") updateStageDetails - -> Updates the properties of a stage. - - -```php -function updateStageDetails($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the stage | -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$body = array('key' => 'value'); -$collect['body'] = $body; - - -$stages->updateStageDetails($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".StagesController.getDealsInAStage") getDealsInAStage - -> Lists deals in a specific stage - - -```php -function getDealsInAStage($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the stage | -| filterId | ``` Optional ``` | If supplied, only deals matching the given filter will be returned. | -| userId | ``` Optional ``` | If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. | -| everyone | ``` Optional ``` | If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 19; -$collect['id'] = $id; - -$filterId = 19; -$collect['filterId'] = $filterId; - -$userId = 19; -$collect['userId'] = $userId; - -$everyone = int::ENUM_0; -$collect['everyone'] = $everyone; - -$start = 0; -$collect['start'] = $start; - -$limit = 19; -$collect['limit'] = $limit; - - -$stages->getDealsInAStage($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".TeamsController") TeamsController - -### Get singleton instance - -The singleton instance of the ``` TeamsController ``` class can be accessed from the API Client. - -```php -$teams = $client->getTeams(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.getAllTeams") getAllTeams - -> Returns data about teams within the company - - -```php -function getAllTeams($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| orderBy | ``` Optional ``` ``` DefaultValue ``` | Field name to sort returned teams by | -| skipUsers | ``` Optional ``` | When enabled, the teams will not include IDs of member users | - - - -#### Example Usage - -```php -$orderBy = string::ID; -$collect['orderBy'] = $orderBy; - -$skipUsers = int::ENUM_0; -$collect['skipUsers'] = $skipUsers; - - -$result = $teams->getAllTeams($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.addANewTeam") addANewTeam - -> Adds a new team to the company and returns the created object - - -```php -function addANewTeam($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| name | ``` Required ``` | The Team name | -| managerId | ``` Required ``` | The Team manager ID | -| description | ``` Optional ``` | The Team description | -| users | ``` Optional ``` ``` Collection ``` | IDs of the Users that belong to the Team | - - - -#### Example Usage - -```php -$name = 'name'; -$collect['name'] = $name; - -$managerId = 183; -$collect['managerId'] = $managerId; - -$description = 'description'; -$collect['description'] = $description; - -$users = array(183); -$collect['users'] = $users; - - -$result = $teams->addANewTeam($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | - - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.getASingleTeam") getASingleTeam - -> Returns data about a specific team - - -```php -function getASingleTeam($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the team | -| skipUsers | ``` Optional ``` | When enabled, the teams will not include IDs of member users | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$skipUsers = int::ENUM_0; -$collect['skipUsers'] = $skipUsers; - - -$result = $teams->getASingleTeam($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 404 | Team with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.updateATeam") updateATeam - -> Updates an existing team and returns the updated object - - -```php -function updateATeam($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the team | -| body | ``` Optional ``` | TODO: Add a parameter description | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$body = array('key' => 'value'); -$collect['body'] = $body; - - -$result = $teams->updateATeam($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | -| 404 | Team with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.getAllUsersInATeam") getAllUsersInATeam - -> Returns list of all user IDs within a team - - -```php -function getAllUsersInATeam($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the team | - - - -#### Example Usage - -```php -$id = 183; - -$result = $teams->getAllUsersInATeam($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 404 | Team with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.addUsersToATeam") addUsersToATeam - -> Adds users to an existing team - - -```php -function addUsersToATeam($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the team | -| users | ``` Required ``` ``` Collection ``` | List of User IDs | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$users = array(183); -$collect['users'] = $users; - - -$result = $teams->addUsersToATeam($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | -| 404 | Team with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.deleteUsersFromATeam") deleteUsersFromATeam - -> Deletes users from an existing team - - -```php -function deleteUsersFromATeam($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the team | -| users | ``` Required ``` ``` Collection ``` | List of User IDs | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$users = array(183); -$collect['users'] = $users; - - -$result = $teams->deleteUsersFromATeam($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | -| 404 | Team with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".TeamsController.getAllTeamsOfAUser") getAllTeamsOfAUser - -> Returns data about all teams which have specified user as a member - - -```php -function getAllTeamsOfAUser($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | -| orderBy | ``` Optional ``` ``` DefaultValue ``` | Field name to sort returned teams by | -| skipUsers | ``` Optional ``` | When enabled, the teams will not include IDs of member users | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$orderBy = string::ID; -$collect['orderBy'] = $orderBy; - -$skipUsers = int::ENUM_0; -$collect['skipUsers'] = $skipUsers; - - -$result = $teams->getAllTeamsOfAUser($collect); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".UserConnectionsController") UserConnectionsController - -### Get singleton instance - -The singleton instance of the ``` UserConnectionsController ``` class can be accessed from the API Client. - -```php -$userConnections = $client->getUserConnections(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".UserConnectionsController.getAllUserConnections") getAllUserConnections - -> Returns data about all connections for authorized user. - - -```php -function getAllUserConnections() -``` - -#### Example Usage - -```php - -$result = $userConnections->getAllUserConnections(); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 401 | Unauthorized response | - - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".UserSettingsController") UserSettingsController - -### Get singleton instance - -The singleton instance of the ``` UserSettingsController ``` class can be accessed from the API Client. - -```php -$userSettings = $client->getUserSettings(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".UserSettingsController.listSettingsOfAuthorizedUser") listSettingsOfAuthorizedUser - -> Lists settings of authorized user. - - -```php -function listSettingsOfAuthorizedUser() -``` - -#### Example Usage - -```php - -$userSettings->listSettingsOfAuthorizedUser(); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".UsersController") UsersController - -### Get singleton instance - -The singleton instance of the ``` UsersController ``` class can be accessed from the API Client. - -```php -$users = $client->getUsers(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.getAllUsers") getAllUsers - -> Returns data about all users within the company - - -```php -function getAllUsers() -``` - -#### Example Usage - -```php - -$result = $users->getAllUsers(); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.addANewUser") addANewUser - -> Adds a new user to the company, returns the ID upon success. - - -```php -function addANewUser($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| name | ``` Required ``` | Name of the user | -| email | ``` Required ``` | Email of the user | -| activeFlag | ``` Required ``` | Whether the user is active or not. false = Not activated, true = Activated | - - - -#### Example Usage - -```php -$name = 'name'; -$collect['name'] = $name; - -$email = 'email'; -$collect['email'] = $email; - -$activeFlag = true; -$collect['activeFlag'] = $activeFlag; - - -$result = $users->addANewUser($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | - - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.findUsersByName") findUsersByName - -> Finds users by their name. - - -```php -function findUsersByName($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| term | ``` Required ``` | Search term to look for | -| searchByEmail | ``` Optional ``` | When enabled, term will only be matched against email addresses of users. Default: false | - - - -#### Example Usage - -```php -$term = 'term'; -$collect['term'] = $term; - -$searchByEmail = int::ENUM_0; -$collect['searchByEmail'] = $searchByEmail; - - -$result = $users->findUsersByName($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.getCurrentUserData") getCurrentUserData - -> Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the 'locale' property means 'Date and number format' in the Pipedrive settings, not the chosen language. - - -```php -function getCurrentUserData() -``` - -#### Example Usage - -```php - -$result = $users->getCurrentUserData(); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 401 | Unauthorized response | - - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.getOneUser") getOneUser - -> Returns data about a specific user within the company - - -```php -function getOneUser($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 183; - -$result = $users->getOneUser($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 404 | User with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.updateUserDetails") updateUserDetails - -> Updates the properties of a user. Currently, only active_flag can be updated. - - -```php -function updateUserDetails($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | -| activeFlag | ``` Required ``` | Whether the user is active or not. false = Not activated, true = Activated | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$activeFlag = true; -$collect['activeFlag'] = $activeFlag; - - -$result = $users->updateUserDetails($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | -| 404 | User with specified ID does not exist or is inaccessible | - - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.listBlacklistedEmailAddressesOfAUser") listBlacklistedEmailAddressesOfAUser - -> Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive when using the built-in Mailbox. - - -```php -function listBlacklistedEmailAddressesOfAUser($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 183; - -$users->listBlacklistedEmailAddressesOfAUser($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.addBlacklistedEmailAddressForAUser") addBlacklistedEmailAddressForAUser - -> Add blacklisted email address for a specific user. - - -```php -function addBlacklistedEmailAddressForAUser($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | -| address | ``` Required ``` | Email address to blacklist (can contain \\* for wildcards, e.g. \\*@example.com, or john\\*@ex\\*.com) | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$address = 'address'; -$collect['address'] = $address; - - -$users->addBlacklistedEmailAddressForAUser($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.listFollowersOfAUser") listFollowersOfAUser - -> Lists followers of a specific user. - - -```php -function listFollowersOfAUser($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 183; - -$result = $users->listFollowersOfAUser($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 403 | Forbidden response | - - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.listUserPermissions") listUserPermissions - -> List aggregated permissions over all assigned permission sets for a user - - -```php -function listUserPermissions($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 183; - -$users->listUserPermissions($id); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.deleteARoleAssignment") deleteARoleAssignment - -> Delete a role assignment for a user - - -```php -function deleteARoleAssignment($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | -| roleId | ``` Required ``` | ID of the role | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$roleId = 183; -$collect['roleId'] = $roleId; - - -$users->deleteARoleAssignment($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.listRoleAssignments") listRoleAssignments - -> List role assignments for a user - - -```php -function listRoleAssignments($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | -| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start | -| limit | ``` Optional ``` | Items shown per page | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$start = 0; -$collect['start'] = $start; - -$limit = 183; -$collect['limit'] = $limit; - - -$users->listRoleAssignments($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.addRoleAssignment") addRoleAssignment - -> Add role assignment for a user - - -```php -function addRoleAssignment($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | -| roleId | ``` Required ``` | ID of the role | - - - -#### Example Usage - -```php -$id = 183; -$collect['id'] = $id; - -$roleId = 183; -$collect['roleId'] = $roleId; - - -$users->addRoleAssignment($collect); - -``` - - -### ![Method: ](https://apidocs.io/img/method.png ".UsersController.listUserRoleSettings") listUserRoleSettings - -> List settings of user's assigned role - - -```php -function listUserRoleSettings($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | ID of the user | - - - -#### Example Usage - -```php -$id = 183; - -$users->listUserRoleSettings($id); - -``` - - -[Back to List of Controllers](#list_of_controllers) - -## ![Class: ](https://apidocs.io/img/class.png ".WebhooksController") WebhooksController - -### Get singleton instance - -The singleton instance of the ``` WebhooksController ``` class can be accessed from the API Client. - -```php -$webhooks = $client->getWebhooks(); -``` - -### ![Method: ](https://apidocs.io/img/method.png ".WebhooksController.getAllWebhooks") getAllWebhooks - -> Returns data about all webhooks of a company. - - -```php -function getAllWebhooks() -``` - -#### Example Usage - -```php - -$result = $webhooks->getAllWebhooks(); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 401 | Unauthorized response | - - - -### ![Method: ](https://apidocs.io/img/method.png ".WebhooksController.createANewWebhook") createANewWebhook - -> Creates a new webhook and returns its details. Note that specifying an event which triggers the webhook combines 2 parameters - 'event_action' and 'event_object'. E.g., use '\*.\*' for getting notifications about all events, 'added.deal' for any newly added deals, 'deleted.persons' for any deleted persons, etc. See https://pipedrive.readme.io/docs/guide-for-webhooks for more details. - - -```php -function createANewWebhook($options) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| subscriptionUrl | ``` Required ``` | A full, valid, publicly accessible URL. Determines where to send the notifications. Please note that you cannot use Pipedrive API endpoints as the subscription_url. | -| eventAction | ``` Required ``` | Type of action to receive notifications about. Wildcard will match all supported actions. | -| eventObject | ``` Required ``` | Type of object to receive notifications about. Wildcard will match all supported objects. | -| userId | ``` Optional ``` | The ID of the user this webhook will be authorized with. If not set, current authorized user will be used. Note that this does not filter only certain user's events — rather, this specifies the user's permissions under which each event is checked. Events about objects the selected user is not entitled to access are not sent. If you want to receive notifications for all events, a top-level admin user should be used. | -| httpAuthUser | ``` Optional ``` | HTTP basic auth username of the subscription URL endpoint (if required). | -| httpAuthPassword | ``` Optional ``` | HTTP basic auth password of the subscription URL endpoint (if required). | - - - -#### Example Usage - -```php -$subscriptionUrl = 'subscription_url'; -$collect['subscriptionUrl'] = $subscriptionUrl; - -$eventAction = string::ENUM_0; -$collect['eventAction'] = $eventAction; - -$eventObject = string::ENUM_0; -$collect['eventObject'] = $eventObject; - -$userId = 183; -$collect['userId'] = $userId; - -$httpAuthUser = 'http_auth_user'; -$collect['httpAuthUser'] = $httpAuthUser; - -$httpAuthPassword = 'http_auth_password'; -$collect['httpAuthPassword'] = $httpAuthPassword; - - -$result = $webhooks->createANewWebhook($collect); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 400 | The bad response on webhook creation | -| 401 | Unauthorized response | - - - -### ![Method: ](https://apidocs.io/img/method.png ".WebhooksController.deleteExistingWebhook") deleteExistingWebhook - -> Deletes the specified webhook. - - -```php -function deleteExistingWebhook($id) -``` - -#### Parameters - -| Parameter | Tags | Description | -|-----------|------|-------------| -| id | ``` Required ``` | The ID of the webhook to delete | - - - -#### Example Usage - -```php -$id = 183; - -$result = $webhooks->deleteExistingWebhook($id); - -``` - -#### Errors - -| Error Code | Error Description | -|------------|-------------------| -| 401 | Unauthorized response | -| 403 | The webhook deletion forbidden response | -| 404 | The webhook deletion not found response | - - - -[Back to List of Controllers](#list_of_controllers) +# Pipedrive client for PHP based apps + +Pipedrive is a global sales-first CRM and intelligent revenue management platform for small businesses. Check out www.pipedrive.com for more details. + +This is the official Pipedrive API wrapper-client for PHP based apps, distributed by Pipedrive Inc freely under the MIT licence. It provides convenient access to the Pipedrive API, allowing you to operate with entities such as deals, persons, organizations, products and more. + +> ⚠️ With version 5 of the SDK, we have moved to an open-source SDK generator called [OpenAPI Generator](https://openapi-generator.tech). This enables us to better respond to any issues you might have with our SDK. +> +> Please use the [issues page](https://github.com/pipedrive/client-php/issues) for reporting bugs or feedback. + +## Installation and usage + +### Requirements + +PHP 7.4+ and later. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "require": { + "pipedrive/pipedrive": "^5@beta" + } +} +``` + +Then run `composer install`. + +Or running the `composer require` command +```shell +composer require pipedrive/pipedrive:^5@beta +``` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setApiKey('api_token', 'YOUR_API_KEY'); + +$apiInstance = new Pipedrive\Api\ActivitiesApi( +// If you want use 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->activitiesGet(); + echo '
';
+    print_r($result);
+    echo '
'; +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->activitiesDelete: ', $e->getMessage(), PHP_EOL; +} + +?> +``` + +### With OAuth 2.0 + +In order to setup authentication in the API client, you need the following information: + +| Parameter | Description | +|-----------|-------------| +| oAuthClientId | OAuth 2.0 Client ID | +| oAuthClientSecret | OAuth 2.0 Client Secret | +| oAuthRedirectUri | OAuth 2.0 Redirection endpoint or Callback Uri | + + +The API client can be initialized as following: + +```php +$oAuthClientId = 'oAuthClientId'; // OAuth 2 Client ID +$oAuthClientSecret = 'oAuthClientSecret'; // OAuth 2 Client Secret +$oAuthRedirectUri = 'https://example.com/oauth/callback'; // OAuth 2 Redirection endpoint or Callback Uri + +$config = (new Pipedrive\Configuration()); +$config->setClientId($oAuthClientId); +$config->setClientSecret($oAuthClientSecret); +$config->setOauthRedirectUri($oAuthRedirectUri); + +$dealsApiInstance = new DealsApi(null, $config); +``` + +You must now authorize the client. + +### Authorizing your client + +Your application must obtain user authorization before it can execute an endpoint call. +The SDK uses *OAuth 2.0 authorization* to obtain a user's consent to perform an API request on the user's behalf. + +#### 1. Obtain user consent + +To obtain user consent, you must redirect the user to the authorization page. The `getAuthorizationPageUrl()` method creates the URL to the authorization page when you have clientID and OAuthRedirect set in $config +```php +$authUrl = $config->getAuthorizationPageUrl(); +header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL)); +``` + +#### 2. Handle the OAuth server response + +Once the user responds to the consent request, the OAuth 2.0 server responds to your application's access request by redirecting the user to the redirect URI specified in `Configuration`. + +If the user approves the request, the authorization code will be sent as the `code` query string: + +``` +https://example.com/oauth/callback?code=XXXXXXXXXXXXXXXXXXXXXXXXX +``` + +If the user does not approve the request, the response contains an `error` query string: + +``` +https://example.com/oauth/callback?error=access_denied +``` + +#### 3. Authorize the client using the code + +After the server receives the code, it can exchange this for an *access token*. The access token is an object containing information for authorizing client requests and refreshing the token itself. + +```php +try { + $config->authorize($_GET['code']); +} catch (Exception $ex) { + // handle exception +} +``` + +### Refreshing the token + +An access token may expire after sometime. To extend its lifetime, you must refresh the token. + +```php +if ($configuration->getExpiresAt() < time()) { + try { + $config->refreshToken(); + } catch (Exception $ex) { + // handle exception + } +} +``` + +If a token expires, the SDK will attempt to automatically refresh the token before the next endpoint call requiring authentication. + +### Storing an access token for reuse + +It is recommended that you store the access token for reuse. + +You can store the access token in the `$_SESSION` global or any other persistent storage: + +```php +// store token +$_SESSION['access_token'] = $config->getAccessToken(); +``` + +However, since the SDK will attempt to automatically refresh the token when it expires, it is recommended that you register a *token update callback* to detect any change to the access token. + +```php +$config->setOAuthTokenUpdateCallback(function ($token) { + $_SESSION['token'] = $token; +}); +``` + +The token update callback will be fired upon authorization as well as token refresh. + +### Creating a client from a stored token + +To authorize a client from a stored access token, just set the access token in `Configuration` along with the other configuration parameters before creating the client: + +```php +// load token later... +$config->setAccessToken($_SESSION['token']->access_token); + +// If you want to set all of the OAuth2 related fields at once from the token gotten from Pipedrive OAuth server +// you can use the updateOAuthRelatedFields() function +$config->updateOAuthRelatedFields($_SESSION['token']); +// This will set the access token, expiresIn, expiresAt, scope and host attributes in the Configuration class +// In order to get automatic access token refreshing, you will still need the client ID, client secret and redirectURI + +// Set other configuration, then instantiate client +$activitiesApiInstance = new ActivitiesApi(null, $config); +``` + +### Revoke token + +When there is a need for an application to indicate to the authorization server that user token should be invalidated, use the `revokeToken` method with provided `hint` argument value: + +```php +$config = (new Pipedrive\Configuration()); +$config->updateOAuthRelatedFields(/* ... */); +``` + +When configuration is set, just call the method: + +```php +// this will revoke all user tokens +$config->revokeToken('refresh_token'); + +/* OR */ + +// this will revoke only access token +$config->revokeToken('access_token'); +``` + +### Complete example with OAuth + +In this example, the `index.php` will first check if an access token is available for the user. If one is not set, it redirects the user to `authcallback.php` which will obtain an access token and redirect the user back to the `index.php` page. +Now that an access token is set, `index.php` can use the client to make authorized calls to the server. + +#### `index.php` + +```php +setOauthRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/authcallback.php'); +$config->setClientSecret('YOUR_CLIENT_SECRET'); +$config->setClientId('YOUR_CLIENT_ID'); + +//$usersApiInstance = new UsersApi(null, $config); +$dealsApiInstance = new DealsApi(null, $config); + +// check if a token is available +if (isset($_SESSION['token']) && $_SESSION['token']) { + // set access token in configuration + $config->updateOAuthRelatedFields($_SESSION['token']); + + try { + $dealsResponse = $dealsApiInstance->getDeals(); + echo '
';
+        print_r($dealsResponse);
+        echo '
'; + } catch (Exception $e) { + echo 'Exception when trying to get user info', $e, PHP_EOL; + } +} else { + header('Location: ' . filter_var($config->getAuthorizationPageUrl(), FILTER_SANITIZE_URL)); +} +``` + +#### `authcallback.php` + +```php +setOauthRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/authcallback.php'); +$config->setClientSecret('YOUR_CLIENT_SECRET'); +$config->setClientId('YOUR_CLIENT_ID'); +$config->setAuthorizationPageUrl('https://oauth.pipedrive.com/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8081%2Fauthcallback.php'); + +$config->setOAuthTokenUpdateCallback(function ($token) { + $_SESSION['token'] = $token; +}); + +// if authorization code is absent, redirect to authorization page +if (!isset($_GET['code'])) { + header('Location: ' . filter_var($config->getAuthorizationPageUrl(), FILTER_SANITIZE_URL)); +} else { + try { + $config->authorize($_GET['code']); + + // resume user activity + $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/'; + header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); + } catch (Exception $ex) { + print_r($ex); + } +} +``` +## Documentation for API endpoints + +All URIs are relative to *https://api.pipedrive.com/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ActivitiesApi* | [**addActivity**](docs/Api/ActivitiesApi.md#addactivity) | **POST** /activities | Add an activity +*ActivitiesApi* | [**deleteActivities**](docs/Api/ActivitiesApi.md#deleteactivities) | **DELETE** /activities | Delete multiple activities in bulk +*ActivitiesApi* | [**deleteActivity**](docs/Api/ActivitiesApi.md#deleteactivity) | **DELETE** /activities/{id} | Delete an activity +*ActivitiesApi* | [**getActivities**](docs/Api/ActivitiesApi.md#getactivities) | **GET** /activities | Get all activities assigned to a particular user +*ActivitiesApi* | [**getActivitiesCollection**](docs/Api/ActivitiesApi.md#getactivitiescollection) | **GET** /activities/collection | Get all activities (BETA) +*ActivitiesApi* | [**getActivity**](docs/Api/ActivitiesApi.md#getactivity) | **GET** /activities/{id} | Get details of an activity +*ActivitiesApi* | [**updateActivity**](docs/Api/ActivitiesApi.md#updateactivity) | **PUT** /activities/{id} | Update an activity +*ActivityFieldsApi* | [**getActivityFields**](docs/Api/ActivityFieldsApi.md#getactivityfields) | **GET** /activityFields | Get all activity fields +*ActivityTypesApi* | [**addActivityType**](docs/Api/ActivityTypesApi.md#addactivitytype) | **POST** /activityTypes | Add new activity type +*ActivityTypesApi* | [**deleteActivityType**](docs/Api/ActivityTypesApi.md#deleteactivitytype) | **DELETE** /activityTypes/{id} | Delete an activity type +*ActivityTypesApi* | [**deleteActivityTypes**](docs/Api/ActivityTypesApi.md#deleteactivitytypes) | **DELETE** /activityTypes | Delete multiple activity types in bulk +*ActivityTypesApi* | [**getActivityTypes**](docs/Api/ActivityTypesApi.md#getactivitytypes) | **GET** /activityTypes | Get all activity types +*ActivityTypesApi* | [**updateActivityType**](docs/Api/ActivityTypesApi.md#updateactivitytype) | **PUT** /activityTypes/{id} | Update an activity type +*BillingApi* | [**getCompanyAddons**](docs/Api/BillingApi.md#getcompanyaddons) | **GET** /billing/subscriptions/addons | Get all add-ons for a single company +*CallLogsApi* | [**addCallLog**](docs/Api/CallLogsApi.md#addcalllog) | **POST** /callLogs | Add a call log +*CallLogsApi* | [**addCallLogAudioFile**](docs/Api/CallLogsApi.md#addcalllogaudiofile) | **POST** /callLogs/{id}/recordings | Attach an audio file to the call log +*CallLogsApi* | [**deleteCallLog**](docs/Api/CallLogsApi.md#deletecalllog) | **DELETE** /callLogs/{id} | Delete a call log +*CallLogsApi* | [**getCallLog**](docs/Api/CallLogsApi.md#getcalllog) | **GET** /callLogs/{id} | Get details of a call log +*CallLogsApi* | [**getUserCallLogs**](docs/Api/CallLogsApi.md#getusercalllogs) | **GET** /callLogs | Get all call logs assigned to a particular user +*ChannelsApi* | [**addChannel**](docs/Api/ChannelsApi.md#addchannel) | **POST** /channels | Add a channel +*ChannelsApi* | [**deleteChannel**](docs/Api/ChannelsApi.md#deletechannel) | **DELETE** /channels/{id} | Delete a channel +*ChannelsApi* | [**deleteConversation**](docs/Api/ChannelsApi.md#deleteconversation) | **DELETE** /channels/{channel-id}/conversations/{conversation-id} | Delete a conversation +*ChannelsApi* | [**receiveMessage**](docs/Api/ChannelsApi.md#receivemessage) | **POST** /channels/messages/receive | Receives an incoming message +*CurrenciesApi* | [**getCurrencies**](docs/Api/CurrenciesApi.md#getcurrencies) | **GET** /currencies | Get all supported currencies +*DealFieldsApi* | [**addDealField**](docs/Api/DealFieldsApi.md#adddealfield) | **POST** /dealFields | Add a new deal field +*DealFieldsApi* | [**deleteDealField**](docs/Api/DealFieldsApi.md#deletedealfield) | **DELETE** /dealFields/{id} | Delete a deal field +*DealFieldsApi* | [**deleteDealFields**](docs/Api/DealFieldsApi.md#deletedealfields) | **DELETE** /dealFields | Delete multiple deal fields in bulk +*DealFieldsApi* | [**getDealField**](docs/Api/DealFieldsApi.md#getdealfield) | **GET** /dealFields/{id} | Get one deal field +*DealFieldsApi* | [**getDealFields**](docs/Api/DealFieldsApi.md#getdealfields) | **GET** /dealFields | Get all deal fields +*DealFieldsApi* | [**updateDealField**](docs/Api/DealFieldsApi.md#updatedealfield) | **PUT** /dealFields/{id} | Update a deal field +*DealsApi* | [**addDeal**](docs/Api/DealsApi.md#adddeal) | **POST** /deals | Add a deal +*DealsApi* | [**addDealFollower**](docs/Api/DealsApi.md#adddealfollower) | **POST** /deals/{id}/followers | Add a follower to a deal +*DealsApi* | [**addDealParticipant**](docs/Api/DealsApi.md#adddealparticipant) | **POST** /deals/{id}/participants | Add a participant to a deal +*DealsApi* | [**addDealProduct**](docs/Api/DealsApi.md#adddealproduct) | **POST** /deals/{id}/products | Add a product to a deal +*DealsApi* | [**deleteDeal**](docs/Api/DealsApi.md#deletedeal) | **DELETE** /deals/{id} | Delete a deal +*DealsApi* | [**deleteDealFollower**](docs/Api/DealsApi.md#deletedealfollower) | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal +*DealsApi* | [**deleteDealParticipant**](docs/Api/DealsApi.md#deletedealparticipant) | **DELETE** /deals/{id}/participants/{deal_participant_id} | Delete a participant from a deal +*DealsApi* | [**deleteDealProduct**](docs/Api/DealsApi.md#deletedealproduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal +*DealsApi* | [**deleteDeals**](docs/Api/DealsApi.md#deletedeals) | **DELETE** /deals | Delete multiple deals in bulk +*DealsApi* | [**duplicateDeal**](docs/Api/DealsApi.md#duplicatedeal) | **POST** /deals/{id}/duplicate | Duplicate deal +*DealsApi* | [**getDeal**](docs/Api/DealsApi.md#getdeal) | **GET** /deals/{id} | Get details of a deal +*DealsApi* | [**getDealActivities**](docs/Api/DealsApi.md#getdealactivities) | **GET** /deals/{id}/activities | List activities associated with a deal +*DealsApi* | [**getDealFiles**](docs/Api/DealsApi.md#getdealfiles) | **GET** /deals/{id}/files | List files attached to a deal +*DealsApi* | [**getDealFollowers**](docs/Api/DealsApi.md#getdealfollowers) | **GET** /deals/{id}/followers | List followers of a deal +*DealsApi* | [**getDealMailMessages**](docs/Api/DealsApi.md#getdealmailmessages) | **GET** /deals/{id}/mailMessages | List mail messages associated with a deal +*DealsApi* | [**getDealParticipants**](docs/Api/DealsApi.md#getdealparticipants) | **GET** /deals/{id}/participants | List participants of a deal +*DealsApi* | [**getDealPersons**](docs/Api/DealsApi.md#getdealpersons) | **GET** /deals/{id}/persons | List all persons associated with a deal +*DealsApi* | [**getDealProducts**](docs/Api/DealsApi.md#getdealproducts) | **GET** /deals/{id}/products | List products attached to a deal +*DealsApi* | [**getDealUpdates**](docs/Api/DealsApi.md#getdealupdates) | **GET** /deals/{id}/flow | List updates about a deal +*DealsApi* | [**getDealUsers**](docs/Api/DealsApi.md#getdealusers) | **GET** /deals/{id}/permittedUsers | List permitted users +*DealsApi* | [**getDeals**](docs/Api/DealsApi.md#getdeals) | **GET** /deals | Get all deals +*DealsApi* | [**getDealsCollection**](docs/Api/DealsApi.md#getdealscollection) | **GET** /deals/collection | Get all deals (BETA) +*DealsApi* | [**getDealsSummary**](docs/Api/DealsApi.md#getdealssummary) | **GET** /deals/summary | Get deals summary +*DealsApi* | [**getDealsTimeline**](docs/Api/DealsApi.md#getdealstimeline) | **GET** /deals/timeline | Get deals timeline +*DealsApi* | [**mergeDeals**](docs/Api/DealsApi.md#mergedeals) | **PUT** /deals/{id}/merge | Merge two deals +*DealsApi* | [**searchDeals**](docs/Api/DealsApi.md#searchdeals) | **GET** /deals/search | Search deals +*DealsApi* | [**updateDeal**](docs/Api/DealsApi.md#updatedeal) | **PUT** /deals/{id} | Update a deal +*DealsApi* | [**updateDealProduct**](docs/Api/DealsApi.md#updatedealproduct) | **PUT** /deals/{id}/products/{product_attachment_id} | Update the product attached to a deal +*FilesApi* | [**addFile**](docs/Api/FilesApi.md#addfile) | **POST** /files | Add file +*FilesApi* | [**addFileAndLinkIt**](docs/Api/FilesApi.md#addfileandlinkit) | **POST** /files/remote | Create a remote file and link it to an item +*FilesApi* | [**deleteFile**](docs/Api/FilesApi.md#deletefile) | **DELETE** /files/{id} | Delete a file +*FilesApi* | [**downloadFile**](docs/Api/FilesApi.md#downloadfile) | **GET** /files/{id}/download | Download one file +*FilesApi* | [**getFile**](docs/Api/FilesApi.md#getfile) | **GET** /files/{id} | Get one file +*FilesApi* | [**getFiles**](docs/Api/FilesApi.md#getfiles) | **GET** /files | Get all files +*FilesApi* | [**linkFileToItem**](docs/Api/FilesApi.md#linkfiletoitem) | **POST** /files/remoteLink | Link a remote file to an item +*FilesApi* | [**updateFile**](docs/Api/FilesApi.md#updatefile) | **PUT** /files/{id} | Update file details +*FiltersApi* | [**addFilter**](docs/Api/FiltersApi.md#addfilter) | **POST** /filters | Add a new filter +*FiltersApi* | [**deleteFilter**](docs/Api/FiltersApi.md#deletefilter) | **DELETE** /filters/{id} | Delete a filter +*FiltersApi* | [**deleteFilters**](docs/Api/FiltersApi.md#deletefilters) | **DELETE** /filters | Delete multiple filters in bulk +*FiltersApi* | [**getFilter**](docs/Api/FiltersApi.md#getfilter) | **GET** /filters/{id} | Get one filter +*FiltersApi* | [**getFilterHelpers**](docs/Api/FiltersApi.md#getfilterhelpers) | **GET** /filters/helpers | Get all filter helpers +*FiltersApi* | [**getFilters**](docs/Api/FiltersApi.md#getfilters) | **GET** /filters | Get all filters +*FiltersApi* | [**updateFilter**](docs/Api/FiltersApi.md#updatefilter) | **PUT** /filters/{id} | Update filter +*GoalsApi* | [**addGoal**](docs/Api/GoalsApi.md#addgoal) | **POST** /goals | Add a new goal +*GoalsApi* | [**deleteGoal**](docs/Api/GoalsApi.md#deletegoal) | **DELETE** /goals/{id} | Delete existing goal +*GoalsApi* | [**getGoalResult**](docs/Api/GoalsApi.md#getgoalresult) | **GET** /goals/{id}/results | Get result of a goal +*GoalsApi* | [**getGoals**](docs/Api/GoalsApi.md#getgoals) | **GET** /goals/find | Find goals +*GoalsApi* | [**updateGoal**](docs/Api/GoalsApi.md#updategoal) | **PUT** /goals/{id} | Update existing goal +*ItemSearchApi* | [**searchItem**](docs/Api/ItemSearchApi.md#searchitem) | **GET** /itemSearch | Perform a search from multiple item types +*ItemSearchApi* | [**searchItemByField**](docs/Api/ItemSearchApi.md#searchitembyfield) | **GET** /itemSearch/field | Perform a search using a specific field from an item type +*LeadLabelsApi* | [**addLeadLabel**](docs/Api/LeadLabelsApi.md#addleadlabel) | **POST** /leadLabels | Add a lead label +*LeadLabelsApi* | [**deleteLeadLabel**](docs/Api/LeadLabelsApi.md#deleteleadlabel) | **DELETE** /leadLabels/{id} | Delete a lead label +*LeadLabelsApi* | [**getLeadLabels**](docs/Api/LeadLabelsApi.md#getleadlabels) | **GET** /leadLabels | Get all lead labels +*LeadLabelsApi* | [**updateLeadLabel**](docs/Api/LeadLabelsApi.md#updateleadlabel) | **PATCH** /leadLabels/{id} | Update a lead label +*LeadSourcesApi* | [**getLeadSources**](docs/Api/LeadSourcesApi.md#getleadsources) | **GET** /leadSources | Get all lead sources +*LeadsApi* | [**addLead**](docs/Api/LeadsApi.md#addlead) | **POST** /leads | Add a lead +*LeadsApi* | [**deleteLead**](docs/Api/LeadsApi.md#deletelead) | **DELETE** /leads/{id} | Delete a lead +*LeadsApi* | [**getLead**](docs/Api/LeadsApi.md#getlead) | **GET** /leads/{id} | Get one lead +*LeadsApi* | [**getLeadUsers**](docs/Api/LeadsApi.md#getleadusers) | **GET** /leads/{id}/permittedUsers | List permitted users +*LeadsApi* | [**getLeads**](docs/Api/LeadsApi.md#getleads) | **GET** /leads | Get all leads +*LeadsApi* | [**searchLeads**](docs/Api/LeadsApi.md#searchleads) | **GET** /leads/search | Search leads +*LeadsApi* | [**updateLead**](docs/Api/LeadsApi.md#updatelead) | **PATCH** /leads/{id} | Update a lead +*LegacyTeamsApi* | [**addTeam**](docs/Api/LegacyTeamsApi.md#addteam) | **POST** /legacyTeams | Add a new team +*LegacyTeamsApi* | [**addTeamUser**](docs/Api/LegacyTeamsApi.md#addteamuser) | **POST** /legacyTeams/{id}/users | Add users to a team +*LegacyTeamsApi* | [**deleteTeamUser**](docs/Api/LegacyTeamsApi.md#deleteteamuser) | **DELETE** /legacyTeams/{id}/users | Delete users from a team +*LegacyTeamsApi* | [**getTeam**](docs/Api/LegacyTeamsApi.md#getteam) | **GET** /legacyTeams/{id} | Get a single team +*LegacyTeamsApi* | [**getTeamUsers**](docs/Api/LegacyTeamsApi.md#getteamusers) | **GET** /legacyTeams/{id}/users | Get all users in a team +*LegacyTeamsApi* | [**getTeams**](docs/Api/LegacyTeamsApi.md#getteams) | **GET** /legacyTeams | Get all teams +*LegacyTeamsApi* | [**getUserTeams**](docs/Api/LegacyTeamsApi.md#getuserteams) | **GET** /legacyTeams/user/{id} | Get all teams of a user +*LegacyTeamsApi* | [**updateTeam**](docs/Api/LegacyTeamsApi.md#updateteam) | **PUT** /legacyTeams/{id} | Update a team +*MailboxApi* | [**deleteMailThread**](docs/Api/MailboxApi.md#deletemailthread) | **DELETE** /mailbox/mailThreads/{id} | Delete mail thread +*MailboxApi* | [**getMailMessage**](docs/Api/MailboxApi.md#getmailmessage) | **GET** /mailbox/mailMessages/{id} | Get one mail message +*MailboxApi* | [**getMailThread**](docs/Api/MailboxApi.md#getmailthread) | **GET** /mailbox/mailThreads/{id} | Get one mail thread +*MailboxApi* | [**getMailThreadMessages**](docs/Api/MailboxApi.md#getmailthreadmessages) | **GET** /mailbox/mailThreads/{id}/mailMessages | Get all mail messages of mail thread +*MailboxApi* | [**getMailThreads**](docs/Api/MailboxApi.md#getmailthreads) | **GET** /mailbox/mailThreads | Get mail threads +*MailboxApi* | [**updateMailThreadDetails**](docs/Api/MailboxApi.md#updatemailthreaddetails) | **PUT** /mailbox/mailThreads/{id} | Update mail thread details +*NoteFieldsApi* | [**getNoteFields**](docs/Api/NoteFieldsApi.md#getnotefields) | **GET** /noteFields | Get all note fields +*NotesApi* | [**addNote**](docs/Api/NotesApi.md#addnote) | **POST** /notes | Add a note +*NotesApi* | [**addNoteComment**](docs/Api/NotesApi.md#addnotecomment) | **POST** /notes/{id}/comments | Add a comment to a note +*NotesApi* | [**deleteComment**](docs/Api/NotesApi.md#deletecomment) | **DELETE** /notes/{id}/comments/{commentId} | Delete a comment related to a note +*NotesApi* | [**deleteNote**](docs/Api/NotesApi.md#deletenote) | **DELETE** /notes/{id} | Delete a note +*NotesApi* | [**getComment**](docs/Api/NotesApi.md#getcomment) | **GET** /notes/{id}/comments/{commentId} | Get one comment +*NotesApi* | [**getNote**](docs/Api/NotesApi.md#getnote) | **GET** /notes/{id} | Get one note +*NotesApi* | [**getNoteComments**](docs/Api/NotesApi.md#getnotecomments) | **GET** /notes/{id}/comments | Get all comments for a note +*NotesApi* | [**getNotes**](docs/Api/NotesApi.md#getnotes) | **GET** /notes | Get all notes +*NotesApi* | [**updateCommentForNote**](docs/Api/NotesApi.md#updatecommentfornote) | **PUT** /notes/{id}/comments/{commentId} | Update a comment related to a note +*NotesApi* | [**updateNote**](docs/Api/NotesApi.md#updatenote) | **PUT** /notes/{id} | Update a note +*OrganizationFieldsApi* | [**addOrganizationField**](docs/Api/OrganizationFieldsApi.md#addorganizationfield) | **POST** /organizationFields | Add a new organization field +*OrganizationFieldsApi* | [**deleteOrganizationField**](docs/Api/OrganizationFieldsApi.md#deleteorganizationfield) | **DELETE** /organizationFields/{id} | Delete an organization field +*OrganizationFieldsApi* | [**deleteOrganizationFields**](docs/Api/OrganizationFieldsApi.md#deleteorganizationfields) | **DELETE** /organizationFields | Delete multiple organization fields in bulk +*OrganizationFieldsApi* | [**getOrganizationField**](docs/Api/OrganizationFieldsApi.md#getorganizationfield) | **GET** /organizationFields/{id} | Get one organization field +*OrganizationFieldsApi* | [**getOrganizationFields**](docs/Api/OrganizationFieldsApi.md#getorganizationfields) | **GET** /organizationFields | Get all organization fields +*OrganizationFieldsApi* | [**updateOrganizationField**](docs/Api/OrganizationFieldsApi.md#updateorganizationfield) | **PUT** /organizationFields/{id} | Update an organization field +*OrganizationRelationshipsApi* | [**addOrganizationRelationship**](docs/Api/OrganizationRelationshipsApi.md#addorganizationrelationship) | **POST** /organizationRelationships | Create an organization relationship +*OrganizationRelationshipsApi* | [**deleteOrganizationRelationship**](docs/Api/OrganizationRelationshipsApi.md#deleteorganizationrelationship) | **DELETE** /organizationRelationships/{id} | Delete an organization relationship +*OrganizationRelationshipsApi* | [**getOrganizationRelationship**](docs/Api/OrganizationRelationshipsApi.md#getorganizationrelationship) | **GET** /organizationRelationships/{id} | Get one organization relationship +*OrganizationRelationshipsApi* | [**getOrganizationRelationships**](docs/Api/OrganizationRelationshipsApi.md#getorganizationrelationships) | **GET** /organizationRelationships | Get all relationships for organization +*OrganizationRelationshipsApi* | [**updateOrganizationRelationship**](docs/Api/OrganizationRelationshipsApi.md#updateorganizationrelationship) | **PUT** /organizationRelationships/{id} | Update an organization relationship +*OrganizationsApi* | [**addOrganization**](docs/Api/OrganizationsApi.md#addorganization) | **POST** /organizations | Add an organization +*OrganizationsApi* | [**addOrganizationFollower**](docs/Api/OrganizationsApi.md#addorganizationfollower) | **POST** /organizations/{id}/followers | Add a follower to an organization +*OrganizationsApi* | [**deleteOrganization**](docs/Api/OrganizationsApi.md#deleteorganization) | **DELETE** /organizations/{id} | Delete an organization +*OrganizationsApi* | [**deleteOrganizationFollower**](docs/Api/OrganizationsApi.md#deleteorganizationfollower) | **DELETE** /organizations/{id}/followers/{follower_id} | Delete a follower from an organization +*OrganizationsApi* | [**deleteOrganizations**](docs/Api/OrganizationsApi.md#deleteorganizations) | **DELETE** /organizations | Delete multiple organizations in bulk +*OrganizationsApi* | [**getOrganization**](docs/Api/OrganizationsApi.md#getorganization) | **GET** /organizations/{id} | Get details of an organization +*OrganizationsApi* | [**getOrganizationActivities**](docs/Api/OrganizationsApi.md#getorganizationactivities) | **GET** /organizations/{id}/activities | List activities associated with an organization +*OrganizationsApi* | [**getOrganizationDeals**](docs/Api/OrganizationsApi.md#getorganizationdeals) | **GET** /organizations/{id}/deals | List deals associated with an organization +*OrganizationsApi* | [**getOrganizationFiles**](docs/Api/OrganizationsApi.md#getorganizationfiles) | **GET** /organizations/{id}/files | List files attached to an organization +*OrganizationsApi* | [**getOrganizationFollowers**](docs/Api/OrganizationsApi.md#getorganizationfollowers) | **GET** /organizations/{id}/followers | List followers of an organization +*OrganizationsApi* | [**getOrganizationMailMessages**](docs/Api/OrganizationsApi.md#getorganizationmailmessages) | **GET** /organizations/{id}/mailMessages | List mail messages associated with an organization +*OrganizationsApi* | [**getOrganizationPersons**](docs/Api/OrganizationsApi.md#getorganizationpersons) | **GET** /organizations/{id}/persons | List persons of an organization +*OrganizationsApi* | [**getOrganizationUpdates**](docs/Api/OrganizationsApi.md#getorganizationupdates) | **GET** /organizations/{id}/flow | List updates about an organization +*OrganizationsApi* | [**getOrganizationUsers**](docs/Api/OrganizationsApi.md#getorganizationusers) | **GET** /organizations/{id}/permittedUsers | List permitted users +*OrganizationsApi* | [**getOrganizations**](docs/Api/OrganizationsApi.md#getorganizations) | **GET** /organizations | Get all organizations +*OrganizationsApi* | [**mergeOrganizations**](docs/Api/OrganizationsApi.md#mergeorganizations) | **PUT** /organizations/{id}/merge | Merge two organizations +*OrganizationsApi* | [**searchOrganization**](docs/Api/OrganizationsApi.md#searchorganization) | **GET** /organizations/search | Search organizations +*OrganizationsApi* | [**updateOrganization**](docs/Api/OrganizationsApi.md#updateorganization) | **PUT** /organizations/{id} | Update an organization +*PermissionSetsApi* | [**getPermissionSet**](docs/Api/PermissionSetsApi.md#getpermissionset) | **GET** /permissionSets/{id} | Get one permission set +*PermissionSetsApi* | [**getPermissionSetAssignments**](docs/Api/PermissionSetsApi.md#getpermissionsetassignments) | **GET** /permissionSets/{id}/assignments | List permission set assignments +*PermissionSetsApi* | [**getPermissionSets**](docs/Api/PermissionSetsApi.md#getpermissionsets) | **GET** /permissionSets | Get all permission sets +*PersonFieldsApi* | [**addPersonField**](docs/Api/PersonFieldsApi.md#addpersonfield) | **POST** /personFields | Add a new person field +*PersonFieldsApi* | [**deletePersonField**](docs/Api/PersonFieldsApi.md#deletepersonfield) | **DELETE** /personFields/{id} | Delete a person field +*PersonFieldsApi* | [**deletePersonFields**](docs/Api/PersonFieldsApi.md#deletepersonfields) | **DELETE** /personFields | Delete multiple person fields in bulk +*PersonFieldsApi* | [**getPersonField**](docs/Api/PersonFieldsApi.md#getpersonfield) | **GET** /personFields/{id} | Get one person field +*PersonFieldsApi* | [**getPersonFields**](docs/Api/PersonFieldsApi.md#getpersonfields) | **GET** /personFields | Get all person fields +*PersonFieldsApi* | [**updatePersonField**](docs/Api/PersonFieldsApi.md#updatepersonfield) | **PUT** /personFields/{id} | Update a person field +*PersonsApi* | [**addPerson**](docs/Api/PersonsApi.md#addperson) | **POST** /persons | Add a person +*PersonsApi* | [**addPersonFollower**](docs/Api/PersonsApi.md#addpersonfollower) | **POST** /persons/{id}/followers | Add a follower to a person +*PersonsApi* | [**addPersonPicture**](docs/Api/PersonsApi.md#addpersonpicture) | **POST** /persons/{id}/picture | Add person picture +*PersonsApi* | [**deletePerson**](docs/Api/PersonsApi.md#deleteperson) | **DELETE** /persons/{id} | Delete a person +*PersonsApi* | [**deletePersonFollower**](docs/Api/PersonsApi.md#deletepersonfollower) | **DELETE** /persons/{id}/followers/{follower_id} | Delete a follower from a person +*PersonsApi* | [**deletePersonPicture**](docs/Api/PersonsApi.md#deletepersonpicture) | **DELETE** /persons/{id}/picture | Delete person picture +*PersonsApi* | [**deletePersons**](docs/Api/PersonsApi.md#deletepersons) | **DELETE** /persons | Delete multiple persons in bulk +*PersonsApi* | [**getPerson**](docs/Api/PersonsApi.md#getperson) | **GET** /persons/{id} | Get details of a person +*PersonsApi* | [**getPersonActivities**](docs/Api/PersonsApi.md#getpersonactivities) | **GET** /persons/{id}/activities | List activities associated with a person +*PersonsApi* | [**getPersonDeals**](docs/Api/PersonsApi.md#getpersondeals) | **GET** /persons/{id}/deals | List deals associated with a person +*PersonsApi* | [**getPersonFiles**](docs/Api/PersonsApi.md#getpersonfiles) | **GET** /persons/{id}/files | List files attached to a person +*PersonsApi* | [**getPersonFollowers**](docs/Api/PersonsApi.md#getpersonfollowers) | **GET** /persons/{id}/followers | List followers of a person +*PersonsApi* | [**getPersonMailMessages**](docs/Api/PersonsApi.md#getpersonmailmessages) | **GET** /persons/{id}/mailMessages | List mail messages associated with a person +*PersonsApi* | [**getPersonProducts**](docs/Api/PersonsApi.md#getpersonproducts) | **GET** /persons/{id}/products | List products associated with a person +*PersonsApi* | [**getPersonUpdates**](docs/Api/PersonsApi.md#getpersonupdates) | **GET** /persons/{id}/flow | List updates about a person +*PersonsApi* | [**getPersonUsers**](docs/Api/PersonsApi.md#getpersonusers) | **GET** /persons/{id}/permittedUsers | List permitted users +*PersonsApi* | [**getPersons**](docs/Api/PersonsApi.md#getpersons) | **GET** /persons | Get all persons +*PersonsApi* | [**mergePersons**](docs/Api/PersonsApi.md#mergepersons) | **PUT** /persons/{id}/merge | Merge two persons +*PersonsApi* | [**searchPersons**](docs/Api/PersonsApi.md#searchpersons) | **GET** /persons/search | Search persons +*PersonsApi* | [**updatePerson**](docs/Api/PersonsApi.md#updateperson) | **PUT** /persons/{id} | Update a person +*PipelinesApi* | [**addPipeline**](docs/Api/PipelinesApi.md#addpipeline) | **POST** /pipelines | Add a new pipeline +*PipelinesApi* | [**deletePipeline**](docs/Api/PipelinesApi.md#deletepipeline) | **DELETE** /pipelines/{id} | Delete a pipeline +*PipelinesApi* | [**getPipeline**](docs/Api/PipelinesApi.md#getpipeline) | **GET** /pipelines/{id} | Get one pipeline +*PipelinesApi* | [**getPipelineConversionStatistics**](docs/Api/PipelinesApi.md#getpipelineconversionstatistics) | **GET** /pipelines/{id}/conversion_statistics | Get deals conversion rates in pipeline +*PipelinesApi* | [**getPipelineDeals**](docs/Api/PipelinesApi.md#getpipelinedeals) | **GET** /pipelines/{id}/deals | Get deals in a pipeline +*PipelinesApi* | [**getPipelineMovementStatistics**](docs/Api/PipelinesApi.md#getpipelinemovementstatistics) | **GET** /pipelines/{id}/movement_statistics | Get deals movements in pipeline +*PipelinesApi* | [**getPipelines**](docs/Api/PipelinesApi.md#getpipelines) | **GET** /pipelines | Get all pipelines +*PipelinesApi* | [**updatePipeline**](docs/Api/PipelinesApi.md#updatepipeline) | **PUT** /pipelines/{id} | Update a pipeline +*ProductFieldsApi* | [**addProductField**](docs/Api/ProductFieldsApi.md#addproductfield) | **POST** /productFields | Add a new product field +*ProductFieldsApi* | [**deleteProductField**](docs/Api/ProductFieldsApi.md#deleteproductfield) | **DELETE** /productFields/{id} | Delete a product field +*ProductFieldsApi* | [**deleteProductFields**](docs/Api/ProductFieldsApi.md#deleteproductfields) | **DELETE** /productFields | Delete multiple product fields in bulk +*ProductFieldsApi* | [**getProductField**](docs/Api/ProductFieldsApi.md#getproductfield) | **GET** /productFields/{id} | Get one product field +*ProductFieldsApi* | [**getProductFields**](docs/Api/ProductFieldsApi.md#getproductfields) | **GET** /productFields | Get all product fields +*ProductFieldsApi* | [**updateProductField**](docs/Api/ProductFieldsApi.md#updateproductfield) | **PUT** /productFields/{id} | Update a product field +*ProductsApi* | [**addProduct**](docs/Api/ProductsApi.md#addproduct) | **POST** /products | Add a product +*ProductsApi* | [**addProductFollower**](docs/Api/ProductsApi.md#addproductfollower) | **POST** /products/{id}/followers | Add a follower to a product +*ProductsApi* | [**deleteProduct**](docs/Api/ProductsApi.md#deleteproduct) | **DELETE** /products/{id} | Delete a product +*ProductsApi* | [**deleteProductFollower**](docs/Api/ProductsApi.md#deleteproductfollower) | **DELETE** /products/{id}/followers/{follower_id} | Delete a follower from a product +*ProductsApi* | [**getProduct**](docs/Api/ProductsApi.md#getproduct) | **GET** /products/{id} | Get one product +*ProductsApi* | [**getProductDeals**](docs/Api/ProductsApi.md#getproductdeals) | **GET** /products/{id}/deals | Get deals where a product is attached to +*ProductsApi* | [**getProductFiles**](docs/Api/ProductsApi.md#getproductfiles) | **GET** /products/{id}/files | List files attached to a product +*ProductsApi* | [**getProductFollowers**](docs/Api/ProductsApi.md#getproductfollowers) | **GET** /products/{id}/followers | List followers of a product +*ProductsApi* | [**getProductUsers**](docs/Api/ProductsApi.md#getproductusers) | **GET** /products/{id}/permittedUsers | List permitted users +*ProductsApi* | [**getProducts**](docs/Api/ProductsApi.md#getproducts) | **GET** /products | Get all products +*ProductsApi* | [**searchProducts**](docs/Api/ProductsApi.md#searchproducts) | **GET** /products/search | Search products +*ProductsApi* | [**updateProduct**](docs/Api/ProductsApi.md#updateproduct) | **PUT** /products/{id} | Update a product +*RecentsApi* | [**getRecents**](docs/Api/RecentsApi.md#getrecents) | **GET** /recents | Get recents +*RolesApi* | [**addOrUpdateRoleSetting**](docs/Api/RolesApi.md#addorupdaterolesetting) | **POST** /roles/{id}/settings | Add or update role setting +*RolesApi* | [**addRole**](docs/Api/RolesApi.md#addrole) | **POST** /roles | Add a role +*RolesApi* | [**addRoleAssignment**](docs/Api/RolesApi.md#addroleassignment) | **POST** /roles/{id}/assignments | Add role assignment +*RolesApi* | [**deleteRole**](docs/Api/RolesApi.md#deleterole) | **DELETE** /roles/{id} | Delete a role +*RolesApi* | [**deleteRoleAssignment**](docs/Api/RolesApi.md#deleteroleassignment) | **DELETE** /roles/{id}/assignments | Delete a role assignment +*RolesApi* | [**getRole**](docs/Api/RolesApi.md#getrole) | **GET** /roles/{id} | Get one role +*RolesApi* | [**getRoleAssignments**](docs/Api/RolesApi.md#getroleassignments) | **GET** /roles/{id}/assignments | List role assignments +*RolesApi* | [**getRolePipelines**](docs/Api/RolesApi.md#getrolepipelines) | **GET** /roles/{id}/pipelines | List pipeline visibility for a role +*RolesApi* | [**getRoleSettings**](docs/Api/RolesApi.md#getrolesettings) | **GET** /roles/{id}/settings | List role settings +*RolesApi* | [**getRoles**](docs/Api/RolesApi.md#getroles) | **GET** /roles | Get all roles +*RolesApi* | [**updateRole**](docs/Api/RolesApi.md#updaterole) | **PUT** /roles/{id} | Update role details +*RolesApi* | [**updateRolePipelines**](docs/Api/RolesApi.md#updaterolepipelines) | **PUT** /roles/{id}/pipelines | Update pipeline visibility for a role +*StagesApi* | [**addStage**](docs/Api/StagesApi.md#addstage) | **POST** /stages | Add a new stage +*StagesApi* | [**deleteStage**](docs/Api/StagesApi.md#deletestage) | **DELETE** /stages/{id} | Delete a stage +*StagesApi* | [**deleteStages**](docs/Api/StagesApi.md#deletestages) | **DELETE** /stages | Delete multiple stages in bulk +*StagesApi* | [**getStage**](docs/Api/StagesApi.md#getstage) | **GET** /stages/{id} | Get one stage +*StagesApi* | [**getStageDeals**](docs/Api/StagesApi.md#getstagedeals) | **GET** /stages/{id}/deals | Get deals in a stage +*StagesApi* | [**getStages**](docs/Api/StagesApi.md#getstages) | **GET** /stages | Get all stages +*StagesApi* | [**updateStage**](docs/Api/StagesApi.md#updatestage) | **PUT** /stages/{id} | Update stage details +*SubscriptionsApi* | [**addRecurringSubscription**](docs/Api/SubscriptionsApi.md#addrecurringsubscription) | **POST** /subscriptions/recurring | Add a recurring subscription +*SubscriptionsApi* | [**addSubscriptionInstallment**](docs/Api/SubscriptionsApi.md#addsubscriptioninstallment) | **POST** /subscriptions/installment | Add an installment subscription +*SubscriptionsApi* | [**cancelRecurringSubscription**](docs/Api/SubscriptionsApi.md#cancelrecurringsubscription) | **PUT** /subscriptions/recurring/{id}/cancel | Cancel a recurring subscription +*SubscriptionsApi* | [**deleteSubscription**](docs/Api/SubscriptionsApi.md#deletesubscription) | **DELETE** /subscriptions/{id} | Delete a subscription +*SubscriptionsApi* | [**findSubscriptionByDeal**](docs/Api/SubscriptionsApi.md#findsubscriptionbydeal) | **GET** /subscriptions/find/{dealId} | Find subscription by deal +*SubscriptionsApi* | [**getSubscription**](docs/Api/SubscriptionsApi.md#getsubscription) | **GET** /subscriptions/{id} | Get details of a subscription +*SubscriptionsApi* | [**getSubscriptionPayments**](docs/Api/SubscriptionsApi.md#getsubscriptionpayments) | **GET** /subscriptions/{id}/payments | Get all payments of a subscription +*SubscriptionsApi* | [**updateRecurringSubscription**](docs/Api/SubscriptionsApi.md#updaterecurringsubscription) | **PUT** /subscriptions/recurring/{id} | Update a recurring subscription +*SubscriptionsApi* | [**updateSubscriptionInstallment**](docs/Api/SubscriptionsApi.md#updatesubscriptioninstallment) | **PUT** /subscriptions/installment/{id} | Update an installment subscription +*UserConnectionsApi* | [**getUserConnections**](docs/Api/UserConnectionsApi.md#getuserconnections) | **GET** /userConnections | Get all user connections +*UserSettingsApi* | [**getUserSettings**](docs/Api/UserSettingsApi.md#getusersettings) | **GET** /userSettings | List settings of an authorized user +*UsersApi* | [**addUser**](docs/Api/UsersApi.md#adduser) | **POST** /users | Add a new user +*UsersApi* | [**findUsersByName**](docs/Api/UsersApi.md#findusersbyname) | **GET** /users/find | Find users by name +*UsersApi* | [**getCurrentUser**](docs/Api/UsersApi.md#getcurrentuser) | **GET** /users/me | Get current user data +*UsersApi* | [**getUser**](docs/Api/UsersApi.md#getuser) | **GET** /users/{id} | Get one user +*UsersApi* | [**getUserFollowers**](docs/Api/UsersApi.md#getuserfollowers) | **GET** /users/{id}/followers | List followers of a user +*UsersApi* | [**getUserPermissions**](docs/Api/UsersApi.md#getuserpermissions) | **GET** /users/{id}/permissions | List user permissions +*UsersApi* | [**getUserRoleAssignments**](docs/Api/UsersApi.md#getuserroleassignments) | **GET** /users/{id}/roleAssignments | List role assignments +*UsersApi* | [**getUserRoleSettings**](docs/Api/UsersApi.md#getuserrolesettings) | **GET** /users/{id}/roleSettings | List user role settings +*UsersApi* | [**getUsers**](docs/Api/UsersApi.md#getusers) | **GET** /users | Get all users +*UsersApi* | [**updateUser**](docs/Api/UsersApi.md#updateuser) | **PUT** /users/{id} | Update user details +*WebhooksApi* | [**addWebhook**](docs/Api/WebhooksApi.md#addwebhook) | **POST** /webhooks | Create a new Webhook +*WebhooksApi* | [**deleteWebhook**](docs/Api/WebhooksApi.md#deletewebhook) | **DELETE** /webhooks/{id} | Delete existing Webhook +*WebhooksApi* | [**getWebhooks**](docs/Api/WebhooksApi.md#getwebhooks) | **GET** /webhooks | Get all Webhooks + + +## Documentation for models + + - [ActivityCollectionResponseObject](docs/Model/ActivityCollectionResponseObject.md) + - [ActivityCollectionResponseObjectAllOf](docs/Model/ActivityCollectionResponseObjectAllOf.md) + - [ActivityDistributionData](docs/Model/ActivityDistributionData.md) + - [ActivityDistributionDataActivityDistribution](docs/Model/ActivityDistributionDataActivityDistribution.md) + - [ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID](docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.md) + - [ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities](docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md) + - [ActivityDistributionDataWithAdditionalData](docs/Model/ActivityDistributionDataWithAdditionalData.md) + - [ActivityInfo](docs/Model/ActivityInfo.md) + - [ActivityObjectFragment](docs/Model/ActivityObjectFragment.md) + - [ActivityPostObject](docs/Model/ActivityPostObject.md) + - [ActivityPostObjectAllOf](docs/Model/ActivityPostObjectAllOf.md) + - [ActivityPutObject](docs/Model/ActivityPutObject.md) + - [ActivityPutObjectAllOf](docs/Model/ActivityPutObjectAllOf.md) + - [ActivityRecordAdditionalData](docs/Model/ActivityRecordAdditionalData.md) + - [ActivityResponseObject](docs/Model/ActivityResponseObject.md) + - [ActivityResponseObjectAllOf](docs/Model/ActivityResponseObjectAllOf.md) + - [ActivityTypeBulkDeleteResponse](docs/Model/ActivityTypeBulkDeleteResponse.md) + - [ActivityTypeBulkDeleteResponseAllOf](docs/Model/ActivityTypeBulkDeleteResponseAllOf.md) + - [ActivityTypeBulkDeleteResponseAllOfData](docs/Model/ActivityTypeBulkDeleteResponseAllOfData.md) + - [ActivityTypeCreateRequest](docs/Model/ActivityTypeCreateRequest.md) + - [ActivityTypeCreateUpdateDeleteResponse](docs/Model/ActivityTypeCreateUpdateDeleteResponse.md) + - [ActivityTypeCreateUpdateDeleteResponseAllOf](docs/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.md) + - [ActivityTypeListResponse](docs/Model/ActivityTypeListResponse.md) + - [ActivityTypeListResponseAllOf](docs/Model/ActivityTypeListResponseAllOf.md) + - [ActivityTypeObjectResponse](docs/Model/ActivityTypeObjectResponse.md) + - [ActivityTypeUpdateRequest](docs/Model/ActivityTypeUpdateRequest.md) + - [AddActivityResponse200](docs/Model/AddActivityResponse200.md) + - [AddActivityResponse200RelatedObjects](docs/Model/AddActivityResponse200RelatedObjects.md) + - [AddDealFollowerRequest](docs/Model/AddDealFollowerRequest.md) + - [AddDealParticipantRequest](docs/Model/AddDealParticipantRequest.md) + - [AddFile](docs/Model/AddFile.md) + - [AddFilterRequest](docs/Model/AddFilterRequest.md) + - [AddFollowerToPersonResponse](docs/Model/AddFollowerToPersonResponse.md) + - [AddFollowerToPersonResponseAllOf](docs/Model/AddFollowerToPersonResponseAllOf.md) + - [AddFollowerToPersonResponseAllOfData](docs/Model/AddFollowerToPersonResponseAllOfData.md) + - [AddLeadLabelRequest](docs/Model/AddLeadLabelRequest.md) + - [AddLeadRequest](docs/Model/AddLeadRequest.md) + - [AddNewPipeline](docs/Model/AddNewPipeline.md) + - [AddNewPipelineAllOf](docs/Model/AddNewPipelineAllOf.md) + - [AddNoteRequest](docs/Model/AddNoteRequest.md) + - [AddNoteRequestAllOf](docs/Model/AddNoteRequestAllOf.md) + - [AddOrUpdateGoalResponse200](docs/Model/AddOrUpdateGoalResponse200.md) + - [AddOrUpdateLeadLabelResponse200](docs/Model/AddOrUpdateLeadLabelResponse200.md) + - [AddOrUpdateRoleSettingRequest](docs/Model/AddOrUpdateRoleSettingRequest.md) + - [AddOrganizationFollowerRequest](docs/Model/AddOrganizationFollowerRequest.md) + - [AddOrganizationRelationshipRequest](docs/Model/AddOrganizationRelationshipRequest.md) + - [AddPersonFollowerRequest](docs/Model/AddPersonFollowerRequest.md) + - [AddPersonPictureResponse](docs/Model/AddPersonPictureResponse.md) + - [AddPersonPictureResponseAllOf](docs/Model/AddPersonPictureResponseAllOf.md) + - [AddPersonResponse](docs/Model/AddPersonResponse.md) + - [AddPersonResponseAllOf](docs/Model/AddPersonResponseAllOf.md) + - [AddProductAttachmentDetails](docs/Model/AddProductAttachmentDetails.md) + - [AddProductAttachmentDetailsAllOf](docs/Model/AddProductAttachmentDetailsAllOf.md) + - [AddProductFollowerRequest](docs/Model/AddProductFollowerRequest.md) + - [AddProductRequestBody](docs/Model/AddProductRequestBody.md) + - [AddRole](docs/Model/AddRole.md) + - [AddRoleAssignmentRequest](docs/Model/AddRoleAssignmentRequest.md) + - [AddTeamUserRequest](docs/Model/AddTeamUserRequest.md) + - [AddUserRequest](docs/Model/AddUserRequest.md) + - [AddWebhookRequest](docs/Model/AddWebhookRequest.md) + - [AddedDealFollower](docs/Model/AddedDealFollower.md) + - [AddedDealFollowerData](docs/Model/AddedDealFollowerData.md) + - [AdditionalBaseOrganizationItemInfo](docs/Model/AdditionalBaseOrganizationItemInfo.md) + - [AdditionalData](docs/Model/AdditionalData.md) + - [AdditionalDataWithCursorPagination](docs/Model/AdditionalDataWithCursorPagination.md) + - [AdditionalDataWithOffsetPagination](docs/Model/AdditionalDataWithOffsetPagination.md) + - [AdditionalDataWithPaginationDetails](docs/Model/AdditionalDataWithPaginationDetails.md) + - [AdditionalMergePersonInfo](docs/Model/AdditionalMergePersonInfo.md) + - [AdditionalPersonInfo](docs/Model/AdditionalPersonInfo.md) + - [AllOrganizationRelationshipsGetResponse](docs/Model/AllOrganizationRelationshipsGetResponse.md) + - [AllOrganizationRelationshipsGetResponseAllOf](docs/Model/AllOrganizationRelationshipsGetResponseAllOf.md) + - [AllOrganizationRelationshipsGetResponseAllOfRelatedObjects](docs/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.md) + - [AllOrganizationsGetResponse](docs/Model/AllOrganizationsGetResponse.md) + - [AllOrganizationsGetResponseAllOf](docs/Model/AllOrganizationsGetResponseAllOf.md) + - [AllOrganizationsGetResponseAllOfRelatedObjects](docs/Model/AllOrganizationsGetResponseAllOfRelatedObjects.md) + - [ArrayPrices](docs/Model/ArrayPrices.md) + - [Assignee](docs/Model/Assignee.md) + - [BaseComment](docs/Model/BaseComment.md) + - [BaseCurrency](docs/Model/BaseCurrency.md) + - [BaseDeal](docs/Model/BaseDeal.md) + - [BaseFollowerItem](docs/Model/BaseFollowerItem.md) + - [BaseMailThread](docs/Model/BaseMailThread.md) + - [BaseMailThreadAllOf](docs/Model/BaseMailThreadAllOf.md) + - [BaseMailThreadAllOfParties](docs/Model/BaseMailThreadAllOfParties.md) + - [BaseMailThreadMessages](docs/Model/BaseMailThreadMessages.md) + - [BaseMailThreadMessagesAllOf](docs/Model/BaseMailThreadMessagesAllOf.md) + - [BaseNote](docs/Model/BaseNote.md) + - [BaseNoteDealTitle](docs/Model/BaseNoteDealTitle.md) + - [BaseNoteOrganization](docs/Model/BaseNoteOrganization.md) + - [BaseNotePerson](docs/Model/BaseNotePerson.md) + - [BaseOrganizationItem](docs/Model/BaseOrganizationItem.md) + - [BaseOrganizationItemFields](docs/Model/BaseOrganizationItemFields.md) + - [BaseOrganizationItemWithEditNameFlag](docs/Model/BaseOrganizationItemWithEditNameFlag.md) + - [BaseOrganizationItemWithEditNameFlagAllOf](docs/Model/BaseOrganizationItemWithEditNameFlagAllOf.md) + - [BaseOrganizationRelationshipItem](docs/Model/BaseOrganizationRelationshipItem.md) + - [BasePersonItem](docs/Model/BasePersonItem.md) + - [BasePersonItemEmail](docs/Model/BasePersonItemEmail.md) + - [BasePersonItemPhone](docs/Model/BasePersonItemPhone.md) + - [BasePipeline](docs/Model/BasePipeline.md) + - [BasePipelineWithSelectedFlag](docs/Model/BasePipelineWithSelectedFlag.md) + - [BasePipelineWithSelectedFlagAllOf](docs/Model/BasePipelineWithSelectedFlagAllOf.md) + - [BaseProduct](docs/Model/BaseProduct.md) + - [BaseResponse](docs/Model/BaseResponse.md) + - [BaseResponseWithStatus](docs/Model/BaseResponseWithStatus.md) + - [BaseResponseWithStatusAllOf](docs/Model/BaseResponseWithStatusAllOf.md) + - [BaseRole](docs/Model/BaseRole.md) + - [BaseStage](docs/Model/BaseStage.md) + - [BaseTeam](docs/Model/BaseTeam.md) + - [BaseTeamAdditionalProperties](docs/Model/BaseTeamAdditionalProperties.md) + - [BaseUser](docs/Model/BaseUser.md) + - [BaseUserMe](docs/Model/BaseUserMe.md) + - [BaseUserMeAllOf](docs/Model/BaseUserMeAllOf.md) + - [BaseUserMeAllOfLanguage](docs/Model/BaseUserMeAllOfLanguage.md) + - [BaseWebhook](docs/Model/BaseWebhook.md) + - [BasicDeal](docs/Model/BasicDeal.md) + - [BasicDealProduct](docs/Model/BasicDealProduct.md) + - [BasicGoal](docs/Model/BasicGoal.md) + - [BasicOrganization](docs/Model/BasicOrganization.md) + - [BasicPerson](docs/Model/BasicPerson.md) + - [BasicPersonEmail](docs/Model/BasicPersonEmail.md) + - [BulkDeleteResponse](docs/Model/BulkDeleteResponse.md) + - [BulkDeleteResponseAllOf](docs/Model/BulkDeleteResponseAllOf.md) + - [BulkDeleteResponseAllOfData](docs/Model/BulkDeleteResponseAllOfData.md) + - [CalculatedFields](docs/Model/CalculatedFields.md) + - [CallLogObject](docs/Model/CallLogObject.md) + - [CallLogResponse200](docs/Model/CallLogResponse200.md) + - [CallLogResponse400](docs/Model/CallLogResponse400.md) + - [CallLogResponse403](docs/Model/CallLogResponse403.md) + - [CallLogResponse404](docs/Model/CallLogResponse404.md) + - [CallLogResponse409](docs/Model/CallLogResponse409.md) + - [CallLogResponse410](docs/Model/CallLogResponse410.md) + - [CallLogResponse500](docs/Model/CallLogResponse500.md) + - [CallLogsResponse](docs/Model/CallLogsResponse.md) + - [CallLogsResponseAdditionalData](docs/Model/CallLogsResponseAdditionalData.md) + - [ChannelObject](docs/Model/ChannelObject.md) + - [ChannelObjectResponse](docs/Model/ChannelObjectResponse.md) + - [ChannelObjectResponseData](docs/Model/ChannelObjectResponseData.md) + - [CommentPostPutObject](docs/Model/CommentPostPutObject.md) + - [CommonMailThread](docs/Model/CommonMailThread.md) + - [CreateRemoteFileAndLinkItToItem](docs/Model/CreateRemoteFileAndLinkItToItem.md) + - [CreateTeam](docs/Model/CreateTeam.md) + - [Currencies](docs/Model/Currencies.md) + - [DealCollectionResponseObject](docs/Model/DealCollectionResponseObject.md) + - [DealCountAndActivityInfo](docs/Model/DealCountAndActivityInfo.md) + - [DealFlowResponse](docs/Model/DealFlowResponse.md) + - [DealFlowResponseAllOf](docs/Model/DealFlowResponseAllOf.md) + - [DealFlowResponseAllOfData](docs/Model/DealFlowResponseAllOfData.md) + - [DealFlowResponseAllOfRelatedObjects](docs/Model/DealFlowResponseAllOfRelatedObjects.md) + - [DealListActivitiesResponse](docs/Model/DealListActivitiesResponse.md) + - [DealListActivitiesResponseAllOf](docs/Model/DealListActivitiesResponseAllOf.md) + - [DealListActivitiesResponseAllOfRelatedObjects](docs/Model/DealListActivitiesResponseAllOfRelatedObjects.md) + - [DealNonStrict](docs/Model/DealNonStrict.md) + - [DealNonStrictModeFields](docs/Model/DealNonStrictModeFields.md) + - [DealNonStrictModeFieldsCreatorUserId](docs/Model/DealNonStrictModeFieldsCreatorUserId.md) + - [DealNonStrictWithDetails](docs/Model/DealNonStrictWithDetails.md) + - [DealNonStrictWithDetailsAllOf](docs/Model/DealNonStrictWithDetailsAllOf.md) + - [DealNonStrictWithDetailsAllOfAge](docs/Model/DealNonStrictWithDetailsAllOfAge.md) + - [DealNonStrictWithDetailsAllOfAverageTimeToWon](docs/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.md) + - [DealNonStrictWithDetailsAllOfStayInPipelineStages](docs/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.md) + - [DealOrganizationData](docs/Model/DealOrganizationData.md) + - [DealOrganizationDataWithId](docs/Model/DealOrganizationDataWithId.md) + - [DealOrganizationDataWithIdAllOf](docs/Model/DealOrganizationDataWithIdAllOf.md) + - [DealParticipantCountInfo](docs/Model/DealParticipantCountInfo.md) + - [DealParticipants](docs/Model/DealParticipants.md) + - [DealPersonData](docs/Model/DealPersonData.md) + - [DealPersonDataEmail](docs/Model/DealPersonDataEmail.md) + - [DealPersonDataPhone](docs/Model/DealPersonDataPhone.md) + - [DealPersonDataWithId](docs/Model/DealPersonDataWithId.md) + - [DealPersonDataWithIdAllOf](docs/Model/DealPersonDataWithIdAllOf.md) + - [DealProductUnitDuration](docs/Model/DealProductUnitDuration.md) + - [DealSearchItem](docs/Model/DealSearchItem.md) + - [DealSearchItemItem](docs/Model/DealSearchItemItem.md) + - [DealSearchItemItemOrganization](docs/Model/DealSearchItemItemOrganization.md) + - [DealSearchItemItemOwner](docs/Model/DealSearchItemItemOwner.md) + - [DealSearchItemItemPerson](docs/Model/DealSearchItemItemPerson.md) + - [DealSearchItemItemStage](docs/Model/DealSearchItemItemStage.md) + - [DealSearchResponse](docs/Model/DealSearchResponse.md) + - [DealSearchResponseAllOf](docs/Model/DealSearchResponseAllOf.md) + - [DealSearchResponseAllOfData](docs/Model/DealSearchResponseAllOfData.md) + - [DealStrict](docs/Model/DealStrict.md) + - [DealStrictModeFields](docs/Model/DealStrictModeFields.md) + - [DealStrictWithMergeId](docs/Model/DealStrictWithMergeId.md) + - [DealStrictWithMergeIdAllOf](docs/Model/DealStrictWithMergeIdAllOf.md) + - [DealSummary](docs/Model/DealSummary.md) + - [DealSummaryPerCurrency](docs/Model/DealSummaryPerCurrency.md) + - [DealSummaryPerCurrencyFull](docs/Model/DealSummaryPerCurrencyFull.md) + - [DealSummaryPerCurrencyFullCURRENCYID](docs/Model/DealSummaryPerCurrencyFullCURRENCYID.md) + - [DealSummaryPerStages](docs/Model/DealSummaryPerStages.md) + - [DealSummaryPerStagesSTAGEID](docs/Model/DealSummaryPerStagesSTAGEID.md) + - [DealSummaryPerStagesSTAGEIDCURRENCYID](docs/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.md) + - [DealTitleParameter](docs/Model/DealTitleParameter.md) + - [DealUserData](docs/Model/DealUserData.md) + - [DealUserDataWithId](docs/Model/DealUserDataWithId.md) + - [DealUserDataWithIdAllOf](docs/Model/DealUserDataWithIdAllOf.md) + - [DealsCountAndActivityInfo](docs/Model/DealsCountAndActivityInfo.md) + - [DealsCountInfo](docs/Model/DealsCountInfo.md) + - [DealsMovementsInfo](docs/Model/DealsMovementsInfo.md) + - [DealsMovementsInfoFormattedValues](docs/Model/DealsMovementsInfoFormattedValues.md) + - [DealsMovementsInfoValues](docs/Model/DealsMovementsInfoValues.md) + - [DeleteActivitiesResponse200](docs/Model/DeleteActivitiesResponse200.md) + - [DeleteActivitiesResponse200Data](docs/Model/DeleteActivitiesResponse200Data.md) + - [DeleteActivityResponse200](docs/Model/DeleteActivityResponse200.md) + - [DeleteActivityResponse200Data](docs/Model/DeleteActivityResponse200Data.md) + - [DeleteChannelSuccess](docs/Model/DeleteChannelSuccess.md) + - [DeleteComment](docs/Model/DeleteComment.md) + - [DeleteConversationSuccess](docs/Model/DeleteConversationSuccess.md) + - [DeleteDeal](docs/Model/DeleteDeal.md) + - [DeleteDealData](docs/Model/DeleteDealData.md) + - [DeleteDealFollower](docs/Model/DeleteDealFollower.md) + - [DeleteDealFollowerData](docs/Model/DeleteDealFollowerData.md) + - [DeleteDealParticipant](docs/Model/DeleteDealParticipant.md) + - [DeleteDealParticipantData](docs/Model/DeleteDealParticipantData.md) + - [DeleteDealProduct](docs/Model/DeleteDealProduct.md) + - [DeleteDealProductData](docs/Model/DeleteDealProductData.md) + - [DeleteFile](docs/Model/DeleteFile.md) + - [DeleteFileData](docs/Model/DeleteFileData.md) + - [DeleteGoalResponse200](docs/Model/DeleteGoalResponse200.md) + - [DeleteMultipleDeals](docs/Model/DeleteMultipleDeals.md) + - [DeleteMultipleDealsData](docs/Model/DeleteMultipleDealsData.md) + - [DeleteMultipleProductFieldsResponse](docs/Model/DeleteMultipleProductFieldsResponse.md) + - [DeleteMultipleProductFieldsResponseData](docs/Model/DeleteMultipleProductFieldsResponseData.md) + - [DeleteNote](docs/Model/DeleteNote.md) + - [DeletePersonResponse](docs/Model/DeletePersonResponse.md) + - [DeletePersonResponseAllOf](docs/Model/DeletePersonResponseAllOf.md) + - [DeletePersonResponseAllOfData](docs/Model/DeletePersonResponseAllOfData.md) + - [DeletePersonsInBulkResponse](docs/Model/DeletePersonsInBulkResponse.md) + - [DeletePersonsInBulkResponseAllOf](docs/Model/DeletePersonsInBulkResponseAllOf.md) + - [DeletePersonsInBulkResponseAllOfData](docs/Model/DeletePersonsInBulkResponseAllOfData.md) + - [DeletePipelineResponse200](docs/Model/DeletePipelineResponse200.md) + - [DeletePipelineResponse200Data](docs/Model/DeletePipelineResponse200Data.md) + - [DeleteProductFieldResponse](docs/Model/DeleteProductFieldResponse.md) + - [DeleteProductFieldResponseData](docs/Model/DeleteProductFieldResponseData.md) + - [DeleteProductFollowerResponse](docs/Model/DeleteProductFollowerResponse.md) + - [DeleteProductFollowerResponseData](docs/Model/DeleteProductFollowerResponseData.md) + - [DeleteProductResponse](docs/Model/DeleteProductResponse.md) + - [DeleteProductResponseData](docs/Model/DeleteProductResponseData.md) + - [DeleteResponse](docs/Model/DeleteResponse.md) + - [DeleteResponseAllOf](docs/Model/DeleteResponseAllOf.md) + - [DeleteResponseAllOfData](docs/Model/DeleteResponseAllOfData.md) + - [DeleteRole](docs/Model/DeleteRole.md) + - [DeleteRoleAllOf](docs/Model/DeleteRoleAllOf.md) + - [DeleteRoleAllOfData](docs/Model/DeleteRoleAllOfData.md) + - [DeleteRoleAssignment](docs/Model/DeleteRoleAssignment.md) + - [DeleteRoleAssignmentAllOf](docs/Model/DeleteRoleAssignmentAllOf.md) + - [DeleteRoleAssignmentAllOfData](docs/Model/DeleteRoleAssignmentAllOfData.md) + - [DeleteRoleAssignmentRequest](docs/Model/DeleteRoleAssignmentRequest.md) + - [DeleteStageResponse200](docs/Model/DeleteStageResponse200.md) + - [DeleteStageResponse200Data](docs/Model/DeleteStageResponse200Data.md) + - [DeleteStagesResponse200](docs/Model/DeleteStagesResponse200.md) + - [DeleteStagesResponse200Data](docs/Model/DeleteStagesResponse200Data.md) + - [DeleteTeamUserRequest](docs/Model/DeleteTeamUserRequest.md) + - [Duration](docs/Model/Duration.md) + - [EditPipeline](docs/Model/EditPipeline.md) + - [EditPipelineAllOf](docs/Model/EditPipelineAllOf.md) + - [EmailInfo](docs/Model/EmailInfo.md) + - [ExpectedOutcome](docs/Model/ExpectedOutcome.md) + - [FailResponse](docs/Model/FailResponse.md) + - [Field](docs/Model/Field.md) + - [FieldCreateRequest](docs/Model/FieldCreateRequest.md) + - [FieldCreateRequestAllOf](docs/Model/FieldCreateRequestAllOf.md) + - [FieldResponse](docs/Model/FieldResponse.md) + - [FieldResponseAllOf](docs/Model/FieldResponseAllOf.md) + - [FieldType](docs/Model/FieldType.md) + - [FieldTypeAsString](docs/Model/FieldTypeAsString.md) + - [FieldUpdateRequest](docs/Model/FieldUpdateRequest.md) + - [FieldsResponse](docs/Model/FieldsResponse.md) + - [FieldsResponseAllOf](docs/Model/FieldsResponseAllOf.md) + - [FileData](docs/Model/FileData.md) + - [FileItem](docs/Model/FileItem.md) + - [FilterGetItem](docs/Model/FilterGetItem.md) + - [FilterType](docs/Model/FilterType.md) + - [FiltersBulkDeleteResponse](docs/Model/FiltersBulkDeleteResponse.md) + - [FiltersBulkDeleteResponseAllOf](docs/Model/FiltersBulkDeleteResponseAllOf.md) + - [FiltersBulkDeleteResponseAllOfData](docs/Model/FiltersBulkDeleteResponseAllOfData.md) + - [FiltersBulkGetResponse](docs/Model/FiltersBulkGetResponse.md) + - [FiltersBulkGetResponseAllOf](docs/Model/FiltersBulkGetResponseAllOf.md) + - [FiltersDeleteResponse](docs/Model/FiltersDeleteResponse.md) + - [FiltersDeleteResponseAllOf](docs/Model/FiltersDeleteResponseAllOf.md) + - [FiltersDeleteResponseAllOfData](docs/Model/FiltersDeleteResponseAllOfData.md) + - [FiltersGetResponse](docs/Model/FiltersGetResponse.md) + - [FiltersGetResponseAllOf](docs/Model/FiltersGetResponseAllOf.md) + - [FiltersPostResponse](docs/Model/FiltersPostResponse.md) + - [FiltersPostResponseAllOf](docs/Model/FiltersPostResponseAllOf.md) + - [FiltersPostResponseAllOfData](docs/Model/FiltersPostResponseAllOfData.md) + - [FindGoalResponse](docs/Model/FindGoalResponse.md) + - [FollowerData](docs/Model/FollowerData.md) + - [FollowerDataWithID](docs/Model/FollowerDataWithID.md) + - [FollowerDataWithIDAllOf](docs/Model/FollowerDataWithIDAllOf.md) + - [FullRole](docs/Model/FullRole.md) + - [FullRoleAllOf](docs/Model/FullRoleAllOf.md) + - [GetActivitiesCollectionResponse200](docs/Model/GetActivitiesCollectionResponse200.md) + - [GetActivitiesResponse200](docs/Model/GetActivitiesResponse200.md) + - [GetActivitiesResponse200RelatedObjects](docs/Model/GetActivitiesResponse200RelatedObjects.md) + - [GetActivityResponse200](docs/Model/GetActivityResponse200.md) + - [GetAddProductAttachementDetails](docs/Model/GetAddProductAttachementDetails.md) + - [GetAddUpdateStage](docs/Model/GetAddUpdateStage.md) + - [GetAddedDeal](docs/Model/GetAddedDeal.md) + - [GetAllFiles](docs/Model/GetAllFiles.md) + - [GetAllPersonsResponse](docs/Model/GetAllPersonsResponse.md) + - [GetAllPersonsResponseAllOf](docs/Model/GetAllPersonsResponseAllOf.md) + - [GetAllPipelines](docs/Model/GetAllPipelines.md) + - [GetAllPipelinesAllOf](docs/Model/GetAllPipelinesAllOf.md) + - [GetAllProductFieldsResponse](docs/Model/GetAllProductFieldsResponse.md) + - [GetComments](docs/Model/GetComments.md) + - [GetDeal](docs/Model/GetDeal.md) + - [GetDealAdditionalData](docs/Model/GetDealAdditionalData.md) + - [GetDeals](docs/Model/GetDeals.md) + - [GetDealsCollection](docs/Model/GetDealsCollection.md) + - [GetDealsConversionRatesInPipeline](docs/Model/GetDealsConversionRatesInPipeline.md) + - [GetDealsConversionRatesInPipelineAllOf](docs/Model/GetDealsConversionRatesInPipelineAllOf.md) + - [GetDealsConversionRatesInPipelineAllOfData](docs/Model/GetDealsConversionRatesInPipelineAllOfData.md) + - [GetDealsMovementsInPipeline](docs/Model/GetDealsMovementsInPipeline.md) + - [GetDealsMovementsInPipelineAllOf](docs/Model/GetDealsMovementsInPipelineAllOf.md) + - [GetDealsMovementsInPipelineAllOfData](docs/Model/GetDealsMovementsInPipelineAllOfData.md) + - [GetDealsMovementsInPipelineAllOfDataAverageAgeInDays](docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.md) + - [GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages](docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md) + - [GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages](docs/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md) + - [GetDealsRelatedObjects](docs/Model/GetDealsRelatedObjects.md) + - [GetDealsSummary](docs/Model/GetDealsSummary.md) + - [GetDealsSummaryData](docs/Model/GetDealsSummaryData.md) + - [GetDealsSummaryDataValuesTotal](docs/Model/GetDealsSummaryDataValuesTotal.md) + - [GetDealsSummaryDataWeightedValuesTotal](docs/Model/GetDealsSummaryDataWeightedValuesTotal.md) + - [GetDealsTimeline](docs/Model/GetDealsTimeline.md) + - [GetDealsTimelineData](docs/Model/GetDealsTimelineData.md) + - [GetDealsTimelineDataTotals](docs/Model/GetDealsTimelineDataTotals.md) + - [GetDuplicatedDeal](docs/Model/GetDuplicatedDeal.md) + - [GetGoalResultResponse200](docs/Model/GetGoalResultResponse200.md) + - [GetGoalsResponse200](docs/Model/GetGoalsResponse200.md) + - [GetLeadLabelsResponse200](docs/Model/GetLeadLabelsResponse200.md) + - [GetLeadSourcesResponse200](docs/Model/GetLeadSourcesResponse200.md) + - [GetLeadSourcesResponse200Data](docs/Model/GetLeadSourcesResponse200Data.md) + - [GetLeadsResponse200](docs/Model/GetLeadsResponse200.md) + - [GetMergedDeal](docs/Model/GetMergedDeal.md) + - [GetNotes](docs/Model/GetNotes.md) + - [GetOneFile](docs/Model/GetOneFile.md) + - [GetOnePipeline](docs/Model/GetOnePipeline.md) + - [GetOnePipelineAllOf](docs/Model/GetOnePipelineAllOf.md) + - [GetOneStage](docs/Model/GetOneStage.md) + - [GetPersonDetailsResponse](docs/Model/GetPersonDetailsResponse.md) + - [GetPersonDetailsResponseAllOf](docs/Model/GetPersonDetailsResponseAllOf.md) + - [GetPersonDetailsResponseAllOfAdditionalData](docs/Model/GetPersonDetailsResponseAllOfAdditionalData.md) + - [GetProductAttachementDetails](docs/Model/GetProductAttachementDetails.md) + - [GetProductFieldResponse](docs/Model/GetProductFieldResponse.md) + - [GetRecents](docs/Model/GetRecents.md) + - [GetRecentsAdditionalData](docs/Model/GetRecentsAdditionalData.md) + - [GetRole](docs/Model/GetRole.md) + - [GetRoleAllOf](docs/Model/GetRoleAllOf.md) + - [GetRoleAllOfAdditionalData](docs/Model/GetRoleAllOfAdditionalData.md) + - [GetRoleAssignments](docs/Model/GetRoleAssignments.md) + - [GetRoleAssignmentsAllOf](docs/Model/GetRoleAssignmentsAllOf.md) + - [GetRolePipelines](docs/Model/GetRolePipelines.md) + - [GetRolePipelinesAllOf](docs/Model/GetRolePipelinesAllOf.md) + - [GetRolePipelinesAllOfData](docs/Model/GetRolePipelinesAllOfData.md) + - [GetRoleSettings](docs/Model/GetRoleSettings.md) + - [GetRoleSettingsAllOf](docs/Model/GetRoleSettingsAllOf.md) + - [GetRoles](docs/Model/GetRoles.md) + - [GetRolesAllOf](docs/Model/GetRolesAllOf.md) + - [GetStageDeals](docs/Model/GetStageDeals.md) + - [GetStages](docs/Model/GetStages.md) + - [GoalResults](docs/Model/GoalResults.md) + - [GoalType](docs/Model/GoalType.md) + - [GoalsResponseComponent](docs/Model/GoalsResponseComponent.md) + - [IconKey](docs/Model/IconKey.md) + - [InlineResponse200](docs/Model/InlineResponse200.md) + - [InlineResponse400](docs/Model/InlineResponse400.md) + - [InlineResponse4001](docs/Model/InlineResponse4001.md) + - [InlineResponse4001AdditionalData](docs/Model/InlineResponse4001AdditionalData.md) + - [InlineResponse400AdditionalData](docs/Model/InlineResponse400AdditionalData.md) + - [InlineResponse403](docs/Model/InlineResponse403.md) + - [InlineResponse4031](docs/Model/InlineResponse4031.md) + - [InlineResponse4031AdditionalData](docs/Model/InlineResponse4031AdditionalData.md) + - [InlineResponse403AdditionalData](docs/Model/InlineResponse403AdditionalData.md) + - [InlineResponse404](docs/Model/InlineResponse404.md) + - [InlineResponse404AdditionalData](docs/Model/InlineResponse404AdditionalData.md) + - [ItemSearchAdditionalData](docs/Model/ItemSearchAdditionalData.md) + - [ItemSearchAdditionalDataPagination](docs/Model/ItemSearchAdditionalDataPagination.md) + - [ItemSearchFieldResponse](docs/Model/ItemSearchFieldResponse.md) + - [ItemSearchFieldResponseAllOf](docs/Model/ItemSearchFieldResponseAllOf.md) + - [ItemSearchFieldResponseAllOfData](docs/Model/ItemSearchFieldResponseAllOfData.md) + - [ItemSearchItem](docs/Model/ItemSearchItem.md) + - [ItemSearchResponse](docs/Model/ItemSearchResponse.md) + - [ItemSearchResponseAllOf](docs/Model/ItemSearchResponseAllOf.md) + - [ItemSearchResponseAllOfData](docs/Model/ItemSearchResponseAllOfData.md) + - [LeadIdResponse200](docs/Model/LeadIdResponse200.md) + - [LeadIdResponse200Data](docs/Model/LeadIdResponse200Data.md) + - [LeadLabelColor](docs/Model/LeadLabelColor.md) + - [LeadLabelResponse](docs/Model/LeadLabelResponse.md) + - [LeadResponse](docs/Model/LeadResponse.md) + - [LeadResponse404](docs/Model/LeadResponse404.md) + - [LeadSearchItem](docs/Model/LeadSearchItem.md) + - [LeadSearchItemItem](docs/Model/LeadSearchItemItem.md) + - [LeadSearchItemItemOrganization](docs/Model/LeadSearchItemItemOrganization.md) + - [LeadSearchItemItemOwner](docs/Model/LeadSearchItemItemOwner.md) + - [LeadSearchItemItemPerson](docs/Model/LeadSearchItemItemPerson.md) + - [LeadSearchResponse](docs/Model/LeadSearchResponse.md) + - [LeadSearchResponseAllOf](docs/Model/LeadSearchResponseAllOf.md) + - [LeadSearchResponseAllOfData](docs/Model/LeadSearchResponseAllOfData.md) + - [LeadValue](docs/Model/LeadValue.md) + - [LinkRemoteFileToItem](docs/Model/LinkRemoteFileToItem.md) + - [ListActivitiesResponse](docs/Model/ListActivitiesResponse.md) + - [ListActivitiesResponseAllOf](docs/Model/ListActivitiesResponseAllOf.md) + - [ListDealsResponse](docs/Model/ListDealsResponse.md) + - [ListDealsResponseAllOf](docs/Model/ListDealsResponseAllOf.md) + - [ListDealsResponseAllOfRelatedObjects](docs/Model/ListDealsResponseAllOfRelatedObjects.md) + - [ListFilesResponse](docs/Model/ListFilesResponse.md) + - [ListFilesResponseAllOf](docs/Model/ListFilesResponseAllOf.md) + - [ListFollowersResponse](docs/Model/ListFollowersResponse.md) + - [ListFollowersResponseAllOf](docs/Model/ListFollowersResponseAllOf.md) + - [ListFollowersResponseAllOfData](docs/Model/ListFollowersResponseAllOfData.md) + - [ListMailMessagesResponse](docs/Model/ListMailMessagesResponse.md) + - [ListMailMessagesResponseAllOf](docs/Model/ListMailMessagesResponseAllOf.md) + - [ListMailMessagesResponseAllOfData](docs/Model/ListMailMessagesResponseAllOfData.md) + - [ListPermittedUsersResponse](docs/Model/ListPermittedUsersResponse.md) + - [ListPermittedUsersResponse1](docs/Model/ListPermittedUsersResponse1.md) + - [ListPermittedUsersResponse1AllOf](docs/Model/ListPermittedUsersResponse1AllOf.md) + - [ListPermittedUsersResponseAllOf](docs/Model/ListPermittedUsersResponseAllOf.md) + - [ListPermittedUsersResponseAllOfData](docs/Model/ListPermittedUsersResponseAllOfData.md) + - [ListPersonProductsResponse](docs/Model/ListPersonProductsResponse.md) + - [ListPersonProductsResponseAllOf](docs/Model/ListPersonProductsResponseAllOf.md) + - [ListPersonProductsResponseAllOfDEALID](docs/Model/ListPersonProductsResponseAllOfDEALID.md) + - [ListPersonProductsResponseAllOfData](docs/Model/ListPersonProductsResponseAllOfData.md) + - [ListPersonsResponse](docs/Model/ListPersonsResponse.md) + - [ListPersonsResponseAllOf](docs/Model/ListPersonsResponseAllOf.md) + - [ListPersonsResponseAllOfRelatedObjects](docs/Model/ListPersonsResponseAllOfRelatedObjects.md) + - [ListProductAdditionalData](docs/Model/ListProductAdditionalData.md) + - [ListProductAdditionalDataAllOf](docs/Model/ListProductAdditionalDataAllOf.md) + - [ListProductFilesResponse](docs/Model/ListProductFilesResponse.md) + - [ListProductFilesResponseAllOf](docs/Model/ListProductFilesResponseAllOf.md) + - [ListProductFollowersResponse](docs/Model/ListProductFollowersResponse.md) + - [ListProductFollowersResponseAllOf](docs/Model/ListProductFollowersResponseAllOf.md) + - [ListProductFollowersResponseAllOfData](docs/Model/ListProductFollowersResponseAllOfData.md) + - [ListProductsResponse](docs/Model/ListProductsResponse.md) + - [ListProductsResponseAllOf](docs/Model/ListProductsResponseAllOf.md) + - [ListProductsResponseAllOfData](docs/Model/ListProductsResponseAllOfData.md) + - [ListProductsResponseAllOfRelatedObjects](docs/Model/ListProductsResponseAllOfRelatedObjects.md) + - [MailMessage](docs/Model/MailMessage.md) + - [MailMessageAllOf](docs/Model/MailMessageAllOf.md) + - [MailMessageData](docs/Model/MailMessageData.md) + - [MailMessageItemForList](docs/Model/MailMessageItemForList.md) + - [MailMessageItemForListAllOf](docs/Model/MailMessageItemForListAllOf.md) + - [MailParticipant](docs/Model/MailParticipant.md) + - [MailServiceBaseResponse](docs/Model/MailServiceBaseResponse.md) + - [MailThread](docs/Model/MailThread.md) + - [MailThreadAllOf](docs/Model/MailThreadAllOf.md) + - [MailThreadDelete](docs/Model/MailThreadDelete.md) + - [MailThreadDeleteAllOf](docs/Model/MailThreadDeleteAllOf.md) + - [MailThreadDeleteAllOfData](docs/Model/MailThreadDeleteAllOfData.md) + - [MailThreadMessages](docs/Model/MailThreadMessages.md) + - [MailThreadMessagesAllOf](docs/Model/MailThreadMessagesAllOf.md) + - [MailThreadOne](docs/Model/MailThreadOne.md) + - [MailThreadOneAllOf](docs/Model/MailThreadOneAllOf.md) + - [MailThreadParticipant](docs/Model/MailThreadParticipant.md) + - [MailThreadPut](docs/Model/MailThreadPut.md) + - [MailThreadPutAllOf](docs/Model/MailThreadPutAllOf.md) + - [MarketingStatus](docs/Model/MarketingStatus.md) + - [MergeDealsRequest](docs/Model/MergeDealsRequest.md) + - [MergeOrganizationsRequest](docs/Model/MergeOrganizationsRequest.md) + - [MergePersonDealRelatedInfo](docs/Model/MergePersonDealRelatedInfo.md) + - [MergePersonItem](docs/Model/MergePersonItem.md) + - [MergePersonsRequest](docs/Model/MergePersonsRequest.md) + - [MergePersonsResponse](docs/Model/MergePersonsResponse.md) + - [MergePersonsResponseAllOf](docs/Model/MergePersonsResponseAllOf.md) + - [MessageObject](docs/Model/MessageObject.md) + - [MessageObjectAttachments](docs/Model/MessageObjectAttachments.md) + - [NewDeal](docs/Model/NewDeal.md) + - [NewDealAllOf](docs/Model/NewDealAllOf.md) + - [NewDealProduct](docs/Model/NewDealProduct.md) + - [NewFollowerResponse](docs/Model/NewFollowerResponse.md) + - [NewFollowerResponseData](docs/Model/NewFollowerResponseData.md) + - [NewGoal](docs/Model/NewGoal.md) + - [NewOrganization](docs/Model/NewOrganization.md) + - [NewOrganizationAllOf](docs/Model/NewOrganizationAllOf.md) + - [NewPerson](docs/Model/NewPerson.md) + - [NewPersonAllOf](docs/Model/NewPersonAllOf.md) + - [NewProductField](docs/Model/NewProductField.md) + - [Note](docs/Model/Note.md) + - [NoteAllOf](docs/Model/NoteAllOf.md) + - [NoteConnectToParams](docs/Model/NoteConnectToParams.md) + - [NoteCreatorUser](docs/Model/NoteCreatorUser.md) + - [NoteField](docs/Model/NoteField.md) + - [NoteFieldOptions](docs/Model/NoteFieldOptions.md) + - [NoteFieldsResponse](docs/Model/NoteFieldsResponse.md) + - [NoteFieldsResponseAllOf](docs/Model/NoteFieldsResponseAllOf.md) + - [NoteParams](docs/Model/NoteParams.md) + - [NumberBoolean](docs/Model/NumberBoolean.md) + - [NumberBooleanDefault0](docs/Model/NumberBooleanDefault0.md) + - [NumberBooleanDefault1](docs/Model/NumberBooleanDefault1.md) + - [ObjectPrices](docs/Model/ObjectPrices.md) + - [OneLeadResponse200](docs/Model/OneLeadResponse200.md) + - [OptionalNameObject](docs/Model/OptionalNameObject.md) + - [OrgAndOwnerId](docs/Model/OrgAndOwnerId.md) + - [OrganizationAddressInfo](docs/Model/OrganizationAddressInfo.md) + - [OrganizationCountAndAddressInfo](docs/Model/OrganizationCountAndAddressInfo.md) + - [OrganizationCountInfo](docs/Model/OrganizationCountInfo.md) + - [OrganizationData](docs/Model/OrganizationData.md) + - [OrganizationDataWithId](docs/Model/OrganizationDataWithId.md) + - [OrganizationDataWithIdAllOf](docs/Model/OrganizationDataWithIdAllOf.md) + - [OrganizationDataWithIdAndActiveFlag](docs/Model/OrganizationDataWithIdAndActiveFlag.md) + - [OrganizationDataWithIdAndActiveFlagAllOf](docs/Model/OrganizationDataWithIdAndActiveFlagAllOf.md) + - [OrganizationDeleteResponse](docs/Model/OrganizationDeleteResponse.md) + - [OrganizationDeleteResponseData](docs/Model/OrganizationDeleteResponseData.md) + - [OrganizationDetailsGetResponse](docs/Model/OrganizationDetailsGetResponse.md) + - [OrganizationDetailsGetResponseAllOf](docs/Model/OrganizationDetailsGetResponseAllOf.md) + - [OrganizationDetailsGetResponseAllOfAdditionalData](docs/Model/OrganizationDetailsGetResponseAllOfAdditionalData.md) + - [OrganizationFlowResponse](docs/Model/OrganizationFlowResponse.md) + - [OrganizationFlowResponseAllOf](docs/Model/OrganizationFlowResponseAllOf.md) + - [OrganizationFlowResponseAllOfData](docs/Model/OrganizationFlowResponseAllOfData.md) + - [OrganizationFlowResponseAllOfRelatedObjects](docs/Model/OrganizationFlowResponseAllOfRelatedObjects.md) + - [OrganizationFollowerDeleteResponse](docs/Model/OrganizationFollowerDeleteResponse.md) + - [OrganizationFollowerDeleteResponseData](docs/Model/OrganizationFollowerDeleteResponseData.md) + - [OrganizationFollowerItem](docs/Model/OrganizationFollowerItem.md) + - [OrganizationFollowerItemAllOf](docs/Model/OrganizationFollowerItemAllOf.md) + - [OrganizationFollowerPostResponse](docs/Model/OrganizationFollowerPostResponse.md) + - [OrganizationFollowersListResponse](docs/Model/OrganizationFollowersListResponse.md) + - [OrganizationItem](docs/Model/OrganizationItem.md) + - [OrganizationItemAllOf](docs/Model/OrganizationItemAllOf.md) + - [OrganizationPostResponse](docs/Model/OrganizationPostResponse.md) + - [OrganizationPostResponseAllOf](docs/Model/OrganizationPostResponseAllOf.md) + - [OrganizationRelationship](docs/Model/OrganizationRelationship.md) + - [OrganizationRelationshipDeleteResponse](docs/Model/OrganizationRelationshipDeleteResponse.md) + - [OrganizationRelationshipDeleteResponseAllOf](docs/Model/OrganizationRelationshipDeleteResponseAllOf.md) + - [OrganizationRelationshipDeleteResponseAllOfData](docs/Model/OrganizationRelationshipDeleteResponseAllOfData.md) + - [OrganizationRelationshipDetails](docs/Model/OrganizationRelationshipDetails.md) + - [OrganizationRelationshipGetResponse](docs/Model/OrganizationRelationshipGetResponse.md) + - [OrganizationRelationshipGetResponseAllOf](docs/Model/OrganizationRelationshipGetResponseAllOf.md) + - [OrganizationRelationshipPostResponse](docs/Model/OrganizationRelationshipPostResponse.md) + - [OrganizationRelationshipPostResponseAllOf](docs/Model/OrganizationRelationshipPostResponseAllOf.md) + - [OrganizationRelationshipUpdateResponse](docs/Model/OrganizationRelationshipUpdateResponse.md) + - [OrganizationRelationshipWithCalculatedFields](docs/Model/OrganizationRelationshipWithCalculatedFields.md) + - [OrganizationSearchItem](docs/Model/OrganizationSearchItem.md) + - [OrganizationSearchItemItem](docs/Model/OrganizationSearchItemItem.md) + - [OrganizationSearchResponse](docs/Model/OrganizationSearchResponse.md) + - [OrganizationSearchResponseAllOf](docs/Model/OrganizationSearchResponseAllOf.md) + - [OrganizationSearchResponseAllOfData](docs/Model/OrganizationSearchResponseAllOfData.md) + - [OrganizationUpdateResponse](docs/Model/OrganizationUpdateResponse.md) + - [OrganizationUpdateResponseAllOf](docs/Model/OrganizationUpdateResponseAllOf.md) + - [OrganizationsDeleteResponse](docs/Model/OrganizationsDeleteResponse.md) + - [OrganizationsDeleteResponseData](docs/Model/OrganizationsDeleteResponseData.md) + - [OrganizationsMergeResponse](docs/Model/OrganizationsMergeResponse.md) + - [OrganizationsMergeResponseData](docs/Model/OrganizationsMergeResponseData.md) + - [Owner](docs/Model/Owner.md) + - [OwnerAllOf](docs/Model/OwnerAllOf.md) + - [PaginationDetails](docs/Model/PaginationDetails.md) + - [PaginationDetailsAllOf](docs/Model/PaginationDetailsAllOf.md) + - [Params](docs/Model/Params.md) + - [PaymentItem](docs/Model/PaymentItem.md) + - [PaymentsResponse](docs/Model/PaymentsResponse.md) + - [PaymentsResponseAllOf](docs/Model/PaymentsResponseAllOf.md) + - [PermissionSets](docs/Model/PermissionSets.md) + - [PermissionSetsAllOf](docs/Model/PermissionSetsAllOf.md) + - [PermissionSetsItem](docs/Model/PermissionSetsItem.md) + - [PersonCountAndEmailInfo](docs/Model/PersonCountAndEmailInfo.md) + - [PersonCountEmailDealAndActivityInfo](docs/Model/PersonCountEmailDealAndActivityInfo.md) + - [PersonCountInfo](docs/Model/PersonCountInfo.md) + - [PersonData](docs/Model/PersonData.md) + - [PersonDataEmail](docs/Model/PersonDataEmail.md) + - [PersonDataPhone](docs/Model/PersonDataPhone.md) + - [PersonDataWithActiveFlag](docs/Model/PersonDataWithActiveFlag.md) + - [PersonDataWithActiveFlagAllOf](docs/Model/PersonDataWithActiveFlagAllOf.md) + - [PersonFlowResponse](docs/Model/PersonFlowResponse.md) + - [PersonFlowResponseAllOf](docs/Model/PersonFlowResponseAllOf.md) + - [PersonFlowResponseAllOfData](docs/Model/PersonFlowResponseAllOfData.md) + - [PersonItem](docs/Model/PersonItem.md) + - [PersonListProduct](docs/Model/PersonListProduct.md) + - [PersonNameCountAndEmailInfo](docs/Model/PersonNameCountAndEmailInfo.md) + - [PersonNameCountAndEmailInfoWithIds](docs/Model/PersonNameCountAndEmailInfoWithIds.md) + - [PersonNameCountAndEmailInfoWithIdsAllOf](docs/Model/PersonNameCountAndEmailInfoWithIdsAllOf.md) + - [PersonNameInfo](docs/Model/PersonNameInfo.md) + - [PersonNameInfoWithOrgAndOwnerId](docs/Model/PersonNameInfoWithOrgAndOwnerId.md) + - [PersonSearchItem](docs/Model/PersonSearchItem.md) + - [PersonSearchItemItem](docs/Model/PersonSearchItemItem.md) + - [PersonSearchItemItemOrganization](docs/Model/PersonSearchItemItemOrganization.md) + - [PersonSearchItemItemOwner](docs/Model/PersonSearchItemItemOwner.md) + - [PersonSearchResponse](docs/Model/PersonSearchResponse.md) + - [PersonSearchResponseAllOf](docs/Model/PersonSearchResponseAllOf.md) + - [PersonSearchResponseAllOfData](docs/Model/PersonSearchResponseAllOfData.md) + - [PictureData](docs/Model/PictureData.md) + - [PictureDataPictures](docs/Model/PictureDataPictures.md) + - [PictureDataWithID](docs/Model/PictureDataWithID.md) + - [PictureDataWithIDAllOf](docs/Model/PictureDataWithIDAllOf.md) + - [PictureDataWithValue](docs/Model/PictureDataWithValue.md) + - [PictureDataWithValueAllOf](docs/Model/PictureDataWithValueAllOf.md) + - [Pipeline](docs/Model/Pipeline.md) + - [PipelineDetails](docs/Model/PipelineDetails.md) + - [PipelineDetailsAllOf](docs/Model/PipelineDetailsAllOf.md) + - [PostComment](docs/Model/PostComment.md) + - [PostDealParticipants](docs/Model/PostDealParticipants.md) + - [PostGoalResponse](docs/Model/PostGoalResponse.md) + - [PostNote](docs/Model/PostNote.md) + - [PostRoleAssignment](docs/Model/PostRoleAssignment.md) + - [PostRoleAssignmentAllOf](docs/Model/PostRoleAssignmentAllOf.md) + - [PostRoleAssignmentAllOfData](docs/Model/PostRoleAssignmentAllOfData.md) + - [PostRoleSettings](docs/Model/PostRoleSettings.md) + - [PostRoleSettingsAllOf](docs/Model/PostRoleSettingsAllOf.md) + - [PostRoleSettingsAllOfData](docs/Model/PostRoleSettingsAllOfData.md) + - [PostRoles](docs/Model/PostRoles.md) + - [PostRolesAllOf](docs/Model/PostRolesAllOf.md) + - [PostRolesAllOfData](docs/Model/PostRolesAllOfData.md) + - [ProductAttachementFields](docs/Model/ProductAttachementFields.md) + - [ProductAttachmentDetails](docs/Model/ProductAttachmentDetails.md) + - [ProductBaseDeal](docs/Model/ProductBaseDeal.md) + - [ProductField](docs/Model/ProductField.md) + - [ProductFieldAllOf](docs/Model/ProductFieldAllOf.md) + - [ProductFileItem](docs/Model/ProductFileItem.md) + - [ProductListItem](docs/Model/ProductListItem.md) + - [ProductRequest](docs/Model/ProductRequest.md) + - [ProductResponse](docs/Model/ProductResponse.md) + - [ProductSearchItem](docs/Model/ProductSearchItem.md) + - [ProductSearchItemItem](docs/Model/ProductSearchItemItem.md) + - [ProductSearchItemItemOwner](docs/Model/ProductSearchItemItemOwner.md) + - [ProductSearchResponse](docs/Model/ProductSearchResponse.md) + - [ProductSearchResponseAllOf](docs/Model/ProductSearchResponseAllOf.md) + - [ProductSearchResponseAllOfData](docs/Model/ProductSearchResponseAllOfData.md) + - [ProductWithArrayPrices](docs/Model/ProductWithArrayPrices.md) + - [ProductWithObjectPrices](docs/Model/ProductWithObjectPrices.md) + - [ProductsResponse](docs/Model/ProductsResponse.md) + - [PutRole](docs/Model/PutRole.md) + - [PutRoleAllOf](docs/Model/PutRoleAllOf.md) + - [PutRoleAllOfData](docs/Model/PutRoleAllOfData.md) + - [PutRolePipelinesBody](docs/Model/PutRolePipelinesBody.md) + - [RecentDataProduct](docs/Model/RecentDataProduct.md) + - [RecentsActivity](docs/Model/RecentsActivity.md) + - [RecentsActivityType](docs/Model/RecentsActivityType.md) + - [RecentsDeal](docs/Model/RecentsDeal.md) + - [RecentsFile](docs/Model/RecentsFile.md) + - [RecentsFilter](docs/Model/RecentsFilter.md) + - [RecentsNote](docs/Model/RecentsNote.md) + - [RecentsOrganization](docs/Model/RecentsOrganization.md) + - [RecentsPerson](docs/Model/RecentsPerson.md) + - [RecentsPipeline](docs/Model/RecentsPipeline.md) + - [RecentsProduct](docs/Model/RecentsProduct.md) + - [RecentsStage](docs/Model/RecentsStage.md) + - [RecentsUser](docs/Model/RecentsUser.md) + - [RelatedDealData](docs/Model/RelatedDealData.md) + - [RelatedDealDataDEALID](docs/Model/RelatedDealDataDEALID.md) + - [RelatedFollowerData](docs/Model/RelatedFollowerData.md) + - [RelatedOrganizationData](docs/Model/RelatedOrganizationData.md) + - [RelatedOrganizationDataWithActiveFlag](docs/Model/RelatedOrganizationDataWithActiveFlag.md) + - [RelatedOrganizationName](docs/Model/RelatedOrganizationName.md) + - [RelatedPersonData](docs/Model/RelatedPersonData.md) + - [RelatedPersonDataWithActiveFlag](docs/Model/RelatedPersonDataWithActiveFlag.md) + - [RelatedPictureData](docs/Model/RelatedPictureData.md) + - [RelatedUserData](docs/Model/RelatedUserData.md) + - [RelationshipOrganizationInfoItem](docs/Model/RelationshipOrganizationInfoItem.md) + - [RelationshipOrganizationInfoItemAllOf](docs/Model/RelationshipOrganizationInfoItemAllOf.md) + - [RelationshipOrganizationInfoItemWithActiveFlag](docs/Model/RelationshipOrganizationInfoItemWithActiveFlag.md) + - [RequiredNameObject](docs/Model/RequiredNameObject.md) + - [RequredTitleParameter](docs/Model/RequredTitleParameter.md) + - [ResponseCallLogObject](docs/Model/ResponseCallLogObject.md) + - [ResponseCallLogObjectAllOf](docs/Model/ResponseCallLogObjectAllOf.md) + - [RoleAssignment](docs/Model/RoleAssignment.md) + - [RoleAssignmentAllOf](docs/Model/RoleAssignmentAllOf.md) + - [RoleSettings](docs/Model/RoleSettings.md) + - [RolesAdditionalData](docs/Model/RolesAdditionalData.md) + - [RolesAdditionalDataPagination](docs/Model/RolesAdditionalDataPagination.md) + - [SinglePermissionSetsItem](docs/Model/SinglePermissionSetsItem.md) + - [SinglePermissionSetsItemAllOf](docs/Model/SinglePermissionSetsItemAllOf.md) + - [Stage](docs/Model/Stage.md) + - [StageConversions](docs/Model/StageConversions.md) + - [StageDetails](docs/Model/StageDetails.md) + - [StageWithPipelineInfo](docs/Model/StageWithPipelineInfo.md) + - [StageWithPipelineInfoAllOf](docs/Model/StageWithPipelineInfoAllOf.md) + - [SubRole](docs/Model/SubRole.md) + - [SubRoleAllOf](docs/Model/SubRoleAllOf.md) + - [SubscriptionAddonsResponse](docs/Model/SubscriptionAddonsResponse.md) + - [SubscriptionAddonsResponseAllOf](docs/Model/SubscriptionAddonsResponseAllOf.md) + - [SubscriptionInstallmentCreateRequest](docs/Model/SubscriptionInstallmentCreateRequest.md) + - [SubscriptionInstallmentUpdateRequest](docs/Model/SubscriptionInstallmentUpdateRequest.md) + - [SubscriptionItem](docs/Model/SubscriptionItem.md) + - [SubscriptionRecurringCancelRequest](docs/Model/SubscriptionRecurringCancelRequest.md) + - [SubscriptionRecurringCreateRequest](docs/Model/SubscriptionRecurringCreateRequest.md) + - [SubscriptionRecurringUpdateRequest](docs/Model/SubscriptionRecurringUpdateRequest.md) + - [SubscriptionsIdResponse](docs/Model/SubscriptionsIdResponse.md) + - [SubscriptionsIdResponseAllOf](docs/Model/SubscriptionsIdResponseAllOf.md) + - [Team](docs/Model/Team.md) + - [TeamAllOf](docs/Model/TeamAllOf.md) + - [TeamId](docs/Model/TeamId.md) + - [Teams](docs/Model/Teams.md) + - [TeamsAllOf](docs/Model/TeamsAllOf.md) + - [Unauthorized](docs/Model/Unauthorized.md) + - [UpdateActivityResponse200](docs/Model/UpdateActivityResponse200.md) + - [UpdateDealProduct](docs/Model/UpdateDealProduct.md) + - [UpdateDealRequest](docs/Model/UpdateDealRequest.md) + - [UpdateFile](docs/Model/UpdateFile.md) + - [UpdateFilterRequest](docs/Model/UpdateFilterRequest.md) + - [UpdateLeadLabelRequest](docs/Model/UpdateLeadLabelRequest.md) + - [UpdateLeadRequest](docs/Model/UpdateLeadRequest.md) + - [UpdateOrganization](docs/Model/UpdateOrganization.md) + - [UpdateOrganizationAllOf](docs/Model/UpdateOrganizationAllOf.md) + - [UpdatePerson](docs/Model/UpdatePerson.md) + - [UpdatePersonAllOf](docs/Model/UpdatePersonAllOf.md) + - [UpdatePersonResponse](docs/Model/UpdatePersonResponse.md) + - [UpdateProductField](docs/Model/UpdateProductField.md) + - [UpdateProductRequestBody](docs/Model/UpdateProductRequestBody.md) + - [UpdateProductResponse](docs/Model/UpdateProductResponse.md) + - [UpdateStageRequest](docs/Model/UpdateStageRequest.md) + - [UpdateStageRequestAllOf](docs/Model/UpdateStageRequestAllOf.md) + - [UpdateTeam](docs/Model/UpdateTeam.md) + - [UpdateTeamAllOf](docs/Model/UpdateTeamAllOf.md) + - [UpdateTeamWithAdditionalProperties](docs/Model/UpdateTeamWithAdditionalProperties.md) + - [UpdateUserRequest](docs/Model/UpdateUserRequest.md) + - [User](docs/Model/User.md) + - [UserAccess](docs/Model/UserAccess.md) + - [UserAllOf](docs/Model/UserAllOf.md) + - [UserAssignmentToPermissionSet](docs/Model/UserAssignmentToPermissionSet.md) + - [UserAssignmentsToPermissionSet](docs/Model/UserAssignmentsToPermissionSet.md) + - [UserAssignmentsToPermissionSetAllOf](docs/Model/UserAssignmentsToPermissionSetAllOf.md) + - [UserConnections](docs/Model/UserConnections.md) + - [UserConnectionsAllOf](docs/Model/UserConnectionsAllOf.md) + - [UserConnectionsAllOfData](docs/Model/UserConnectionsAllOfData.md) + - [UserData](docs/Model/UserData.md) + - [UserDataWithId](docs/Model/UserDataWithId.md) + - [UserIDs](docs/Model/UserIDs.md) + - [UserIDsAllOf](docs/Model/UserIDsAllOf.md) + - [UserMe](docs/Model/UserMe.md) + - [UserMeAllOf](docs/Model/UserMeAllOf.md) + - [UserPermissions](docs/Model/UserPermissions.md) + - [UserPermissionsAllOf](docs/Model/UserPermissionsAllOf.md) + - [UserPermissionsItem](docs/Model/UserPermissionsItem.md) + - [UserSettings](docs/Model/UserSettings.md) + - [UserSettingsAllOf](docs/Model/UserSettingsAllOf.md) + - [UserSettingsItem](docs/Model/UserSettingsItem.md) + - [Users](docs/Model/Users.md) + - [UsersAllOf](docs/Model/UsersAllOf.md) + - [VisibleTo](docs/Model/VisibleTo.md) + - [Webhook](docs/Model/Webhook.md) + - [WebhookAllOf](docs/Model/WebhookAllOf.md) + - [WebhookBadRequest](docs/Model/WebhookBadRequest.md) + - [WebhookBadRequestAllOf](docs/Model/WebhookBadRequestAllOf.md) + - [Webhooks](docs/Model/Webhooks.md) + - [WebhooksAllOf](docs/Model/WebhooksAllOf.md) + - [WebhooksDeleteForbiddenSchema](docs/Model/WebhooksDeleteForbiddenSchema.md) + - [WebhooksDeleteForbiddenSchemaAllOf](docs/Model/WebhooksDeleteForbiddenSchemaAllOf.md) + + +## Documentation for authorization + + + +## api_key + + +- **Type**: API key +- **API key parameter name**: api_token +- **Location**: URL query string + + + + +## oauth2 + + +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: https://oauth.pipedrive.com/oauth/authorize +- **Scopes**: +- **base**: Read settings of the authorized user and currencies in an account +- **deals:read**: Read most of the data about deals and related entities - deal fields, products, followers, participants; all notes, files, filters, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal) +- **deals:full**: Create, read, update and delete deals, its participants and followers; all files, notes, and filters. It also includes read access to deal fields, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal) +- **mail:read**: Read mail threads and messages +- **mail:full**: Read, update and delete mail threads. Also grants read access to mail messages +- **activities:read**: Read activities, its fields and types; all files and filters +- **activities:full**: Create, read, update and delete activities and all files and filters. Also includes read access to activity fields and types +- **contacts:read**: Read the data about persons and organizations, their related fields and followers; also all notes, files, filters +- **contacts:full**: Create, read, update and delete persons and organizations and their followers; all notes, files, filters. Also grants read access to contacts-related fields +- **products:read**: Read products, its fields, files, followers and products connected to a deal +- **products:full**: Create, read, update and delete products and its fields; add products to deals +- **users:read**: Read data about users (people with access to a Pipedrive account), their permissions, roles and followers +- **recents:read**: Read all recent changes occurred in an account. Includes data about activities, activity types, deals, files, filters, notes, persons, organizations, pipelines, stages, products and users +- **search:read**: Search across the account for deals, persons, organizations, files and products, and see details about the returned results +- **admin**: Allows to do many things that an administrator can do in a Pipedrive company account - create, read, update and delete pipelines and its stages; deal, person and organization fields; activity types; users and permissions, etc. It also allows the app to create webhooks and fetch and delete webhooks that are created by the app +- **leads:read**: Read data about leads and lead labels +- **leads:full**: Create, read, update and delete leads and lead labels +- **phone-integration**: Enables advanced call integration features like logging call duration and other metadata, and play call recordings inside Pipedrive +- **goals:read**: Read data on all goals +- **goals:full**: Create, read, update and delete goals +- **video-calls**: Allows application to register as a video call integration provider and create conference links +- **messengers-integration**: Allows application to register as a messengers integration provider and allows them to deliver incoming messages and their statuses + + +## Author + + + + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/composer.json b/composer.json index 3c9e03a6..1299d1f6 100644 --- a/composer.json +++ b/composer.json @@ -15,20 +15,30 @@ "homepage": "https://github.com/pipedrive/client-php", "license": "MIT", "require": { - "php": ">=5.4.0", + "php": "^7.4 || ^8.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "mashape/unirest-php": "~3.0.1", - "apimatic/jsonmapper": "~1.3.0" + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^2.0" }, "require-dev": { - "squizlabs/php_codesniffer": "^2.7", - "phpunit/phpunit": "4.8.*" + "pestphp/pest": "^1.23", + "phpstan/phpstan": "^1.10" }, "autoload": { - "psr-4": { - "Pipedrive\\": "src/" + "psr-4": { "Pipedrive\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "Pipedrive\\Tests\\Unit\\" : "test/" } + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true } + }, + "scripts": { + "test": "./vendor/bin/pest", + "analyse": "./vendor/bin/phpstan analyse" } -} \ No newline at end of file +} diff --git a/docs/Api/ActivitiesApi.md b/docs/Api/ActivitiesApi.md new file mode 100644 index 00000000..272bd3c1 --- /dev/null +++ b/docs/Api/ActivitiesApi.md @@ -0,0 +1,497 @@ +# Pipedrive\ActivitiesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addActivity()**](ActivitiesApi.md#addActivity) | **POST** /activities | Add an activity +[**deleteActivities()**](ActivitiesApi.md#deleteActivities) | **DELETE** /activities | Delete multiple activities in bulk +[**deleteActivity()**](ActivitiesApi.md#deleteActivity) | **DELETE** /activities/{id} | Delete an activity +[**getActivities()**](ActivitiesApi.md#getActivities) | **GET** /activities | Get all activities assigned to a particular user +[**getActivitiesCollection()**](ActivitiesApi.md#getActivitiesCollection) | **GET** /activities/collection | Get all activities (BETA) +[**getActivity()**](ActivitiesApi.md#getActivity) | **GET** /activities/{id} | Get details of an activity +[**updateActivity()**](ActivitiesApi.md#updateActivity) | **PUT** /activities/{id} | Update an activity + + +## `addActivity()` + +```php +addActivity($activity_post_object): \Pipedrive\Model\AddActivityResponse200 +``` + +Add an activity + +Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information, see the tutorial for adding an activity. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$activity_post_object = new \Pipedrive\Model\ActivityPostObject(); // \Pipedrive\Model\ActivityPostObject + +try { + $result = $apiInstance->addActivity($activity_post_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->addActivity: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **activity_post_object** | [**\Pipedrive\Model\ActivityPostObject**](../Model/ActivityPostObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddActivityResponse200**](../Model/AddActivityResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteActivities()` + +```php +deleteActivities($ids): \Pipedrive\Model\DeleteActivitiesResponse200 +``` + +Delete multiple activities in bulk + +Marks multiple activities as deleted. After 30 days, the activities will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated IDs of activities that will be deleted + +try { + $result = $apiInstance->deleteActivities($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->deleteActivities: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated IDs of activities that will be deleted | + +### Return type + +[**\Pipedrive\Model\DeleteActivitiesResponse200**](../Model/DeleteActivitiesResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteActivity()` + +```php +deleteActivity($id): \Pipedrive\Model\DeleteActivityResponse200 +``` + +Delete an activity + +Marks an activity as deleted. After 30 days, the activity will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use 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 activity + +try { + $result = $apiInstance->deleteActivity($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->deleteActivity: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the activity | + +### Return type + +[**\Pipedrive\Model\DeleteActivityResponse200**](../Model/DeleteActivityResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getActivities()` + +```php +getActivities($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done): \Pipedrive\Model\GetActivitiesResponse200 +``` + +Get all activities assigned to a particular user + +Returns all activities assigned to a particular user. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use 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_id = 56; // int | The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. +$filter_id = 56; // int | The ID of the filter to use (will narrow down results if used together with `user_id` parameter) +$type = 'type_example'; // string | The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. +$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. +$start = 0; // int | For pagination, the position that represents the first result for the page +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. +$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. +$done = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. + +try { + $result = $apiInstance->getActivities($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->getActivities: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. | [optional] + **filter_id** | **int**| The ID of the filter to use (will narrow down results if used together with `user_id` parameter) | [optional] + **type** | **string**| The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] + **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. | [optional] + **start** | **int**| For pagination, the position that represents the first result for the page | [optional] + **start_date** | **\DateTime**| Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. | [optional] + **end_date** | **\DateTime**| Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. | [optional] + **done** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. | [optional] + +### Return type + +[**\Pipedrive\Model\GetActivitiesResponse200**](../Model/GetActivitiesResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getActivitiesCollection()` + +```php +getActivitiesCollection($cursor, $limit, $since, $until, $user_id, $done, $type): \Pipedrive\Model\GetActivitiesCollectionResponse200 +``` + +Get all activities (BETA) + +Returns all activities. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on pagination. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions here. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page +$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. +$since = 'since_example'; // string | The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. +$until = 'until_example'; // string | The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. +$user_id = 56; // int | The ID of the user whose activities will be fetched. If omitted, all activities are returned. +$done = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. +$type = 'type_example'; // string | The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. + +try { + $result = $apiInstance->getActivitiesCollection($cursor, $limit, $since, $until, $user_id, $done, $type); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->getActivitiesCollection: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] + **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional] + **since** | **string**| The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. | [optional] + **until** | **string**| The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. | [optional] + **user_id** | **int**| The ID of the user whose activities will be fetched. If omitted, all activities are returned. | [optional] + **done** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. | [optional] + **type** | **string**| The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] + +### Return type + +[**\Pipedrive\Model\GetActivitiesCollectionResponse200**](../Model/GetActivitiesCollectionResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getActivity()` + +```php +getActivity($id): \Pipedrive\Model\GetActivityResponse200 +``` + +Get details of an activity + +Returns the details of a specific activity. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use 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 activity + +try { + $result = $apiInstance->getActivity($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->getActivity: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the activity | + +### Return type + +[**\Pipedrive\Model\GetActivityResponse200**](../Model/GetActivityResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateActivity()` + +```php +updateActivity($id, $activity_put_object): \Pipedrive\Model\UpdateActivityResponse200 +``` + +Update an activity + +Updates an activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivitiesApi( + // If you want use 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 activity +$activity_put_object = new \Pipedrive\Model\ActivityPutObject(); // \Pipedrive\Model\ActivityPutObject + +try { + $result = $apiInstance->updateActivity($id, $activity_put_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivitiesApi->updateActivity: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the activity | + **activity_put_object** | [**\Pipedrive\Model\ActivityPutObject**](../Model/ActivityPutObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\UpdateActivityResponse200**](../Model/UpdateActivityResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/ActivityFieldsApi.md b/docs/Api/ActivityFieldsApi.md new file mode 100644 index 00000000..634f7a20 --- /dev/null +++ b/docs/Api/ActivityFieldsApi.md @@ -0,0 +1,70 @@ +# Pipedrive\ActivityFieldsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getActivityFields()**](ActivityFieldsApi.md#getActivityFields) | **GET** /activityFields | Get all activity fields + + +## `getActivityFields()` + +```php +getActivityFields(): \Pipedrive\Model\FieldsResponse +``` + +Get all activity fields + +Returns all activity fields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivityFieldsApi( + // If you want use 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->getActivityFields(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivityFieldsApi->getActivityFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\FieldsResponse**](../Model/FieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/ActivityTypesApi.md b/docs/Api/ActivityTypesApi.md new file mode 100644 index 00000000..048f43c4 --- /dev/null +++ b/docs/Api/ActivityTypesApi.md @@ -0,0 +1,336 @@ +# Pipedrive\ActivityTypesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addActivityType()**](ActivityTypesApi.md#addActivityType) | **POST** /activityTypes | Add new activity type +[**deleteActivityType()**](ActivityTypesApi.md#deleteActivityType) | **DELETE** /activityTypes/{id} | Delete an activity type +[**deleteActivityTypes()**](ActivityTypesApi.md#deleteActivityTypes) | **DELETE** /activityTypes | Delete multiple activity types in bulk +[**getActivityTypes()**](ActivityTypesApi.md#getActivityTypes) | **GET** /activityTypes | Get all activity types +[**updateActivityType()**](ActivityTypesApi.md#updateActivityType) | **PUT** /activityTypes/{id} | Update an activity type + + +## `addActivityType()` + +```php +addActivityType($activity_type_create_request): \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse +``` + +Add new activity type + +Adds a new activity type. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivityTypesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$activity_type_create_request = new \Pipedrive\Model\ActivityTypeCreateRequest(); // \Pipedrive\Model\ActivityTypeCreateRequest + +try { + $result = $apiInstance->addActivityType($activity_type_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivityTypesApi->addActivityType: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **activity_type_create_request** | [**\Pipedrive\Model\ActivityTypeCreateRequest**](../Model/ActivityTypeCreateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse**](../Model/ActivityTypeCreateUpdateDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteActivityType()` + +```php +deleteActivityType($id): \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse +``` + +Delete an activity type + +Marks an activity type as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivityTypesApi( + // If you want use 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 activity type + +try { + $result = $apiInstance->deleteActivityType($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivityTypesApi->deleteActivityType: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the activity type | + +### Return type + +[**\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse**](../Model/ActivityTypeCreateUpdateDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteActivityTypes()` + +```php +deleteActivityTypes($ids): \Pipedrive\Model\ActivityTypeBulkDeleteResponse +``` + +Delete multiple activity types in bulk + +Marks multiple activity types as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivityTypesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated activity type IDs + +try { + $result = $apiInstance->deleteActivityTypes($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivityTypesApi->deleteActivityTypes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated activity type IDs | + +### Return type + +[**\Pipedrive\Model\ActivityTypeBulkDeleteResponse**](../Model/ActivityTypeBulkDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getActivityTypes()` + +```php +getActivityTypes(): \Pipedrive\Model\ActivityTypeListResponse +``` + +Get all activity types + +Returns all activity types. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivityTypesApi( + // If you want use 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->getActivityTypes(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivityTypesApi->getActivityTypes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\ActivityTypeListResponse**](../Model/ActivityTypeListResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateActivityType()` + +```php +updateActivityType($id, $activity_type_update_request): \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse +``` + +Update an activity type + +Updates an activity type. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ActivityTypesApi( + // If you want use 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 activity type +$activity_type_update_request = new \Pipedrive\Model\ActivityTypeUpdateRequest(); // \Pipedrive\Model\ActivityTypeUpdateRequest + +try { + $result = $apiInstance->updateActivityType($id, $activity_type_update_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ActivityTypesApi->updateActivityType: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the activity type | + **activity_type_update_request** | [**\Pipedrive\Model\ActivityTypeUpdateRequest**](../Model/ActivityTypeUpdateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse**](../Model/ActivityTypeCreateUpdateDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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 00000000..eebe7fd6 --- /dev/null +++ b/docs/Api/BillingApi.md @@ -0,0 +1,70 @@ +# Pipedrive\BillingApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getCompanyAddons()**](BillingApi.md#getCompanyAddons) | **GET** /billing/subscriptions/addons | Get all add-ons for a single company + + +## `getCompanyAddons()` + +```php +getCompanyAddons(): \Pipedrive\Model\SubscriptionAddonsResponse +``` + +Get all add-ons for a single company + +Returns the add-ons for a single company. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\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->getCompanyAddons(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BillingApi->getCompanyAddons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\SubscriptionAddonsResponse**](../Model/SubscriptionAddonsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/CallLogsApi.md b/docs/Api/CallLogsApi.md new file mode 100644 index 00000000..5f08ecea --- /dev/null +++ b/docs/Api/CallLogsApi.md @@ -0,0 +1,341 @@ +# Pipedrive\CallLogsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addCallLog()**](CallLogsApi.md#addCallLog) | **POST** /callLogs | Add a call log +[**addCallLogAudioFile()**](CallLogsApi.md#addCallLogAudioFile) | **POST** /callLogs/{id}/recordings | Attach an audio file to the call log +[**deleteCallLog()**](CallLogsApi.md#deleteCallLog) | **DELETE** /callLogs/{id} | Delete a call log +[**getCallLog()**](CallLogsApi.md#getCallLog) | **GET** /callLogs/{id} | Get details of a call log +[**getUserCallLogs()**](CallLogsApi.md#getUserCallLogs) | **GET** /callLogs | Get all call logs assigned to a particular user + + +## `addCallLog()` + +```php +addCallLog($call_log_object): \Pipedrive\Model\CallLogResponse200 +``` + +Add a call log + +Adds a new call log. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\CallLogsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$call_log_object = new \Pipedrive\Model\CallLogObject(); // \Pipedrive\Model\CallLogObject + +try { + $result = $apiInstance->addCallLog($call_log_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CallLogsApi->addCallLog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **call_log_object** | [**\Pipedrive\Model\CallLogObject**](../Model/CallLogObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\CallLogResponse200**](../Model/CallLogResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addCallLogAudioFile()` + +```php +addCallLogAudioFile($id, $file): \Pipedrive\Model\BaseResponse +``` + +Attach an audio file to the call log + +Adds an audio recording to the call log. That audio can be played by those who have access to the call log object. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\CallLogsApi( + // If you want use 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 = 3cde3b05035cae14dcfc172bd8000d08; // string | The ID received when you create the call log +$file = "/path/to/file.txt"; // \SplFileObject | Audio file supported by the HTML5 specification + +try { + $result = $apiInstance->addCallLogAudioFile($id, $file); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CallLogsApi->addCallLogAudioFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID received when you create the call log | + **file** | **\SplFileObject****\SplFileObject**| Audio file supported by the HTML5 specification | + +### Return type + +[**\Pipedrive\Model\BaseResponse**](../Model/BaseResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### 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) + +## `deleteCallLog()` + +```php +deleteCallLog($id): \Pipedrive\Model\BaseResponse +``` + +Delete a call log + +Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\CallLogsApi( + // If you want use 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 = 3cde3b05035cae14dcfc172bd8000d08; // string | The ID received when you create the call log + +try { + $result = $apiInstance->deleteCallLog($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CallLogsApi->deleteCallLog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID received when you create the call log | + +### Return type + +[**\Pipedrive\Model\BaseResponse**](../Model/BaseResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCallLog()` + +```php +getCallLog($id): \Pipedrive\Model\CallLogResponse200 +``` + +Get details of a call log + +Returns details of a specific call log. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\CallLogsApi( + // If you want use 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 = 3cde3b05035cae14dcfc172bd8000d08; // string | The ID received when you create the call log + +try { + $result = $apiInstance->getCallLog($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CallLogsApi->getCallLog: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID received when you create the call log | + +### Return type + +[**\Pipedrive\Model\CallLogResponse200**](../Model/CallLogResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserCallLogs()` + +```php +getUserCallLogs($start, $limit): \Pipedrive\Model\CallLogsResponse +``` + +Get all call logs assigned to a particular user + +Returns all call logs assigned to a particular user. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\CallLogsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | For pagination, the limit of entries to be returned. The upper limit is 50. + +try { + $result = $apiInstance->getUserCallLogs($start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CallLogsApi->getUserCallLogs: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| For pagination, the limit of entries to be returned. The upper limit is 50. | [optional] + +### Return type + +[**\Pipedrive\Model\CallLogsResponse**](../Model/CallLogsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/ChannelsApi.md b/docs/Api/ChannelsApi.md new file mode 100644 index 00000000..88006840 --- /dev/null +++ b/docs/Api/ChannelsApi.md @@ -0,0 +1,273 @@ +# Pipedrive\ChannelsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addChannel()**](ChannelsApi.md#addChannel) | **POST** /channels | Add a channel +[**deleteChannel()**](ChannelsApi.md#deleteChannel) | **DELETE** /channels/{id} | Delete a channel +[**deleteConversation()**](ChannelsApi.md#deleteConversation) | **DELETE** /channels/{channel-id}/conversations/{conversation-id} | Delete a conversation +[**receiveMessage()**](ChannelsApi.md#receiveMessage) | **POST** /channels/messages/receive | Receives an incoming message + + +## `addChannel()` + +```php +addChannel($channel_object): \Pipedrive\Model\ChannelObjectResponse +``` + +Add a channel + +Adds a new messaging channel, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$channel_object = new \Pipedrive\Model\ChannelObject(); // \Pipedrive\Model\ChannelObject + +try { + $result = $apiInstance->addChannel($channel_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->addChannel: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **channel_object** | [**\Pipedrive\Model\ChannelObject**](../Model/ChannelObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\ChannelObjectResponse**](../Model/ChannelObjectResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteChannel()` + +```php +deleteChannel($id): \Pipedrive\Model\DeleteChannelSuccess +``` + +Delete a channel + +Deletes an existing messenger’s channel and all related entities (conversations and messages). To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ChannelsApi( + // If you want use 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 channel provided by the integration + +try { + $result = $apiInstance->deleteChannel($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->deleteChannel: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the channel provided by the integration | + +### Return type + +[**\Pipedrive\Model\DeleteChannelSuccess**](../Model/DeleteChannelSuccess.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteConversation()` + +```php +deleteConversation($channel_id, $conversation_id): \Pipedrive\Model\DeleteConversationSuccess +``` + +Delete a conversation + +Deletes an existing conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$channel_id = 'channel_id_example'; // string | The ID of the channel provided by the integration +$conversation_id = 'conversation_id_example'; // string | The ID of the conversation provided by the integration + +try { + $result = $apiInstance->deleteConversation($channel_id, $conversation_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->deleteConversation: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **channel_id** | **string**| The ID of the channel provided by the integration | + **conversation_id** | **string**| The ID of the conversation provided by the integration | + +### Return type + +[**\Pipedrive\Model\DeleteConversationSuccess**](../Model/DeleteConversationSuccess.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `receiveMessage()` + +```php +receiveMessage($message_object): \Pipedrive\Model\InlineResponse200 +``` + +Receives an incoming message + +Adds a message to a conversation. To use the endpoint, you need to have **Messengers integration** OAuth scope enabled and the Messaging manifest ready for the [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ChannelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$message_object = new \Pipedrive\Model\MessageObject(); // \Pipedrive\Model\MessageObject + +try { + $result = $apiInstance->receiveMessage($message_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ChannelsApi->receiveMessage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **message_object** | [**\Pipedrive\Model\MessageObject**](../Model/MessageObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\InlineResponse200**](../Model/InlineResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/CurrenciesApi.md b/docs/Api/CurrenciesApi.md new file mode 100644 index 00000000..504cbfad --- /dev/null +++ b/docs/Api/CurrenciesApi.md @@ -0,0 +1,73 @@ +# Pipedrive\CurrenciesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getCurrencies()**](CurrenciesApi.md#getCurrencies) | **GET** /currencies | Get all supported currencies + + +## `getCurrencies()` + +```php +getCurrencies($term): \Pipedrive\Model\Currencies +``` + +Get all supported currencies + +Returns all supported currencies in given account which should be used when saving monetary values with other objects. The `code` parameter of the returning objects is the currency code according to ISO 4217 for all non-custom currencies. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\CurrenciesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | Optional search term that is searched for from currency's name and/or code + +try { + $result = $apiInstance->getCurrencies($term); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CurrenciesApi->getCurrencies: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| Optional search term that is searched for from currency's name and/or code | [optional] + +### Return type + +[**\Pipedrive\Model\Currencies**](../Model/Currencies.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/DealFieldsApi.md b/docs/Api/DealFieldsApi.md new file mode 100644 index 00000000..4e8fa564 --- /dev/null +++ b/docs/Api/DealFieldsApi.md @@ -0,0 +1,407 @@ +# Pipedrive\DealFieldsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addDealField()**](DealFieldsApi.md#addDealField) | **POST** /dealFields | Add a new deal field +[**deleteDealField()**](DealFieldsApi.md#deleteDealField) | **DELETE** /dealFields/{id} | Delete a deal field +[**deleteDealFields()**](DealFieldsApi.md#deleteDealFields) | **DELETE** /dealFields | Delete multiple deal fields in bulk +[**getDealField()**](DealFieldsApi.md#getDealField) | **GET** /dealFields/{id} | Get one deal field +[**getDealFields()**](DealFieldsApi.md#getDealFields) | **GET** /dealFields | Get all deal fields +[**updateDealField()**](DealFieldsApi.md#updateDealField) | **PUT** /dealFields/{id} | Update a deal field + + +## `addDealField()` + +```php +addDealField($field_create_request): \Pipedrive\Model\FieldResponse +``` + +Add a new deal field + +Adds a new deal field. For more information, see the tutorial for adding a new custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$field_create_request = new \Pipedrive\Model\FieldCreateRequest(); // \Pipedrive\Model\FieldCreateRequest + +try { + $result = $apiInstance->addDealField($field_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealFieldsApi->addDealField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **field_create_request** | [**\Pipedrive\Model\FieldCreateRequest**](../Model/FieldCreateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteDealField()` + +```php +deleteDealField($id): \Pipedrive\Model\DeleteResponse +``` + +Delete a deal field + +Marks a field as deleted. For more information, see the tutorial for deleting a custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealFieldsApi( + // If you want use 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 field + +try { + $result = $apiInstance->deleteDealField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealFieldsApi->deleteDealField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + +### Return type + +[**\Pipedrive\Model\DeleteResponse**](../Model/DeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDealFields()` + +```php +deleteDealFields($ids): \Pipedrive\Model\BulkDeleteResponse +``` + +Delete multiple deal fields in bulk + +Marks multiple deal fields as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated field IDs to delete + +try { + $result = $apiInstance->deleteDealFields($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealFieldsApi->deleteDealFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated field IDs to delete | + +### Return type + +[**\Pipedrive\Model\BulkDeleteResponse**](../Model/BulkDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealField()` + +```php +getDealField($id): \Pipedrive\Model\FieldResponse +``` + +Get one deal field + +Returns data about a specific deal field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealFieldsApi( + // If you want use 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 field + +try { + $result = $apiInstance->getDealField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealFieldsApi->getDealField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealFields()` + +```php +getDealFields($start, $limit): \Pipedrive\Model\FieldsResponse +``` + +Get all deal fields + +Returns data about all deal fields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getDealFields($start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealFieldsApi->getDealFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\FieldsResponse**](../Model/FieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDealField()` + +```php +updateDealField($id, $field_update_request): \Pipedrive\Model\FieldResponse +``` + +Update a deal field + +Updates a deal field. For more information, see the tutorial for updating custom fields' values. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealFieldsApi( + // If you want use 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 field +$field_update_request = new \Pipedrive\Model\FieldUpdateRequest(); // \Pipedrive\Model\FieldUpdateRequest + +try { + $result = $apiInstance->updateDealField($id, $field_update_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealFieldsApi->updateDealField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + **field_update_request** | [**\Pipedrive\Model\FieldUpdateRequest**](../Model/FieldUpdateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/DealsApi.md b/docs/Api/DealsApi.md new file mode 100644 index 00000000..a4e919c3 --- /dev/null +++ b/docs/Api/DealsApi.md @@ -0,0 +1,1973 @@ +# Pipedrive\DealsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addDeal()**](DealsApi.md#addDeal) | **POST** /deals | Add a deal +[**addDealFollower()**](DealsApi.md#addDealFollower) | **POST** /deals/{id}/followers | Add a follower to a deal +[**addDealParticipant()**](DealsApi.md#addDealParticipant) | **POST** /deals/{id}/participants | Add a participant to a deal +[**addDealProduct()**](DealsApi.md#addDealProduct) | **POST** /deals/{id}/products | Add a product to a deal +[**deleteDeal()**](DealsApi.md#deleteDeal) | **DELETE** /deals/{id} | Delete a deal +[**deleteDealFollower()**](DealsApi.md#deleteDealFollower) | **DELETE** /deals/{id}/followers/{follower_id} | Delete a follower from a deal +[**deleteDealParticipant()**](DealsApi.md#deleteDealParticipant) | **DELETE** /deals/{id}/participants/{deal_participant_id} | Delete a participant from a deal +[**deleteDealProduct()**](DealsApi.md#deleteDealProduct) | **DELETE** /deals/{id}/products/{product_attachment_id} | Delete an attached product from a deal +[**deleteDeals()**](DealsApi.md#deleteDeals) | **DELETE** /deals | Delete multiple deals in bulk +[**duplicateDeal()**](DealsApi.md#duplicateDeal) | **POST** /deals/{id}/duplicate | Duplicate deal +[**getDeal()**](DealsApi.md#getDeal) | **GET** /deals/{id} | Get details of a deal +[**getDealActivities()**](DealsApi.md#getDealActivities) | **GET** /deals/{id}/activities | List activities associated with a deal +[**getDealFiles()**](DealsApi.md#getDealFiles) | **GET** /deals/{id}/files | List files attached to a deal +[**getDealFollowers()**](DealsApi.md#getDealFollowers) | **GET** /deals/{id}/followers | List followers of a deal +[**getDealMailMessages()**](DealsApi.md#getDealMailMessages) | **GET** /deals/{id}/mailMessages | List mail messages associated with a deal +[**getDealParticipants()**](DealsApi.md#getDealParticipants) | **GET** /deals/{id}/participants | List participants of a deal +[**getDealPersons()**](DealsApi.md#getDealPersons) | **GET** /deals/{id}/persons | List all persons associated with a deal +[**getDealProducts()**](DealsApi.md#getDealProducts) | **GET** /deals/{id}/products | List products attached to a deal +[**getDealUpdates()**](DealsApi.md#getDealUpdates) | **GET** /deals/{id}/flow | List updates about a deal +[**getDealUsers()**](DealsApi.md#getDealUsers) | **GET** /deals/{id}/permittedUsers | List permitted users +[**getDeals()**](DealsApi.md#getDeals) | **GET** /deals | Get all deals +[**getDealsCollection()**](DealsApi.md#getDealsCollection) | **GET** /deals/collection | Get all deals (BETA) +[**getDealsSummary()**](DealsApi.md#getDealsSummary) | **GET** /deals/summary | Get deals summary +[**getDealsTimeline()**](DealsApi.md#getDealsTimeline) | **GET** /deals/timeline | Get deals timeline +[**mergeDeals()**](DealsApi.md#mergeDeals) | **PUT** /deals/{id}/merge | Merge two deals +[**searchDeals()**](DealsApi.md#searchDeals) | **GET** /deals/search | Search deals +[**updateDeal()**](DealsApi.md#updateDeal) | **PUT** /deals/{id} | Update a deal +[**updateDealProduct()**](DealsApi.md#updateDealProduct) | **PUT** /deals/{id}/products/{product_attachment_id} | Update the product attached to a deal + + +## `addDeal()` + +```php +addDeal($new_deal): \Pipedrive\Model\GetAddedDeal +``` + +Add a deal + +Adds a new deal. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for `key` values. For more information, see the tutorial for adding a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$new_deal = new \Pipedrive\Model\NewDeal(); // \Pipedrive\Model\NewDeal + +try { + $result = $apiInstance->addDeal($new_deal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->addDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **new_deal** | [**\Pipedrive\Model\NewDeal**](../Model/NewDeal.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetAddedDeal**](../Model/GetAddedDeal.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addDealFollower()` + +```php +addDealFollower($id, $add_deal_follower_request): \Pipedrive\Model\AddedDealFollower +``` + +Add a follower to a deal + +Adds a follower to a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$add_deal_follower_request = new \Pipedrive\Model\AddDealFollowerRequest(); // \Pipedrive\Model\AddDealFollowerRequest + +try { + $result = $apiInstance->addDealFollower($id, $add_deal_follower_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->addDealFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **add_deal_follower_request** | [**\Pipedrive\Model\AddDealFollowerRequest**](../Model/AddDealFollowerRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddedDealFollower**](../Model/AddedDealFollower.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addDealParticipant()` + +```php +addDealParticipant($id, $add_deal_participant_request): \Pipedrive\Model\PostDealParticipants +``` + +Add a participant to a deal + +Adds a participant to a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$add_deal_participant_request = new \Pipedrive\Model\AddDealParticipantRequest(); // \Pipedrive\Model\AddDealParticipantRequest + +try { + $result = $apiInstance->addDealParticipant($id, $add_deal_participant_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->addDealParticipant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **add_deal_participant_request** | [**\Pipedrive\Model\AddDealParticipantRequest**](../Model/AddDealParticipantRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostDealParticipants**](../Model/PostDealParticipants.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addDealProduct()` + +```php +addDealProduct($id, $new_deal_product): \Pipedrive\Model\GetAddProductAttachementDetails +``` + +Add a product to a deal + +Adds a product to a deal, creating a new item called a deal-product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$new_deal_product = new \Pipedrive\Model\NewDealProduct(); // \Pipedrive\Model\NewDealProduct + +try { + $result = $apiInstance->addDealProduct($id, $new_deal_product); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->addDealProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **new_deal_product** | [**\Pipedrive\Model\NewDealProduct**](../Model/NewDealProduct.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetAddProductAttachementDetails**](../Model/GetAddProductAttachementDetails.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteDeal()` + +```php +deleteDeal($id): \Pipedrive\Model\DeleteDeal +``` + +Delete a deal + +Marks a deal as deleted. After 30 days, the deal will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal + +try { + $result = $apiInstance->deleteDeal($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->deleteDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + +### Return type + +[**\Pipedrive\Model\DeleteDeal**](../Model/DeleteDeal.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDealFollower()` + +```php +deleteDealFollower($id, $follower_id): \Pipedrive\Model\DeleteDealFollower +``` + +Delete a follower from a deal + +Deletes a follower from a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$follower_id = 56; // int | The ID of the follower + +try { + $result = $apiInstance->deleteDealFollower($id, $follower_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->deleteDealFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **follower_id** | **int**| The ID of the follower | + +### Return type + +[**\Pipedrive\Model\DeleteDealFollower**](../Model/DeleteDealFollower.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDealParticipant()` + +```php +deleteDealParticipant($id, $deal_participant_id): \Pipedrive\Model\DeleteDealParticipant +``` + +Delete a participant from a deal + +Deletes a participant from a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$deal_participant_id = 56; // int | The ID of the participant of the deal + +try { + $result = $apiInstance->deleteDealParticipant($id, $deal_participant_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->deleteDealParticipant: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **deal_participant_id** | **int**| The ID of the participant of the deal | + +### Return type + +[**\Pipedrive\Model\DeleteDealParticipant**](../Model/DeleteDealParticipant.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDealProduct()` + +```php +deleteDealProduct($id, $product_attachment_id): \Pipedrive\Model\DeleteDealProduct +``` + +Delete an attached product from a deal + +Deletes a product attachment from a deal, using the `product_attachment_id`. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$product_attachment_id = 56; // int | The product attachment ID + +try { + $result = $apiInstance->deleteDealProduct($id, $product_attachment_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->deleteDealProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **product_attachment_id** | **int**| The product attachment ID | + +### Return type + +[**\Pipedrive\Model\DeleteDealProduct**](../Model/DeleteDealProduct.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDeals()` + +```php +deleteDeals($ids): \Pipedrive\Model\DeleteMultipleDeals +``` + +Delete multiple deals in bulk + +Marks multiple deals as deleted. After 30 days, the deals will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated IDs that will be deleted + +try { + $result = $apiInstance->deleteDeals($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->deleteDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated IDs that will be deleted | + +### Return type + +[**\Pipedrive\Model\DeleteMultipleDeals**](../Model/DeleteMultipleDeals.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `duplicateDeal()` + +```php +duplicateDeal($id): \Pipedrive\Model\GetDuplicatedDeal +``` + +Duplicate deal + +Duplicates a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal + +try { + $result = $apiInstance->duplicateDeal($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->duplicateDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + +### Return type + +[**\Pipedrive\Model\GetDuplicatedDeal**](../Model/GetDuplicatedDeal.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDeal()` + +```php +getDeal($id): \Pipedrive\Model\GetDeal +``` + +Get details of a deal + +Returns the details of a specific deal. Note that this also returns some additional fields which are not present when asking for all deals – such as deal age and stay in pipeline stages. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of dealFields. For more information, see the tutorial for getting details of a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal + +try { + $result = $apiInstance->getDeal($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + +### Return type + +[**\Pipedrive\Model\GetDeal**](../Model/GetDeal.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealActivities()` + +```php +getDealActivities($id, $start, $limit, $done, $exclude): \Pipedrive\Model\DealListActivitiesResponse +``` + +List activities associated with a deal + +Lists activities associated with a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$done = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. +$exclude = 'exclude_example'; // string | A comma-separated string of activity IDs to exclude from result + +try { + $result = $apiInstance->getDealActivities($id, $start, $limit, $done, $exclude); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealActivities: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **done** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. | [optional] + **exclude** | **string**| A comma-separated string of activity IDs to exclude from result | [optional] + +### Return type + +[**\Pipedrive\Model\DealListActivitiesResponse**](../Model/DealListActivitiesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealFiles()` + +```php +getDealFiles($id, $start, $limit, $sort): \Pipedrive\Model\ListFilesResponse +``` + +List files attached to a deal + +Lists files associated with a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. + +try { + $result = $apiInstance->getDealFiles($id, $start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. | [optional] + +### Return type + +[**\Pipedrive\Model\ListFilesResponse**](../Model/ListFilesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealFollowers()` + +```php +getDealFollowers($id): \Pipedrive\Model\ListFollowersResponse +``` + +List followers of a deal + +Lists the followers of a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal + +try { + $result = $apiInstance->getDealFollowers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealFollowers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + +### Return type + +[**\Pipedrive\Model\ListFollowersResponse**](../Model/ListFollowersResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealMailMessages()` + +```php +getDealMailMessages($id, $start, $limit): \Pipedrive\Model\ListMailMessagesResponse +``` + +List mail messages associated with a deal + +Lists mail messages associated with a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getDealMailMessages($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealMailMessages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListMailMessagesResponse**](../Model/ListMailMessagesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealParticipants()` + +```php +getDealParticipants($id, $start, $limit): \Pipedrive\Model\DealParticipants +``` + +List participants of a deal + +Lists the participants associated with a deal.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getDealParticipants($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealParticipants: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\DealParticipants**](../Model/DealParticipants.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealPersons()` + +```php +getDealPersons($id, $start, $limit): \Pipedrive\Model\ListPersonsResponse +``` + +List all persons associated with a deal + +Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getDealPersons($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealPersons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListPersonsResponse**](../Model/ListPersonsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealProducts()` + +```php +getDealProducts($id, $start, $limit, $include_product_data): \Pipedrive\Model\ListProductsResponse +``` + +List products attached to a deal + +Lists products attached to a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$include_product_data = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether to fetch product data along with each attached product (1) or not (0, default) + +try { + $result = $apiInstance->getDealProducts($id, $start, $limit, $include_product_data); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealProducts: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **include_product_data** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether to fetch product data along with each attached product (1) or not (0, default) | [optional] + +### Return type + +[**\Pipedrive\Model\ListProductsResponse**](../Model/ListProductsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealUpdates()` + +```php +getDealUpdates($id, $start, $limit, $all_changes, $items): \Pipedrive\Model\DealFlowResponse +``` + +List updates about a deal + +Lists updates about a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$all_changes = 'all_changes_example'; // string | Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. +$items = 'items_example'; // string | A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) + +try { + $result = $apiInstance->getDealUpdates($id, $start, $limit, $all_changes, $items); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealUpdates: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **all_changes** | **string**| Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. | [optional] + **items** | **string**| A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) | [optional] + +### Return type + +[**\Pipedrive\Model\DealFlowResponse**](../Model/DealFlowResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealUsers()` + +```php +getDealUsers($id): \Pipedrive\Model\ListPermittedUsersResponse +``` + +List permitted users + +Lists the users permitted to access a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal + +try { + $result = $apiInstance->getDealUsers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + +### Return type + +[**\Pipedrive\Model\ListPermittedUsersResponse**](../Model/ListPermittedUsersResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDeals()` + +```php +getDeals($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you): \Pipedrive\Model\GetDeals +``` + +Get all deals + +Returns all deals. For more information, see the tutorial for getting all deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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_id = 56; // int | If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. +$filter_id = 56; // int | The ID of the filter to use +$stage_id = 56; // int | If supplied, only deals within the given stage will be returned +$status = 'all_not_deleted'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). +$owned_by_you = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. + +try { + $result = $apiInstance->getDeals($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **stage_id** | **int**| If supplied, only deals within the given stage will be returned | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. | [optional] [default to 'all_not_deleted'] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + **owned_by_you** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. | [optional] + +### Return type + +[**\Pipedrive\Model\GetDeals**](../Model/GetDeals.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealsCollection()` + +```php +getDealsCollection($cursor, $limit, $since, $until, $user_id, $stage_id, $status): \Pipedrive\Model\GetDealsCollection +``` + +Get all deals (BETA) + +Returns all deals. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on pagination. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions here. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page +$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. +$since = 'since_example'; // string | The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. +$until = 'until_example'; // string | The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. +$user_id = 56; // int | If supplied, only deals matching the given user will be returned +$stage_id = 56; // int | If supplied, only deals within the given stage will be returned +$status = 'status_example'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. + +try { + $result = $apiInstance->getDealsCollection($cursor, $limit, $since, $until, $user_id, $stage_id, $status); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealsCollection: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] + **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional] + **since** | **string**| The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. | [optional] + **until** | **string**| The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. | [optional] + **user_id** | **int**| If supplied, only deals matching the given user will be returned | [optional] + **stage_id** | **int**| If supplied, only deals within the given stage will be returned | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. | [optional] + +### Return type + +[**\Pipedrive\Model\GetDealsCollection**](../Model/GetDealsCollection.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealsSummary()` + +```php +getDealsSummary($status, $filter_id, $user_id, $stage_id): \Pipedrive\Model\GetDealsSummary +``` + +Get deals summary + +Returns a summary of all the deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$status = 'status_example'; // string | Only fetch deals with a specific status. open = Open, won = Won, lost = Lost +$filter_id = 56; // int | user_id will not be considered. Only deals matching the given filter will be returned. +$user_id = 56; // int | Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. +$stage_id = 56; // int | Only deals within the given stage will be returned + +try { + $result = $apiInstance->getDealsSummary($status, $filter_id, $user_id, $stage_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealsSummary: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **string**| Only fetch deals with a specific status. open = Open, won = Won, lost = Lost | [optional] + **filter_id** | **int**| <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. | [optional] + **user_id** | **int**| Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. | [optional] + **stage_id** | **int**| Only deals within the given stage will be returned | [optional] + +### Return type + +[**\Pipedrive\Model\GetDealsSummary**](../Model/GetDealsSummary.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDealsTimeline()` + +```php +getDealsTimeline($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency): \Pipedrive\Model\GetDealsTimeline +``` + +Get deals timeline + +Returns open and won deals, grouped by a defined interval of time set in a date-type dealField (`field_key`) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given `field_key`. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date when the first interval starts. Format: YYYY-MM-DD +$interval = 'interval_example'; // string | The type of the interval
ValueDescription
`day`Day
`week`A full week (7 days) starting from `start_date`
`month`A full month (depending on the number of days in given month) starting from `start_date`
`quarter`A full quarter (3 months) starting from `start_date`
+$amount = 56; // int | The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). +$field_key = 'field_key_example'; // string | The date field key which deals will be retrieved from +$user_id = 56; // int | If supplied, only deals matching the given user will be returned +$pipeline_id = 56; // int | If supplied, only deals matching the given pipeline will be returned +$filter_id = 56; // int | If supplied, only deals matching the given filter will be returned +$exclude_deals = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. +$totals_convert_currency = 'totals_convert_currency_example'; // string | The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. + +try { + $result = $apiInstance->getDealsTimeline($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->getDealsTimeline: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start_date** | **\DateTime**| The date when the first interval starts. Format: YYYY-MM-DD | + **interval** | **string**| The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> | + **amount** | **int**| The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). | + **field_key** | **string**| The date field key which deals will be retrieved from | + **user_id** | **int**| If supplied, only deals matching the given user will be returned | [optional] + **pipeline_id** | **int**| If supplied, only deals matching the given pipeline will be returned | [optional] + **filter_id** | **int**| If supplied, only deals matching the given filter will be returned | [optional] + **exclude_deals** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. | [optional] + **totals_convert_currency** | **string**| The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. | [optional] + +### Return type + +[**\Pipedrive\Model\GetDealsTimeline**](../Model/GetDealsTimeline.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `mergeDeals()` + +```php +mergeDeals($id, $merge_deals_request): \Pipedrive\Model\GetMergedDeal +``` + +Merge two deals + +Merges a deal with another deal. For more information, see the tutorial for merging two deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$merge_deals_request = new \Pipedrive\Model\MergeDealsRequest(); // \Pipedrive\Model\MergeDealsRequest + +try { + $result = $apiInstance->mergeDeals($id, $merge_deals_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->mergeDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **merge_deals_request** | [**\Pipedrive\Model\MergeDealsRequest**](../Model/MergeDealsRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetMergedDeal**](../Model/GetMergedDeal.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `searchDeals()` + +```php +searchDeals($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit): \Pipedrive\Model\DealSearchResponse +``` + +Search deals + +Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$fields = 'fields_example'; // string | A comma-separated string array. The fields to perform the search from. Defaults to all of them. +$exact_match = True; // bool | When enabled, only full exact matches against the given term are returned. It is not case sensitive. +$person_id = 56; // int | Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. +$organization_id = 56; // int | Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. +$status = 'status_example'; // string | Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. +$include_fields = 'include_fields_example'; // string | Supports including optional fields in the results which are not provided by default +$start = 0; // int | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchDeals($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->searchDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **fields** | **string**| A comma-separated string array. The fields to perform the search from. Defaults to all of them. | [optional] + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | [optional] + **person_id** | **int**| Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. | [optional] + **organization_id** | **int**| Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. | [optional] + **status** | **string**| Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. | [optional] + **include_fields** | **string**| Supports including optional fields in the results which are not provided by default | [optional] + **start** | **int**| Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\DealSearchResponse**](../Model/DealSearchResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateDeal()` + +```php +updateDeal($id, $update_deal_request): \Pipedrive\Model\GetAddedDeal +``` + +Update a deal + +Updates the properties of a deal. For more information, see the tutorial for updating a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$update_deal_request = new \Pipedrive\Model\UpdateDealRequest(); // \Pipedrive\Model\UpdateDealRequest + +try { + $result = $apiInstance->updateDeal($id, $update_deal_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->updateDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **update_deal_request** | [**\Pipedrive\Model\UpdateDealRequest**](../Model/UpdateDealRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetAddedDeal**](../Model/GetAddedDeal.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `updateDealProduct()` + +```php +updateDealProduct($id, $product_attachment_id, $update_deal_product): \Pipedrive\Model\GetProductAttachementDetails +``` + +Update the product attached to a deal + +Updates the details of the product that has been attached to a deal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\DealsApi( + // If you want use 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 deal +$product_attachment_id = 56; // int | The ID of the deal-product (the ID of the product attached to the deal) +$update_deal_product = new \Pipedrive\Model\UpdateDealProduct(); // \Pipedrive\Model\UpdateDealProduct + +try { + $result = $apiInstance->updateDealProduct($id, $product_attachment_id, $update_deal_product); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->updateDealProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the deal | + **product_attachment_id** | **int**| The ID of the deal-product (the ID of the product attached to the deal) | + **update_deal_product** | [**\Pipedrive\Model\UpdateDealProduct**](../Model/UpdateDealProduct.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetProductAttachementDetails**](../Model/GetProductAttachementDetails.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `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/FilesApi.md b/docs/Api/FilesApi.md new file mode 100644 index 00000000..ef3a2a4c --- /dev/null +++ b/docs/Api/FilesApi.md @@ -0,0 +1,569 @@ +# Pipedrive\FilesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addFile()**](FilesApi.md#addFile) | **POST** /files | Add file +[**addFileAndLinkIt()**](FilesApi.md#addFileAndLinkIt) | **POST** /files/remote | Create a remote file and link it to an item +[**deleteFile()**](FilesApi.md#deleteFile) | **DELETE** /files/{id} | Delete a file +[**downloadFile()**](FilesApi.md#downloadFile) | **GET** /files/{id}/download | Download one file +[**getFile()**](FilesApi.md#getFile) | **GET** /files/{id} | Get one file +[**getFiles()**](FilesApi.md#getFiles) | **GET** /files | Get all files +[**linkFileToItem()**](FilesApi.md#linkFileToItem) | **POST** /files/remoteLink | Link a remote file to an item +[**updateFile()**](FilesApi.md#updateFile) | **PUT** /files/{id} | Update file details + + +## `addFile()` + +```php +addFile($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id): \Pipedrive\Model\AddFile +``` + +Add file + +Lets you upload a file and associate it with a deal, person, organization, activity, product or lead. For more information, see the tutorial for adding a file. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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 | A single file, supplied in the multipart/form-data encoding and contained within the given boundaries +$deal_id = 56; // int | The ID of the deal to associate file(s) with +$person_id = 56; // int | The ID of the person to associate file(s) with +$org_id = 56; // int | The ID of the organization to associate file(s) with +$product_id = 56; // int | The ID of the product to associate file(s) with +$activity_id = 56; // int | The ID of the activity to associate file(s) with +$lead_id = 'lead_id_example'; // string | The ID of the lead to associate file(s) with + +try { + $result = $apiInstance->addFile($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->addFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **\SplFileObject****\SplFileObject**| A single file, supplied in the multipart/form-data encoding and contained within the given boundaries | + **deal_id** | **int**| The ID of the deal to associate file(s) with | [optional] + **person_id** | **int**| The ID of the person to associate file(s) with | [optional] + **org_id** | **int**| The ID of the organization to associate file(s) with | [optional] + **product_id** | **int**| The ID of the product to associate file(s) with | [optional] + **activity_id** | **int**| The ID of the activity to associate file(s) with | [optional] + **lead_id** | **string**| The ID of the lead to associate file(s) with | [optional] + +### Return type + +[**\Pipedrive\Model\AddFile**](../Model/AddFile.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### 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) + +## `addFileAndLinkIt()` + +```php +addFileAndLinkIt($file_type, $title, $item_type, $item_id, $remote_location): \Pipedrive\Model\CreateRemoteFileAndLinkItToItem +``` + +Create a remote file and link it to an item + +Creates a new empty file in the remote location (`googledrive`) that will be linked to the item you supply. For more information, see the tutorial for adding a remote file. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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_type = 'file_type_example'; // string | The file type +$title = 'title_example'; // string | The title of the file +$item_type = 'item_type_example'; // string | The item type +$item_id = 56; // int | The ID of the item to associate the file with +$remote_location = 'remote_location_example'; // string | The location type to send the file to. Only `googledrive` is supported at the moment. + +try { + $result = $apiInstance->addFileAndLinkIt($file_type, $title, $item_type, $item_id, $remote_location); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->addFileAndLinkIt: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_type** | **string**| The file type | + **title** | **string**| The title of the file | + **item_type** | **string**| The item type | + **item_id** | **int**| The ID of the item to associate the file with | + **remote_location** | **string**| The location type to send the file to. Only `googledrive` is supported at the moment. | + +### Return type + +[**\Pipedrive\Model\CreateRemoteFileAndLinkItToItem**](../Model/CreateRemoteFileAndLinkItToItem.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteFile()` + +```php +deleteFile($id): \Pipedrive\Model\DeleteFile +``` + +Delete a file + +Marks a file as deleted. After 30 days, the file will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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 file + +try { + $result = $apiInstance->deleteFile($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->deleteFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the file | + +### Return type + +[**\Pipedrive\Model\DeleteFile**](../Model/DeleteFile.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `downloadFile()` + +```php +downloadFile($id): string +``` + +Download one file + +Initializes a file download. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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 file + +try { + $result = $apiInstance->downloadFile($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->downloadFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the file | + +### Return type + +**string** + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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) + +## `getFile()` + +```php +getFile($id): \Pipedrive\Model\GetOneFile +``` + +Get one file + +Returns data about a specific file. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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 file + +try { + $result = $apiInstance->getFile($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->getFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the file | + +### Return type + +[**\Pipedrive\Model\GetOneFile**](../Model/GetOneFile.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFiles()` + +```php +getFiles($start, $limit, $sort): \Pipedrive\Model\GetAllFiles +``` + +Get all files + +Returns data about all files. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. + +try { + $result = $apiInstance->getFiles($start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->getFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. | [optional] + +### Return type + +[**\Pipedrive\Model\GetAllFiles**](../Model/GetAllFiles.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `linkFileToItem()` + +```php +linkFileToItem($item_type, $item_id, $remote_id, $remote_location): \Pipedrive\Model\LinkRemoteFileToItem +``` + +Link a remote file to an item + +Links an existing remote file (`googledrive`) to the item you supply. For more information, see the tutorial for adding a remote file. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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_type = 'item_type_example'; // string | The item type +$item_id = 56; // int | The ID of the item to associate the file with +$remote_id = 'remote_id_example'; // string | The remote item ID +$remote_location = 'remote_location_example'; // string | The location type to send the file to. Only `googledrive` is supported at the moment. + +try { + $result = $apiInstance->linkFileToItem($item_type, $item_id, $remote_id, $remote_location); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->linkFileToItem: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **item_type** | **string**| The item type | + **item_id** | **int**| The ID of the item to associate the file with | + **remote_id** | **string**| The remote item ID | + **remote_location** | **string**| The location type to send the file to. Only `googledrive` is supported at the moment. | + +### Return type + +[**\Pipedrive\Model\LinkRemoteFileToItem**](../Model/LinkRemoteFileToItem.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateFile()` + +```php +updateFile($id, $name, $description): \Pipedrive\Model\UpdateFile +``` + +Update file details + +Updates the properties of a file. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FilesApi( + // If you want use 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 file +$name = 'name_example'; // string | The visible name of the file +$description = 'description_example'; // string | The description of the file + +try { + $result = $apiInstance->updateFile($id, $name, $description); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->updateFile: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the file | + **name** | **string**| The visible name of the file | [optional] + **description** | **string**| The description of the file | [optional] + +### Return type + +[**\Pipedrive\Model\UpdateFile**](../Model/UpdateFile.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `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/FiltersApi.md b/docs/Api/FiltersApi.md new file mode 100644 index 00000000..16e12650 --- /dev/null +++ b/docs/Api/FiltersApi.md @@ -0,0 +1,465 @@ +# Pipedrive\FiltersApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addFilter()**](FiltersApi.md#addFilter) | **POST** /filters | Add a new filter +[**deleteFilter()**](FiltersApi.md#deleteFilter) | **DELETE** /filters/{id} | Delete a filter +[**deleteFilters()**](FiltersApi.md#deleteFilters) | **DELETE** /filters | Delete multiple filters in bulk +[**getFilter()**](FiltersApi.md#getFilter) | **GET** /filters/{id} | Get one filter +[**getFilterHelpers()**](FiltersApi.md#getFilterHelpers) | **GET** /filters/helpers | Get all filter helpers +[**getFilters()**](FiltersApi.md#getFilters) | **GET** /filters | Get all filters +[**updateFilter()**](FiltersApi.md#updateFilter) | **PUT** /filters/{id} | Update filter + + +## `addFilter()` + +```php +addFilter($add_filter_request): \Pipedrive\Model\FiltersPostResponse +``` + +Add a new filter + +Adds a new filter, returns the ID upon success. Note that in the conditions JSON object only one first-level condition group is supported, and it must be glued with 'AND', and only two second level condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other combinations do not work (yet) but the syntax supports introducing them in future. For more information, see the tutorial for adding a filter. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_filter_request = new \Pipedrive\Model\AddFilterRequest(); // \Pipedrive\Model\AddFilterRequest + +try { + $result = $apiInstance->addFilter($add_filter_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->addFilter: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_filter_request** | [**\Pipedrive\Model\AddFilterRequest**](../Model/AddFilterRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FiltersPostResponse**](../Model/FiltersPostResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteFilter()` + +```php +deleteFilter($id): \Pipedrive\Model\FiltersDeleteResponse +``` + +Delete a filter + +Marks a filter as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use 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 filter + +try { + $result = $apiInstance->deleteFilter($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->deleteFilter: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the filter | + +### Return type + +[**\Pipedrive\Model\FiltersDeleteResponse**](../Model/FiltersDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteFilters()` + +```php +deleteFilters($ids): \Pipedrive\Model\FiltersBulkDeleteResponse +``` + +Delete multiple filters in bulk + +Marks multiple filters as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated filter IDs to delete + +try { + $result = $apiInstance->deleteFilters($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->deleteFilters: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated filter IDs to delete | + +### Return type + +[**\Pipedrive\Model\FiltersBulkDeleteResponse**](../Model/FiltersBulkDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFilter()` + +```php +getFilter($id): \Pipedrive\Model\FiltersGetResponse +``` + +Get one filter + +Returns data about a specific filter. Note that this also returns the condition lines of the filter. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use 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 filter + +try { + $result = $apiInstance->getFilter($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->getFilter: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the filter | + +### Return type + +[**\Pipedrive\Model\FiltersGetResponse**](../Model/FiltersGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFilterHelpers()` + +```php +getFilterHelpers(): object +``` + +Get all filter helpers + +Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information, see the tutorial for adding a filter. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use 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->getFilterHelpers(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->getFilterHelpers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**object** + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getFilters()` + +```php +getFilters($type): \Pipedrive\Model\FiltersBulkGetResponse +``` + +Get all filters + +Returns data about all filters. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$type = new \Pipedrive\Model\\Pipedrive\Model\FilterType(); // \Pipedrive\Model\FilterType | The types of filters to fetch + +try { + $result = $apiInstance->getFilters($type); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->getFilters: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | [**\Pipedrive\Model\FilterType**](../Model/.md)| The types of filters to fetch | [optional] + +### Return type + +[**\Pipedrive\Model\FiltersBulkGetResponse**](../Model/FiltersBulkGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateFilter()` + +```php +updateFilter($id, $update_filter_request): \Pipedrive\Model\FiltersPostResponse +``` + +Update filter + +Updates an existing filter. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\FiltersApi( + // If you want use 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 filter +$update_filter_request = new \Pipedrive\Model\UpdateFilterRequest(); // \Pipedrive\Model\UpdateFilterRequest + +try { + $result = $apiInstance->updateFilter($id, $update_filter_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FiltersApi->updateFilter: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the filter | + **update_filter_request** | [**\Pipedrive\Model\UpdateFilterRequest**](../Model/UpdateFilterRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FiltersPostResponse**](../Model/FiltersPostResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/GoalsApi.md b/docs/Api/GoalsApi.md new file mode 100644 index 00000000..a5476ab1 --- /dev/null +++ b/docs/Api/GoalsApi.md @@ -0,0 +1,367 @@ +# Pipedrive\GoalsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addGoal()**](GoalsApi.md#addGoal) | **POST** /goals | Add a new goal +[**deleteGoal()**](GoalsApi.md#deleteGoal) | **DELETE** /goals/{id} | Delete existing goal +[**getGoalResult()**](GoalsApi.md#getGoalResult) | **GET** /goals/{id}/results | Get result of a goal +[**getGoals()**](GoalsApi.md#getGoals) | **GET** /goals/find | Find goals +[**updateGoal()**](GoalsApi.md#updateGoal) | **PUT** /goals/{id} | Update existing goal + + +## `addGoal()` + +```php +addGoal($new_goal): \Pipedrive\Model\AddOrUpdateGoalResponse200 +``` + +Add a new goal + +Adds a new goal. Along with adding a new goal, a report is created to track the progress of your goal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\GoalsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$new_goal = new \Pipedrive\Model\NewGoal(); // \Pipedrive\Model\NewGoal + +try { + $result = $apiInstance->addGoal($new_goal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GoalsApi->addGoal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **new_goal** | [**\Pipedrive\Model\NewGoal**](../Model/NewGoal.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddOrUpdateGoalResponse200**](../Model/AddOrUpdateGoalResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteGoal()` + +```php +deleteGoal($id): \Pipedrive\Model\DeleteGoalResponse200 +``` + +Delete existing goal + +Marks a goal as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\GoalsApi( + // If you want use 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 goal + +try { + $result = $apiInstance->deleteGoal($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GoalsApi->deleteGoal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the goal | + +### Return type + +[**\Pipedrive\Model\DeleteGoalResponse200**](../Model/DeleteGoalResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGoalResult()` + +```php +getGoalResult($id, $period_start, $period_end): \Pipedrive\Model\GetGoalResultResponse200 +``` + +Get result of a goal + +Gets the progress of a goal for the specified period. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\GoalsApi( + // If you want use 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 goal that the results are looked for +$period_start = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. +$period_end = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. + +try { + $result = $apiInstance->getGoalResult($id, $period_start, $period_end); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GoalsApi->getGoalResult: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the goal that the results are looked for | + **period_start** | **\DateTime**| The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. | + **period_end** | **\DateTime**| The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. | + +### Return type + +[**\Pipedrive\Model\GetGoalResultResponse200**](../Model/GetGoalResultResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getGoals()` + +```php +getGoals($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end): \Pipedrive\Model\GetGoalsResponse200 +``` + +Find goals + +Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\GoalsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$type_name = 'type_name_example'; // string | The type of the goal. If provided, everyone's goals will be returned. +$title = 'title_example'; // string | The title of the goal +$is_active = true; // bool | Whether the goal is active or not +$assignee_id = 56; // int | The ID of the user who's goal to fetch. When omitted, only your goals will be returned. +$assignee_type = 'assignee_type_example'; // string | The type of the goal's assignee. If provided, everyone's goals will be returned. +$expected_outcome_target = 3.4; // float | The numeric value of the outcome. If provided, everyone's goals will be returned. +$expected_outcome_tracking_metric = 'expected_outcome_tracking_metric_example'; // string | The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. +$expected_outcome_currency_id = 56; // int | The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. +$type_params_pipeline_id = array(56); // int[] | An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. +$type_params_stage_id = 56; // int | The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. +$type_params_activity_type_id = array(56); // int[] | An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. +$period_start = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. +$period_end = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The end date of the period for which to find goals. Date in format of YYYY-MM-DD. + +try { + $result = $apiInstance->getGoals($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GoalsApi->getGoals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type_name** | **string**| The type of the goal. If provided, everyone's goals will be returned. | [optional] + **title** | **string**| The title of the goal | [optional] + **is_active** | **bool**| Whether the goal is active or not | [optional] [default to true] + **assignee_id** | **int**| The ID of the user who's goal to fetch. When omitted, only your goals will be returned. | [optional] + **assignee_type** | **string**| The type of the goal's assignee. If provided, everyone's goals will be returned. | [optional] + **expected_outcome_target** | **float**| The numeric value of the outcome. If provided, everyone's goals will be returned. | [optional] + **expected_outcome_tracking_metric** | **string**| The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. | [optional] + **expected_outcome_currency_id** | **int**| The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. | [optional] + **type_params_pipeline_id** | [**int[]**](../Model/int.md)| An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. | [optional] + **type_params_stage_id** | **int**| The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. | [optional] + **type_params_activity_type_id** | [**int[]**](../Model/int.md)| An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. | [optional] + **period_start** | **\DateTime**| The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. | [optional] + **period_end** | **\DateTime**| The end date of the period for which to find goals. Date in format of YYYY-MM-DD. | [optional] + +### Return type + +[**\Pipedrive\Model\GetGoalsResponse200**](../Model/GetGoalsResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateGoal()` + +```php +updateGoal($id, $basic_goal): \Pipedrive\Model\AddOrUpdateGoalResponse200 +``` + +Update existing goal + +Updates an existing goal. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\GoalsApi( + // If you want use 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 goal +$basic_goal = new \Pipedrive\Model\BasicGoal(); // \Pipedrive\Model\BasicGoal + +try { + $result = $apiInstance->updateGoal($id, $basic_goal); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GoalsApi->updateGoal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the goal | + **basic_goal** | [**\Pipedrive\Model\BasicGoal**](../Model/BasicGoal.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddOrUpdateGoalResponse200**](../Model/AddOrUpdateGoalResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/ItemSearchApi.md b/docs/Api/ItemSearchApi.md new file mode 100644 index 00000000..9915c03d --- /dev/null +++ b/docs/Api/ItemSearchApi.md @@ -0,0 +1,165 @@ +# Pipedrive\ItemSearchApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**searchItem()**](ItemSearchApi.md#searchItem) | **GET** /itemSearch | Perform a search from multiple item types +[**searchItemByField()**](ItemSearchApi.md#searchItemByField) | **GET** /itemSearch/field | Perform a search using a specific field from an item type + + +## `searchItem()` + +```php +searchItem($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit): \Pipedrive\Model\ItemSearchResponse +``` + +Perform a search from multiple item types + +Performs a search from your choice of item types and fields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ItemSearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$item_types = 'item_types_example'; // string | A comma-separated string array. The type of items to perform the search from. Defaults to all. +$fields = 'fields_example'; // string | A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:
Item typeField
Deal`custom_fields`, `notes`, `title`
Person`custom_fields`, `email`, `name`, `notes`, `phone`
Organization`address`, `custom_fields`, `name`, `notes`
Product`code`, `custom_fields`, `name`
Lead`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`
File`name`
Mail attachment`name`
Project `custom_fields`, `notes`, `title`, `description`

When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. +$search_for_related_items = True; // bool | When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. +$exact_match = True; // bool | When enabled, only full exact matches against the given term are returned. It is not case sensitive. +$include_fields = 'include_fields_example'; // string | A comma-separated string array. Supports including optional fields in the results which are not provided by default. +$start = 0; // int | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchItem($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ItemSearchApi->searchItem: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **item_types** | **string**| A comma-separated string array. The type of items to perform the search from. Defaults to all. | [optional] + **fields** | **string**| A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. | [optional] + **search_for_related_items** | **bool**| When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. | [optional] + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | [optional] + **include_fields** | **string**| A comma-separated string array. Supports including optional fields in the results which are not provided by default. | [optional] + **start** | **int**| Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ItemSearchResponse**](../Model/ItemSearchResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchItemByField()` + +```php +searchItemByField($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit): \Pipedrive\Model\ItemSearchFieldResponse +``` + +Perform a search using a specific field from an item type + +Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products). + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ItemSearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$field_type = 'field_type_example'; // string | The type of the field to perform the search from +$field_key = 'field_key_example'; // string | The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). +$exact_match = false; // bool | When enabled, only full exact matches against the given term are returned. The search is case sensitive. +$return_item_ids = True; // bool | Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. +$start = 56; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchItemByField($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ItemSearchApi->searchItemByField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **field_type** | **string**| The type of the field to perform the search from | + **field_key** | **string**| The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). | + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. | [optional] [default to false] + **return_item_ids** | **bool**| Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. | [optional] + **start** | **int**| Pagination start | [optional] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ItemSearchFieldResponse**](../Model/ItemSearchFieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/LeadLabelsApi.md b/docs/Api/LeadLabelsApi.md new file mode 100644 index 00000000..cbf3fbd0 --- /dev/null +++ b/docs/Api/LeadLabelsApi.md @@ -0,0 +1,270 @@ +# Pipedrive\LeadLabelsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addLeadLabel()**](LeadLabelsApi.md#addLeadLabel) | **POST** /leadLabels | Add a lead label +[**deleteLeadLabel()**](LeadLabelsApi.md#deleteLeadLabel) | **DELETE** /leadLabels/{id} | Delete a lead label +[**getLeadLabels()**](LeadLabelsApi.md#getLeadLabels) | **GET** /leadLabels | Get all lead labels +[**updateLeadLabel()**](LeadLabelsApi.md#updateLeadLabel) | **PATCH** /leadLabels/{id} | Update a lead label + + +## `addLeadLabel()` + +```php +addLeadLabel($add_lead_label_request): \Pipedrive\Model\AddOrUpdateLeadLabelResponse200 +``` + +Add a lead label + +Creates a lead label. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadLabelsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_lead_label_request = new \Pipedrive\Model\AddLeadLabelRequest(); // \Pipedrive\Model\AddLeadLabelRequest + +try { + $result = $apiInstance->addLeadLabel($add_lead_label_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadLabelsApi->addLeadLabel: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_lead_label_request** | [**\Pipedrive\Model\AddLeadLabelRequest**](../Model/AddLeadLabelRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddOrUpdateLeadLabelResponse200**](../Model/AddOrUpdateLeadLabelResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteLeadLabel()` + +```php +deleteLeadLabel($id): \Pipedrive\Model\LeadIdResponse200 +``` + +Delete a lead label + +Deletes a specific lead label. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadLabelsApi( + // If you want use 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 lead label + +try { + $result = $apiInstance->deleteLeadLabel($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadLabelsApi->deleteLeadLabel: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead label | + +### Return type + +[**\Pipedrive\Model\LeadIdResponse200**](../Model/LeadIdResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLeadLabels()` + +```php +getLeadLabels(): \Pipedrive\Model\GetLeadLabelsResponse200 +``` + +Get all lead labels + +Returns details of all lead labels. This endpoint does not support pagination and all labels are always returned. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadLabelsApi( + // If you want use 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->getLeadLabels(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadLabelsApi->getLeadLabels: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\GetLeadLabelsResponse200**](../Model/GetLeadLabelsResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLeadLabel()` + +```php +updateLeadLabel($id, $update_lead_label_request): \Pipedrive\Model\AddOrUpdateLeadLabelResponse200 +``` + +Update a lead label + +Updates one or more properties of a lead label. Only properties included in the request will be updated. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadLabelsApi( + // If you want use 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 lead label +$update_lead_label_request = new \Pipedrive\Model\UpdateLeadLabelRequest(); // \Pipedrive\Model\UpdateLeadLabelRequest + +try { + $result = $apiInstance->updateLeadLabel($id, $update_lead_label_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadLabelsApi->updateLeadLabel: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead label | + **update_lead_label_request** | [**\Pipedrive\Model\UpdateLeadLabelRequest**](../Model/UpdateLeadLabelRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddOrUpdateLeadLabelResponse200**](../Model/AddOrUpdateLeadLabelResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/LeadSourcesApi.md b/docs/Api/LeadSourcesApi.md new file mode 100644 index 00000000..823cdc69 --- /dev/null +++ b/docs/Api/LeadSourcesApi.md @@ -0,0 +1,70 @@ +# Pipedrive\LeadSourcesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getLeadSources()**](LeadSourcesApi.md#getLeadSources) | **GET** /leadSources | Get all lead sources + + +## `getLeadSources()` + +```php +getLeadSources(): \Pipedrive\Model\GetLeadSourcesResponse200 +``` + +Get all lead sources + +Returns all lead sources. Please note that the list of lead sources is fixed, it cannot be modified. All leads created through the Pipedrive API will have a lead source `API` assigned. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadSourcesApi( + // If you want use 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->getLeadSources(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadSourcesApi->getLeadSources: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\GetLeadSourcesResponse200**](../Model/GetLeadSourcesResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/LeadsApi.md b/docs/Api/LeadsApi.md new file mode 100644 index 00000000..f32dfa54 --- /dev/null +++ b/docs/Api/LeadsApi.md @@ -0,0 +1,496 @@ +# Pipedrive\LeadsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addLead()**](LeadsApi.md#addLead) | **POST** /leads | Add a lead +[**deleteLead()**](LeadsApi.md#deleteLead) | **DELETE** /leads/{id} | Delete a lead +[**getLead()**](LeadsApi.md#getLead) | **GET** /leads/{id} | Get one lead +[**getLeadUsers()**](LeadsApi.md#getLeadUsers) | **GET** /leads/{id}/permittedUsers | List permitted users +[**getLeads()**](LeadsApi.md#getLeads) | **GET** /leads | Get all leads +[**searchLeads()**](LeadsApi.md#searchLeads) | **GET** /leads/search | Search leads +[**updateLead()**](LeadsApi.md#updateLead) | **PATCH** /leads/{id} | Update a lead + + +## `addLead()` + +```php +addLead($add_lead_request): \Pipedrive\Model\OneLeadResponse200 +``` + +Add a lead + +Creates a lead. A lead always has to be linked to a person or an organization or both. All leads created through the Pipedrive API will have a lead source `API` assigned. Here's the tutorial for adding a lead. If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields' structure from deals. See an example given in the updating custom fields' values tutorial. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_lead_request = new \Pipedrive\Model\AddLeadRequest(); // \Pipedrive\Model\AddLeadRequest + +try { + $result = $apiInstance->addLead($add_lead_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->addLead: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_lead_request** | [**\Pipedrive\Model\AddLeadRequest**](../Model/AddLeadRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OneLeadResponse200**](../Model/OneLeadResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteLead()` + +```php +deleteLead($id): \Pipedrive\Model\LeadIdResponse200 +``` + +Delete a lead + +Deletes a specific lead. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use 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 lead + +try { + $result = $apiInstance->deleteLead($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->deleteLead: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead | + +### Return type + +[**\Pipedrive\Model\LeadIdResponse200**](../Model/LeadIdResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLead()` + +```php +getLead($id): \Pipedrive\Model\OneLeadResponse200 +``` + +Get one lead + +Returns details of a specific lead. If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use 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 lead + +try { + $result = $apiInstance->getLead($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->getLead: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead | + +### Return type + +[**\Pipedrive\Model\OneLeadResponse200**](../Model/OneLeadResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLeadUsers()` + +```php +getLeadUsers($id): \Pipedrive\Model\UserIDs +``` + +List permitted users + +Lists the users permitted to access a lead. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use 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 lead + +try { + $result = $apiInstance->getLeadUsers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->getLeadUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead | + +### Return type + +[**\Pipedrive\Model\UserIDs**](../Model/UserIDs.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLeads()` + +```php +getLeads($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort): \Pipedrive\Model\GetLeadsResponse200 +``` + +Get all leads + +Returns multiple leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields' structure from deals. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. +$start = 0; // int | For pagination, the position that represents the first result for the page +$archived_status = 'archived_status_example'; // string | Filtering based on the archived status of a lead. If not provided, `All` is used. +$owner_id = 1; // int | If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. +$person_id = 1; // int | If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. +$organization_id = 1; // int | If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. +$filter_id = 1; // int | The ID of the filter to use +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). + +try { + $result = $apiInstance->getLeads($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->getLeads: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. | [optional] + **start** | **int**| For pagination, the position that represents the first result for the page | [optional] + **archived_status** | **string**| Filtering based on the archived status of a lead. If not provided, `All` is used. | [optional] + **owner_id** | **int**| If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. | [optional] + **person_id** | **int**| If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. | [optional] + **organization_id** | **int**| If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + +### Return type + +[**\Pipedrive\Model\GetLeadsResponse200**](../Model/GetLeadsResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchLeads()` + +```php +searchLeads($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit): \Pipedrive\Model\LeadSearchResponse +``` + +Search leads + +Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$fields = 'fields_example'; // string | A comma-separated string array. The fields to perform the search from. Defaults to all of them. +$exact_match = True; // bool | When enabled, only full exact matches against the given term are returned. It is not case sensitive. +$person_id = 56; // int | Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. +$organization_id = 56; // int | Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. +$include_fields = 'include_fields_example'; // string | Supports including optional fields in the results which are not provided by default +$start = 0; // int | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchLeads($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->searchLeads: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **fields** | **string**| A comma-separated string array. The fields to perform the search from. Defaults to all of them. | [optional] + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | [optional] + **person_id** | **int**| Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. | [optional] + **organization_id** | **int**| Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. | [optional] + **include_fields** | **string**| Supports including optional fields in the results which are not provided by default | [optional] + **start** | **int**| Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\LeadSearchResponse**](../Model/LeadSearchResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateLead()` + +```php +updateLead($id, $update_lead_request): \Pipedrive\Model\OneLeadResponse200 +``` + +Update a lead + +Updates one or more properties of a lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). If a lead contains custom fields, the fields' values will be included in the response in the same format as with the `Deals` endpoints. If a custom field's value hasn't been set for the lead, it won't appear in the response. Please note that leads do not have a separate set of custom fields, instead they inherit the custom fields’ structure from deals. See an example given in the updating custom fields’ values tutorial. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LeadsApi( + // If you want use 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 lead +$update_lead_request = new \Pipedrive\Model\UpdateLeadRequest(); // \Pipedrive\Model\UpdateLeadRequest + +try { + $result = $apiInstance->updateLead($id, $update_lead_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LeadsApi->updateLead: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the lead | + **update_lead_request** | [**\Pipedrive\Model\UpdateLeadRequest**](../Model/UpdateLeadRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OneLeadResponse200**](../Model/OneLeadResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/LegacyTeamsApi.md b/docs/Api/LegacyTeamsApi.md new file mode 100644 index 00000000..3226e3ec --- /dev/null +++ b/docs/Api/LegacyTeamsApi.md @@ -0,0 +1,549 @@ +# Pipedrive\LegacyTeamsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addTeam()**](LegacyTeamsApi.md#addTeam) | **POST** /legacyTeams | Add a new team +[**addTeamUser()**](LegacyTeamsApi.md#addTeamUser) | **POST** /legacyTeams/{id}/users | Add users to a team +[**deleteTeamUser()**](LegacyTeamsApi.md#deleteTeamUser) | **DELETE** /legacyTeams/{id}/users | Delete users from a team +[**getTeam()**](LegacyTeamsApi.md#getTeam) | **GET** /legacyTeams/{id} | Get a single team +[**getTeamUsers()**](LegacyTeamsApi.md#getTeamUsers) | **GET** /legacyTeams/{id}/users | Get all users in a team +[**getTeams()**](LegacyTeamsApi.md#getTeams) | **GET** /legacyTeams | Get all teams +[**getUserTeams()**](LegacyTeamsApi.md#getUserTeams) | **GET** /legacyTeams/user/{id} | Get all teams of a user +[**updateTeam()**](LegacyTeamsApi.md#updateTeam) | **PUT** /legacyTeams/{id} | Update a team + + +## `addTeam()` + +```php +addTeam($create_team): \Pipedrive\Model\Team +``` + +Add a new team + +Adds a new team to the company and returns the created object. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_team = new \Pipedrive\Model\CreateTeam(); // \Pipedrive\Model\CreateTeam + +try { + $result = $apiInstance->addTeam($create_team); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->addTeam: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_team** | [**\Pipedrive\Model\CreateTeam**](../Model/CreateTeam.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\Team**](../Model/Team.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addTeamUser()` + +```php +addTeamUser($id, $add_team_user_request): \Pipedrive\Model\UserIDs +``` + +Add users to a team + +Adds users to an existing team. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use 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 team +$add_team_user_request = new \Pipedrive\Model\AddTeamUserRequest(); // \Pipedrive\Model\AddTeamUserRequest + +try { + $result = $apiInstance->addTeamUser($id, $add_team_user_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->addTeamUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the team | + **add_team_user_request** | [**\Pipedrive\Model\AddTeamUserRequest**](../Model/AddTeamUserRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\UserIDs**](../Model/UserIDs.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteTeamUser()` + +```php +deleteTeamUser($id, $delete_team_user_request): \Pipedrive\Model\UserIDs +``` + +Delete users from a team + +Deletes users from an existing team. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use 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 team +$delete_team_user_request = new \Pipedrive\Model\DeleteTeamUserRequest(); // \Pipedrive\Model\DeleteTeamUserRequest + +try { + $result = $apiInstance->deleteTeamUser($id, $delete_team_user_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->deleteTeamUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the team | + **delete_team_user_request** | [**\Pipedrive\Model\DeleteTeamUserRequest**](../Model/DeleteTeamUserRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\UserIDs**](../Model/UserIDs.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `getTeam()` + +```php +getTeam($id, $skip_users): \Pipedrive\Model\Team +``` + +Get a single team + +Returns data about a specific team. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use 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 team +$skip_users = new \Pipedrive\Model\\Pipedrive\Model\NumberBooleanDefault0(); // \Pipedrive\Model\NumberBooleanDefault0 | When enabled, the teams will not include IDs of member users + +try { + $result = $apiInstance->getTeam($id, $skip_users); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->getTeam: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the team | + **skip_users** | [**\Pipedrive\Model\NumberBooleanDefault0**](../Model/.md)| When enabled, the teams will not include IDs of member users | [optional] + +### Return type + +[**\Pipedrive\Model\Team**](../Model/Team.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTeamUsers()` + +```php +getTeamUsers($id): \Pipedrive\Model\UserIDs +``` + +Get all users in a team + +Returns a list of all user IDs within a team. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use 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 team + +try { + $result = $apiInstance->getTeamUsers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->getTeamUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the team | + +### Return type + +[**\Pipedrive\Model\UserIDs**](../Model/UserIDs.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTeams()` + +```php +getTeams($order_by, $skip_users): \Pipedrive\Model\Teams +``` + +Get all teams + +Returns data about teams within the company. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$order_by = 'id'; // string | The field name to sort returned teams by +$skip_users = new \Pipedrive\Model\\Pipedrive\Model\NumberBooleanDefault0(); // \Pipedrive\Model\NumberBooleanDefault0 | When enabled, the teams will not include IDs of member users + +try { + $result = $apiInstance->getTeams($order_by, $skip_users); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->getTeams: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_by** | **string**| The field name to sort returned teams by | [optional] [default to 'id'] + **skip_users** | [**\Pipedrive\Model\NumberBooleanDefault0**](../Model/.md)| When enabled, the teams will not include IDs of member users | [optional] + +### Return type + +[**\Pipedrive\Model\Teams**](../Model/Teams.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserTeams()` + +```php +getUserTeams($id, $order_by, $skip_users): \Pipedrive\Model\Teams +``` + +Get all teams of a user + +Returns data about all teams which have the specified user as a member. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use 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 +$order_by = 'id'; // string | The field name to sort returned teams by +$skip_users = new \Pipedrive\Model\\Pipedrive\Model\NumberBooleanDefault0(); // \Pipedrive\Model\NumberBooleanDefault0 | When enabled, the teams will not include IDs of member users + +try { + $result = $apiInstance->getUserTeams($id, $order_by, $skip_users); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->getUserTeams: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + **order_by** | **string**| The field name to sort returned teams by | [optional] [default to 'id'] + **skip_users** | [**\Pipedrive\Model\NumberBooleanDefault0**](../Model/.md)| When enabled, the teams will not include IDs of member users | [optional] + +### Return type + +[**\Pipedrive\Model\Teams**](../Model/Teams.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateTeam()` + +```php +updateTeam($id, $update_team): \Pipedrive\Model\Team +``` + +Update a team + +Updates an existing team and returns the updated object. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\LegacyTeamsApi( + // If you want use 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 team +$update_team = new \Pipedrive\Model\UpdateTeam(); // \Pipedrive\Model\UpdateTeam + +try { + $result = $apiInstance->updateTeam($id, $update_team); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LegacyTeamsApi->updateTeam: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the team | + **update_team** | [**\Pipedrive\Model\UpdateTeam**](../Model/UpdateTeam.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\Team**](../Model/Team.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/MailboxApi.md b/docs/Api/MailboxApi.md new file mode 100644 index 00000000..2b2dae85 --- /dev/null +++ b/docs/Api/MailboxApi.md @@ -0,0 +1,419 @@ +# Pipedrive\MailboxApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteMailThread()**](MailboxApi.md#deleteMailThread) | **DELETE** /mailbox/mailThreads/{id} | Delete mail thread +[**getMailMessage()**](MailboxApi.md#getMailMessage) | **GET** /mailbox/mailMessages/{id} | Get one mail message +[**getMailThread()**](MailboxApi.md#getMailThread) | **GET** /mailbox/mailThreads/{id} | Get one mail thread +[**getMailThreadMessages()**](MailboxApi.md#getMailThreadMessages) | **GET** /mailbox/mailThreads/{id}/mailMessages | Get all mail messages of mail thread +[**getMailThreads()**](MailboxApi.md#getMailThreads) | **GET** /mailbox/mailThreads | Get mail threads +[**updateMailThreadDetails()**](MailboxApi.md#updateMailThreadDetails) | **PUT** /mailbox/mailThreads/{id} | Update mail thread details + + +## `deleteMailThread()` + +```php +deleteMailThread($id): \Pipedrive\Model\MailThreadDelete +``` + +Delete mail thread + +Marks a mail thread as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\MailboxApi( + // If you want use 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 mail thread + +try { + $result = $apiInstance->deleteMailThread($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MailboxApi->deleteMailThread: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the mail thread | + +### Return type + +[**\Pipedrive\Model\MailThreadDelete**](../Model/MailThreadDelete.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMailMessage()` + +```php +getMailMessage($id, $include_body): \Pipedrive\Model\MailMessage +``` + +Get one mail message + +Returns data about a specific mail message. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\MailboxApi( + // If you want use 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 mail message to fetch +$include_body = new \Pipedrive\Model\\Pipedrive\Model\NumberBooleanDefault0(); // \Pipedrive\Model\NumberBooleanDefault0 | Whether to include the full message body or not. `0` = Don't include, `1` = Include + +try { + $result = $apiInstance->getMailMessage($id, $include_body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MailboxApi->getMailMessage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the mail message to fetch | + **include_body** | [**\Pipedrive\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the full message body or not. `0` = Don't include, `1` = Include | [optional] + +### Return type + +[**\Pipedrive\Model\MailMessage**](../Model/MailMessage.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMailThread()` + +```php +getMailThread($id): \Pipedrive\Model\MailThreadOne +``` + +Get one mail thread + +Returns a specific mail thread. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\MailboxApi( + // If you want use 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 mail thread + +try { + $result = $apiInstance->getMailThread($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MailboxApi->getMailThread: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the mail thread | + +### Return type + +[**\Pipedrive\Model\MailThreadOne**](../Model/MailThreadOne.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMailThreadMessages()` + +```php +getMailThreadMessages($id): \Pipedrive\Model\MailThreadMessages +``` + +Get all mail messages of mail thread + +Returns all the mail messages inside a specified mail thread. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\MailboxApi( + // If you want use 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 mail thread + +try { + $result = $apiInstance->getMailThreadMessages($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MailboxApi->getMailThreadMessages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the mail thread | + +### Return type + +[**\Pipedrive\Model\MailThreadMessages**](../Model/MailThreadMessages.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getMailThreads()` + +```php +getMailThreads($folder, $start, $limit): \Pipedrive\Model\MailThread +``` + +Get mail threads + +Returns mail threads in a specified folder ordered by the most recent message within. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\MailboxApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$folder = 'inbox'; // string | The type of folder to fetch +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getMailThreads($folder, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MailboxApi->getMailThreads: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **folder** | **string**| The type of folder to fetch | [default to 'inbox'] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\MailThread**](../Model/MailThread.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateMailThreadDetails()` + +```php +updateMailThreadDetails($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag): \Pipedrive\Model\MailThreadPut +``` + +Update mail thread details + +Updates the properties of a mail thread. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\MailboxApi( + // If you want use 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 mail thread +$deal_id = 56; // int | The ID of the deal this thread is associated with +$lead_id = 'lead_id_example'; // string | The ID of the lead this thread is associated with +$shared_flag = new \Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether this thread is shared with other users in your company +$read_flag = new \Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether this thread is read or unread +$archived_flag = new \Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. + +try { + $result = $apiInstance->updateMailThreadDetails($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MailboxApi->updateMailThreadDetails: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the mail thread | + **deal_id** | **int**| The ID of the deal this thread is associated with | [optional] + **lead_id** | **string**| The ID of the lead this thread is associated with | [optional] + **shared_flag** | [**NumberBoolean**](../Model/NumberBoolean.md)| Whether this thread is shared with other users in your company | [optional] + **read_flag** | [**NumberBoolean**](../Model/NumberBoolean.md)| Whether this thread is read or unread | [optional] + **archived_flag** | [**NumberBoolean**](../Model/NumberBoolean.md)| Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. | [optional] + +### Return type + +[**\Pipedrive\Model\MailThreadPut**](../Model/MailThreadPut.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/x-www-form-urlencoded` +- **Accept**: `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/NoteFieldsApi.md b/docs/Api/NoteFieldsApi.md new file mode 100644 index 00000000..cd0e4b30 --- /dev/null +++ b/docs/Api/NoteFieldsApi.md @@ -0,0 +1,70 @@ +# Pipedrive\NoteFieldsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getNoteFields()**](NoteFieldsApi.md#getNoteFields) | **GET** /noteFields | Get all note fields + + +## `getNoteFields()` + +```php +getNoteFields(): \Pipedrive\Model\NoteFieldsResponse +``` + +Get all note fields + +Returns data about all note fields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NoteFieldsApi( + // If you want use 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->getNoteFields(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NoteFieldsApi->getNoteFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\NoteFieldsResponse**](../Model/NoteFieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/NotesApi.md b/docs/Api/NotesApi.md new file mode 100644 index 00000000..a438d34f --- /dev/null +++ b/docs/Api/NotesApi.md @@ -0,0 +1,709 @@ +# Pipedrive\NotesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addNote()**](NotesApi.md#addNote) | **POST** /notes | Add a note +[**addNoteComment()**](NotesApi.md#addNoteComment) | **POST** /notes/{id}/comments | Add a comment to a note +[**deleteComment()**](NotesApi.md#deleteComment) | **DELETE** /notes/{id}/comments/{commentId} | Delete a comment related to a note +[**deleteNote()**](NotesApi.md#deleteNote) | **DELETE** /notes/{id} | Delete a note +[**getComment()**](NotesApi.md#getComment) | **GET** /notes/{id}/comments/{commentId} | Get one comment +[**getNote()**](NotesApi.md#getNote) | **GET** /notes/{id} | Get one note +[**getNoteComments()**](NotesApi.md#getNoteComments) | **GET** /notes/{id}/comments | Get all comments for a note +[**getNotes()**](NotesApi.md#getNotes) | **GET** /notes | Get all notes +[**updateCommentForNote()**](NotesApi.md#updateCommentForNote) | **PUT** /notes/{id}/comments/{commentId} | Update a comment related to a note +[**updateNote()**](NotesApi.md#updateNote) | **PUT** /notes/{id} | Update a note + + +## `addNote()` + +```php +addNote($add_note_request): \Pipedrive\Model\PostNote +``` + +Add a note + +Adds a new note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_note_request = new \Pipedrive\Model\AddNoteRequest(); // \Pipedrive\Model\AddNoteRequest + +try { + $result = $apiInstance->addNote($add_note_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->addNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_note_request** | [**\Pipedrive\Model\AddNoteRequest**](../Model/AddNoteRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostNote**](../Model/PostNote.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addNoteComment()` + +```php +addNoteComment($id, $comment_post_put_object): \Pipedrive\Model\PostComment +``` + +Add a comment to a note + +Adds a new comment to a note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note +$comment_post_put_object = new \Pipedrive\Model\CommentPostPutObject(); // \Pipedrive\Model\CommentPostPutObject + +try { + $result = $apiInstance->addNoteComment($id, $comment_post_put_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->addNoteComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + **comment_post_put_object** | [**\Pipedrive\Model\CommentPostPutObject**](../Model/CommentPostPutObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostComment**](../Model/PostComment.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteComment()` + +```php +deleteComment($id, $comment_id): \Pipedrive\Model\DeleteComment +``` + +Delete a comment related to a note + +Deletes a comment. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note +$comment_id = 'comment_id_example'; // string | The ID of the comment + +try { + $result = $apiInstance->deleteComment($id, $comment_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->deleteComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + **comment_id** | **string**| The ID of the comment | + +### Return type + +[**\Pipedrive\Model\DeleteComment**](../Model/DeleteComment.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[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($id): \Pipedrive\Model\DeleteNote +``` + +Delete a note + +Deletes a specific note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note + +try { + $result = $apiInstance->deleteNote($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->deleteNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + +### Return type + +[**\Pipedrive\Model\DeleteNote**](../Model/DeleteNote.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getComment()` + +```php +getComment($id, $comment_id): \Pipedrive\Model\PostComment +``` + +Get one comment + +Returns the details of a comment. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note +$comment_id = 'comment_id_example'; // string | The ID of the comment + +try { + $result = $apiInstance->getComment($id, $comment_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->getComment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + **comment_id** | **string**| The ID of the comment | + +### Return type + +[**\Pipedrive\Model\PostComment**](../Model/PostComment.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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($id): \Pipedrive\Model\PostNote +``` + +Get one note + +Returns details about a specific note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note + +try { + $result = $apiInstance->getNote($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->getNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + +### Return type + +[**\Pipedrive\Model\PostNote**](../Model/PostNote.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNoteComments()` + +```php +getNoteComments($id, $start, $limit): \Pipedrive\Model\GetComments +``` + +Get all comments for a note + +Returns all comments associated with a note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getNoteComments($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->getNoteComments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetComments**](../Model/GetComments.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getNotes()` + +```php +getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag): \Pipedrive\Model\GetNotes +``` + +Get all notes + +Returns all notes. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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_id = 56; // int | The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. +$lead_id = 'lead_id_example'; // string | The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. +$deal_id = 56; // int | The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. +$person_id = 56; // int | The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. +$org_id = 56; // int | The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date in format of YYYY-MM-DD from which notes to fetch +$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date in format of YYYY-MM-DD until which notes to fetch to +$pinned_to_lead_flag = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If set, the results are filtered by note to lead pinning state +$pinned_to_deal_flag = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If set, the results are filtered by note to deal pinning state +$pinned_to_organization_flag = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If set, the results are filtered by note to organization pinning state +$pinned_to_person_flag = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If set, the results are filtered by note to person pinning state + +try { + $result = $apiInstance->getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->getNotes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. | [optional] + **lead_id** | **string**| The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. | [optional] + **deal_id** | **int**| The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. | [optional] + **person_id** | **int**| The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. | [optional] + **org_id** | **int**| The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. | [optional] + **start_date** | **\DateTime**| The date in format of YYYY-MM-DD from which notes to fetch | [optional] + **end_date** | **\DateTime**| The date in format of YYYY-MM-DD until which notes to fetch to | [optional] + **pinned_to_lead_flag** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to lead pinning state | [optional] + **pinned_to_deal_flag** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to deal pinning state | [optional] + **pinned_to_organization_flag** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to organization pinning state | [optional] + **pinned_to_person_flag** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to person pinning state | [optional] + +### Return type + +[**\Pipedrive\Model\GetNotes**](../Model/GetNotes.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateCommentForNote()` + +```php +updateCommentForNote($id, $comment_id, $comment_post_put_object): \Pipedrive\Model\PostComment +``` + +Update a comment related to a note + +Updates a comment related to a note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note +$comment_id = 'comment_id_example'; // string | The ID of the comment +$comment_post_put_object = new \Pipedrive\Model\CommentPostPutObject(); // \Pipedrive\Model\CommentPostPutObject + +try { + $result = $apiInstance->updateCommentForNote($id, $comment_id, $comment_post_put_object); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->updateCommentForNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + **comment_id** | **string**| The ID of the comment | + **comment_post_put_object** | [**\Pipedrive\Model\CommentPostPutObject**](../Model/CommentPostPutObject.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostComment**](../Model/PostComment.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `updateNote()` + +```php +updateNote($id, $note): \Pipedrive\Model\PostNote +``` + +Update a note + +Updates a note. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\NotesApi( + // If you want use 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 note +$note = new \Pipedrive\Model\Note(); // \Pipedrive\Model\Note + +try { + $result = $apiInstance->updateNote($id, $note); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NotesApi->updateNote: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the note | + **note** | [**\Pipedrive\Model\Note**](../Model/Note.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostNote**](../Model/PostNote.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/OrganizationFieldsApi.md b/docs/Api/OrganizationFieldsApi.md new file mode 100644 index 00000000..a42a4867 --- /dev/null +++ b/docs/Api/OrganizationFieldsApi.md @@ -0,0 +1,407 @@ +# Pipedrive\OrganizationFieldsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addOrganizationField()**](OrganizationFieldsApi.md#addOrganizationField) | **POST** /organizationFields | Add a new organization field +[**deleteOrganizationField()**](OrganizationFieldsApi.md#deleteOrganizationField) | **DELETE** /organizationFields/{id} | Delete an organization field +[**deleteOrganizationFields()**](OrganizationFieldsApi.md#deleteOrganizationFields) | **DELETE** /organizationFields | Delete multiple organization fields in bulk +[**getOrganizationField()**](OrganizationFieldsApi.md#getOrganizationField) | **GET** /organizationFields/{id} | Get one organization field +[**getOrganizationFields()**](OrganizationFieldsApi.md#getOrganizationFields) | **GET** /organizationFields | Get all organization fields +[**updateOrganizationField()**](OrganizationFieldsApi.md#updateOrganizationField) | **PUT** /organizationFields/{id} | Update an organization field + + +## `addOrganizationField()` + +```php +addOrganizationField($field_create_request): \Pipedrive\Model\FieldResponse +``` + +Add a new organization field + +Adds a new organization field. For more information, see the tutorial for adding a new custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$field_create_request = new \Pipedrive\Model\FieldCreateRequest(); // \Pipedrive\Model\FieldCreateRequest + +try { + $result = $apiInstance->addOrganizationField($field_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationFieldsApi->addOrganizationField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **field_create_request** | [**\Pipedrive\Model\FieldCreateRequest**](../Model/FieldCreateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteOrganizationField()` + +```php +deleteOrganizationField($id): \Pipedrive\Model\DeleteResponse +``` + +Delete an organization field + +Marks a field as deleted. For more information, see the tutorial for deleting a custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationFieldsApi( + // If you want use 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 field + +try { + $result = $apiInstance->deleteOrganizationField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationFieldsApi->deleteOrganizationField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + +### Return type + +[**\Pipedrive\Model\DeleteResponse**](../Model/DeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteOrganizationFields()` + +```php +deleteOrganizationFields($ids): \Pipedrive\Model\BulkDeleteResponse +``` + +Delete multiple organization fields in bulk + +Marks multiple fields as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated field IDs to delete + +try { + $result = $apiInstance->deleteOrganizationFields($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationFieldsApi->deleteOrganizationFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated field IDs to delete | + +### Return type + +[**\Pipedrive\Model\BulkDeleteResponse**](../Model/BulkDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationField()` + +```php +getOrganizationField($id): \Pipedrive\Model\FieldResponse +``` + +Get one organization field + +Returns data about a specific organization field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationFieldsApi( + // If you want use 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 field + +try { + $result = $apiInstance->getOrganizationField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationFieldsApi->getOrganizationField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationFields()` + +```php +getOrganizationFields($start, $limit): \Pipedrive\Model\FieldsResponse +``` + +Get all organization fields + +Returns data about all organization fields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getOrganizationFields($start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationFieldsApi->getOrganizationFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\FieldsResponse**](../Model/FieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateOrganizationField()` + +```php +updateOrganizationField($id, $field_update_request): \Pipedrive\Model\FieldResponse +``` + +Update an organization field + +Updates an organization field. For more information, see the tutorial for updating custom fields' values. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationFieldsApi( + // If you want use 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 field +$field_update_request = new \Pipedrive\Model\FieldUpdateRequest(); // \Pipedrive\Model\FieldUpdateRequest + +try { + $result = $apiInstance->updateOrganizationField($id, $field_update_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationFieldsApi->updateOrganizationField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + **field_update_request** | [**\Pipedrive\Model\FieldUpdateRequest**](../Model/FieldUpdateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/OrganizationRelationshipsApi.md b/docs/Api/OrganizationRelationshipsApi.md new file mode 100644 index 00000000..3636c3ca --- /dev/null +++ b/docs/Api/OrganizationRelationshipsApi.md @@ -0,0 +1,341 @@ +# Pipedrive\OrganizationRelationshipsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addOrganizationRelationship()**](OrganizationRelationshipsApi.md#addOrganizationRelationship) | **POST** /organizationRelationships | Create an organization relationship +[**deleteOrganizationRelationship()**](OrganizationRelationshipsApi.md#deleteOrganizationRelationship) | **DELETE** /organizationRelationships/{id} | Delete an organization relationship +[**getOrganizationRelationship()**](OrganizationRelationshipsApi.md#getOrganizationRelationship) | **GET** /organizationRelationships/{id} | Get one organization relationship +[**getOrganizationRelationships()**](OrganizationRelationshipsApi.md#getOrganizationRelationships) | **GET** /organizationRelationships | Get all relationships for organization +[**updateOrganizationRelationship()**](OrganizationRelationshipsApi.md#updateOrganizationRelationship) | **PUT** /organizationRelationships/{id} | Update an organization relationship + + +## `addOrganizationRelationship()` + +```php +addOrganizationRelationship($add_organization_relationship_request): \Pipedrive\Model\OrganizationRelationshipPostResponse +``` + +Create an organization relationship + +Creates and returns an organization relationship. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationRelationshipsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_organization_relationship_request = new \Pipedrive\Model\AddOrganizationRelationshipRequest(); // \Pipedrive\Model\AddOrganizationRelationshipRequest + +try { + $result = $apiInstance->addOrganizationRelationship($add_organization_relationship_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationRelationshipsApi->addOrganizationRelationship: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_organization_relationship_request** | [**\Pipedrive\Model\AddOrganizationRelationshipRequest**](../Model/AddOrganizationRelationshipRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationRelationshipPostResponse**](../Model/OrganizationRelationshipPostResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteOrganizationRelationship()` + +```php +deleteOrganizationRelationship($id): \Pipedrive\Model\OrganizationRelationshipDeleteResponse +``` + +Delete an organization relationship + +Deletes an organization relationship and returns the deleted ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationRelationshipsApi( + // If you want use 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 organization relationship + +try { + $result = $apiInstance->deleteOrganizationRelationship($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationRelationshipsApi->deleteOrganizationRelationship: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization relationship | + +### Return type + +[**\Pipedrive\Model\OrganizationRelationshipDeleteResponse**](../Model/OrganizationRelationshipDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationRelationship()` + +```php +getOrganizationRelationship($id, $org_id): \Pipedrive\Model\OrganizationRelationshipGetResponse +``` + +Get one organization relationship + +Finds and returns an organization relationship from its ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationRelationshipsApi( + // If you want use 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 organization relationship +$org_id = 56; // int | The ID of the base organization for the returned calculated values + +try { + $result = $apiInstance->getOrganizationRelationship($id, $org_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationRelationshipsApi->getOrganizationRelationship: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization relationship | + **org_id** | **int**| The ID of the base organization for the returned calculated values | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationRelationshipGetResponse**](../Model/OrganizationRelationshipGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationRelationships()` + +```php +getOrganizationRelationships($org_id): \Pipedrive\Model\AllOrganizationRelationshipsGetResponse +``` + +Get all relationships for organization + +Gets all of the relationships for a supplied organization ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationRelationshipsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$org_id = 56; // int | The ID of the organization to get relationships for + +try { + $result = $apiInstance->getOrganizationRelationships($org_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationRelationshipsApi->getOrganizationRelationships: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **int**| The ID of the organization to get relationships for | + +### Return type + +[**\Pipedrive\Model\AllOrganizationRelationshipsGetResponse**](../Model/AllOrganizationRelationshipsGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateOrganizationRelationship()` + +```php +updateOrganizationRelationship($id, $organization_relationship): \Pipedrive\Model\OrganizationRelationshipUpdateResponse +``` + +Update an organization relationship + +Updates and returns an organization relationship. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationRelationshipsApi( + // If you want use 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 organization relationship +$organization_relationship = new \Pipedrive\Model\OrganizationRelationship(); // \Pipedrive\Model\OrganizationRelationship + +try { + $result = $apiInstance->updateOrganizationRelationship($id, $organization_relationship); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationRelationshipsApi->updateOrganizationRelationship: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization relationship | + **organization_relationship** | [**\Pipedrive\Model\OrganizationRelationship**](../Model/OrganizationRelationship.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationRelationshipUpdateResponse**](../Model/OrganizationRelationshipUpdateResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/OrganizationsApi.md b/docs/Api/OrganizationsApi.md new file mode 100644 index 00000000..e1bdb5a4 --- /dev/null +++ b/docs/Api/OrganizationsApi.md @@ -0,0 +1,1255 @@ +# Pipedrive\OrganizationsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addOrganization()**](OrganizationsApi.md#addOrganization) | **POST** /organizations | Add an organization +[**addOrganizationFollower()**](OrganizationsApi.md#addOrganizationFollower) | **POST** /organizations/{id}/followers | Add a follower to an organization +[**deleteOrganization()**](OrganizationsApi.md#deleteOrganization) | **DELETE** /organizations/{id} | Delete an organization +[**deleteOrganizationFollower()**](OrganizationsApi.md#deleteOrganizationFollower) | **DELETE** /organizations/{id}/followers/{follower_id} | Delete a follower from an organization +[**deleteOrganizations()**](OrganizationsApi.md#deleteOrganizations) | **DELETE** /organizations | Delete multiple organizations in bulk +[**getOrganization()**](OrganizationsApi.md#getOrganization) | **GET** /organizations/{id} | Get details of an organization +[**getOrganizationActivities()**](OrganizationsApi.md#getOrganizationActivities) | **GET** /organizations/{id}/activities | List activities associated with an organization +[**getOrganizationDeals()**](OrganizationsApi.md#getOrganizationDeals) | **GET** /organizations/{id}/deals | List deals associated with an organization +[**getOrganizationFiles()**](OrganizationsApi.md#getOrganizationFiles) | **GET** /organizations/{id}/files | List files attached to an organization +[**getOrganizationFollowers()**](OrganizationsApi.md#getOrganizationFollowers) | **GET** /organizations/{id}/followers | List followers of an organization +[**getOrganizationMailMessages()**](OrganizationsApi.md#getOrganizationMailMessages) | **GET** /organizations/{id}/mailMessages | List mail messages associated with an organization +[**getOrganizationPersons()**](OrganizationsApi.md#getOrganizationPersons) | **GET** /organizations/{id}/persons | List persons of an organization +[**getOrganizationUpdates()**](OrganizationsApi.md#getOrganizationUpdates) | **GET** /organizations/{id}/flow | List updates about an organization +[**getOrganizationUsers()**](OrganizationsApi.md#getOrganizationUsers) | **GET** /organizations/{id}/permittedUsers | List permitted users +[**getOrganizations()**](OrganizationsApi.md#getOrganizations) | **GET** /organizations | Get all organizations +[**mergeOrganizations()**](OrganizationsApi.md#mergeOrganizations) | **PUT** /organizations/{id}/merge | Merge two organizations +[**searchOrganization()**](OrganizationsApi.md#searchOrganization) | **GET** /organizations/search | Search organizations +[**updateOrganization()**](OrganizationsApi.md#updateOrganization) | **PUT** /organizations/{id} | Update an organization + + +## `addOrganization()` + +```php +addOrganization($new_organization): \Pipedrive\Model\OrganizationPostResponse +``` + +Add an organization + +Adds a new organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for `key` values. For more information, see the tutorial for adding an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$new_organization = new \Pipedrive\Model\NewOrganization(); // \Pipedrive\Model\NewOrganization + +try { + $result = $apiInstance->addOrganization($new_organization); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->addOrganization: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **new_organization** | [**\Pipedrive\Model\NewOrganization**](../Model/NewOrganization.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationPostResponse**](../Model/OrganizationPostResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addOrganizationFollower()` + +```php +addOrganizationFollower($id, $add_organization_follower_request): \Pipedrive\Model\OrganizationFollowerPostResponse +``` + +Add a follower to an organization + +Adds a follower to an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$add_organization_follower_request = new \Pipedrive\Model\AddOrganizationFollowerRequest(); // \Pipedrive\Model\AddOrganizationFollowerRequest + +try { + $result = $apiInstance->addOrganizationFollower($id, $add_organization_follower_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->addOrganizationFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **add_organization_follower_request** | [**\Pipedrive\Model\AddOrganizationFollowerRequest**](../Model/AddOrganizationFollowerRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationFollowerPostResponse**](../Model/OrganizationFollowerPostResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteOrganization()` + +```php +deleteOrganization($id): \Pipedrive\Model\OrganizationDeleteResponse +``` + +Delete an organization + +Marks an organization as deleted. After 30 days, the organization will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization + +try { + $result = $apiInstance->deleteOrganization($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->deleteOrganization: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + +### Return type + +[**\Pipedrive\Model\OrganizationDeleteResponse**](../Model/OrganizationDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteOrganizationFollower()` + +```php +deleteOrganizationFollower($id, $follower_id): \Pipedrive\Model\OrganizationFollowerDeleteResponse +``` + +Delete a follower from an organization + +Deletes a follower from an organization. You can retrieve the `follower_id` from the List followers of an organization endpoint. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$follower_id = 56; // int | The ID of the follower + +try { + $result = $apiInstance->deleteOrganizationFollower($id, $follower_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->deleteOrganizationFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **follower_id** | **int**| The ID of the follower | + +### Return type + +[**\Pipedrive\Model\OrganizationFollowerDeleteResponse**](../Model/OrganizationFollowerDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteOrganizations()` + +```php +deleteOrganizations($ids): \Pipedrive\Model\OrganizationsDeleteResponse +``` + +Delete multiple organizations in bulk + +Marks multiple organizations as deleted. After 30 days, the organizations will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated IDs that will be deleted + +try { + $result = $apiInstance->deleteOrganizations($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->deleteOrganizations: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated IDs that will be deleted | + +### Return type + +[**\Pipedrive\Model\OrganizationsDeleteResponse**](../Model/OrganizationsDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganization()` + +```php +getOrganization($id): \Pipedrive\Model\OrganizationDetailsGetResponse +``` + +Get details of an organization + +Returns the details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of organizationFields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization + +try { + $result = $apiInstance->getOrganization($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganization: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + +### Return type + +[**\Pipedrive\Model\OrganizationDetailsGetResponse**](../Model/OrganizationDetailsGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationActivities()` + +```php +getOrganizationActivities($id, $start, $limit, $done, $exclude): \Pipedrive\Model\ListActivitiesResponse +``` + +List activities associated with an organization + +Lists activities associated with an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$done = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. +$exclude = 'exclude_example'; // string | A comma-separated string of activity IDs to exclude from result + +try { + $result = $apiInstance->getOrganizationActivities($id, $start, $limit, $done, $exclude); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationActivities: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **done** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. | [optional] + **exclude** | **string**| A comma-separated string of activity IDs to exclude from result | [optional] + +### Return type + +[**\Pipedrive\Model\ListActivitiesResponse**](../Model/ListActivitiesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationDeals()` + +```php +getOrganizationDeals($id, $start, $limit, $status, $sort, $only_primary_association): \Pipedrive\Model\ListDealsResponse +``` + +List deals associated with an organization + +Lists deals associated with an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$status = 'all_not_deleted'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). +$only_primary_association = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. + +try { + $result = $apiInstance->getOrganizationDeals($id, $start, $limit, $status, $sort, $only_primary_association); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. | [optional] [default to 'all_not_deleted'] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + **only_primary_association** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. | [optional] + +### Return type + +[**\Pipedrive\Model\ListDealsResponse**](../Model/ListDealsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationFiles()` + +```php +getOrganizationFiles($id, $start, $limit, $sort): \Pipedrive\Model\ListFilesResponse +``` + +List files attached to an organization + +Lists files associated with an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. + +try { + $result = $apiInstance->getOrganizationFiles($id, $start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. | [optional] + +### Return type + +[**\Pipedrive\Model\ListFilesResponse**](../Model/ListFilesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationFollowers()` + +```php +getOrganizationFollowers($id): \Pipedrive\Model\OrganizationFollowersListResponse +``` + +List followers of an organization + +Lists the followers of an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization + +try { + $result = $apiInstance->getOrganizationFollowers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationFollowers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + +### Return type + +[**\Pipedrive\Model\OrganizationFollowersListResponse**](../Model/OrganizationFollowersListResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationMailMessages()` + +```php +getOrganizationMailMessages($id, $start, $limit): \Pipedrive\Model\ListMailMessagesResponse +``` + +List mail messages associated with an organization + +Lists mail messages associated with an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getOrganizationMailMessages($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationMailMessages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListMailMessagesResponse**](../Model/ListMailMessagesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationPersons()` + +```php +getOrganizationPersons($id, $start, $limit): \Pipedrive\Model\ListPersonsResponse +``` + +List persons of an organization + +Lists persons associated with an organization.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getOrganizationPersons($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationPersons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListPersonsResponse**](../Model/ListPersonsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationUpdates()` + +```php +getOrganizationUpdates($id, $start, $limit, $all_changes, $items): \Pipedrive\Model\OrganizationFlowResponse +``` + +List updates about an organization + +Lists updates about an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$all_changes = 'all_changes_example'; // string | Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. +$items = 'items_example'; // string | A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) + +try { + $result = $apiInstance->getOrganizationUpdates($id, $start, $limit, $all_changes, $items); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationUpdates: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **all_changes** | **string**| Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. | [optional] + **items** | **string**| A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationFlowResponse**](../Model/OrganizationFlowResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizationUsers()` + +```php +getOrganizationUsers($id): \Pipedrive\Model\ListPermittedUsersResponse1 +``` + +List permitted users + +List users permitted to access an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization + +try { + $result = $apiInstance->getOrganizationUsers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizationUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + +### Return type + +[**\Pipedrive\Model\ListPermittedUsersResponse1**](../Model/ListPermittedUsersResponse1.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOrganizations()` + +```php +getOrganizations($user_id, $filter_id, $first_char, $start, $limit, $sort): \Pipedrive\Model\AllOrganizationsGetResponse +``` + +Get all organizations + +Returns all organizations. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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_id = 56; // int | If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. +$filter_id = 56; // int | The ID of the filter to use +$first_char = 'first_char_example'; // string | If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). + +try { + $result = $apiInstance->getOrganizations($user_id, $filter_id, $first_char, $start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->getOrganizations: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **first_char** | **string**| If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + +### Return type + +[**\Pipedrive\Model\AllOrganizationsGetResponse**](../Model/AllOrganizationsGetResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `mergeOrganizations()` + +```php +mergeOrganizations($id, $merge_organizations_request): \Pipedrive\Model\OrganizationsMergeResponse +``` + +Merge two organizations + +Merges an organization with another organization. For more information, see the tutorial for merging two organizations. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$merge_organizations_request = new \Pipedrive\Model\MergeOrganizationsRequest(); // \Pipedrive\Model\MergeOrganizationsRequest + +try { + $result = $apiInstance->mergeOrganizations($id, $merge_organizations_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->mergeOrganizations: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **merge_organizations_request** | [**\Pipedrive\Model\MergeOrganizationsRequest**](../Model/MergeOrganizationsRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationsMergeResponse**](../Model/OrganizationsMergeResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `searchOrganization()` + +```php +searchOrganization($term, $fields, $exact_match, $start, $limit): \Pipedrive\Model\OrganizationSearchResponse +``` + +Search organizations + +Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$fields = 'fields_example'; // string | A comma-separated string array. The fields to perform the search from. Defaults to all of them. +$exact_match = True; // bool | When enabled, only full exact matches against the given term are returned. It is not case sensitive. +$start = 0; // int | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchOrganization($term, $fields, $exact_match, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->searchOrganization: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **fields** | **string**| A comma-separated string array. The fields to perform the search from. Defaults to all of them. | [optional] + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | [optional] + **start** | **int**| Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationSearchResponse**](../Model/OrganizationSearchResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateOrganization()` + +```php +updateOrganization($id, $update_organization): \Pipedrive\Model\OrganizationUpdateResponse +``` + +Update an organization + +Updates the properties of an organization. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\OrganizationsApi( + // If you want use 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 organization +$update_organization = new \Pipedrive\Model\UpdateOrganization(); // \Pipedrive\Model\UpdateOrganization + +try { + $result = $apiInstance->updateOrganization($id, $update_organization); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationsApi->updateOrganization: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the organization | + **update_organization** | [**\Pipedrive\Model\UpdateOrganization**](../Model/UpdateOrganization.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\OrganizationUpdateResponse**](../Model/OrganizationUpdateResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/PermissionSetsApi.md b/docs/Api/PermissionSetsApi.md new file mode 100644 index 00000000..8608ab13 --- /dev/null +++ b/docs/Api/PermissionSetsApi.md @@ -0,0 +1,209 @@ +# Pipedrive\PermissionSetsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getPermissionSet()**](PermissionSetsApi.md#getPermissionSet) | **GET** /permissionSets/{id} | Get one permission set +[**getPermissionSetAssignments()**](PermissionSetsApi.md#getPermissionSetAssignments) | **GET** /permissionSets/{id}/assignments | List permission set assignments +[**getPermissionSets()**](PermissionSetsApi.md#getPermissionSets) | **GET** /permissionSets | Get all permission sets + + +## `getPermissionSet()` + +```php +getPermissionSet($id): \Pipedrive\Model\SinglePermissionSetsItem +``` + +Get one permission set + +Returns data about a specific permission set. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PermissionSetsApi( + // If you want use 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 permission set + +try { + $result = $apiInstance->getPermissionSet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PermissionSetsApi->getPermissionSet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the permission set | + +### Return type + +[**\Pipedrive\Model\SinglePermissionSetsItem**](../Model/SinglePermissionSetsItem.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPermissionSetAssignments()` + +```php +getPermissionSetAssignments($id, $start, $limit): \Pipedrive\Model\UserAssignmentsToPermissionSet +``` + +List permission set assignments + +Returns the list of assignments for a permission set. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PermissionSetsApi( + // If you want use 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 permission set +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getPermissionSetAssignments($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PermissionSetsApi->getPermissionSetAssignments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| The ID of the permission set | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\UserAssignmentsToPermissionSet**](../Model/UserAssignmentsToPermissionSet.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPermissionSets()` + +```php +getPermissionSets($app): \Pipedrive\Model\PermissionSets +``` + +Get all permission sets + +Returns data about all permission sets. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PermissionSetsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$app = 'app_example'; // string | The app to filter the permission sets by + +try { + $result = $apiInstance->getPermissionSets($app); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PermissionSetsApi->getPermissionSets: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app** | **string**| The app to filter the permission sets by | [optional] + +### Return type + +[**\Pipedrive\Model\PermissionSets**](../Model/PermissionSets.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/PersonFieldsApi.md b/docs/Api/PersonFieldsApi.md new file mode 100644 index 00000000..177e3451 --- /dev/null +++ b/docs/Api/PersonFieldsApi.md @@ -0,0 +1,407 @@ +# Pipedrive\PersonFieldsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPersonField()**](PersonFieldsApi.md#addPersonField) | **POST** /personFields | Add a new person field +[**deletePersonField()**](PersonFieldsApi.md#deletePersonField) | **DELETE** /personFields/{id} | Delete a person field +[**deletePersonFields()**](PersonFieldsApi.md#deletePersonFields) | **DELETE** /personFields | Delete multiple person fields in bulk +[**getPersonField()**](PersonFieldsApi.md#getPersonField) | **GET** /personFields/{id} | Get one person field +[**getPersonFields()**](PersonFieldsApi.md#getPersonFields) | **GET** /personFields | Get all person fields +[**updatePersonField()**](PersonFieldsApi.md#updatePersonField) | **PUT** /personFields/{id} | Update a person field + + +## `addPersonField()` + +```php +addPersonField($field_create_request): \Pipedrive\Model\FieldResponse +``` + +Add a new person field + +Adds a new person field. For more information, see the tutorial for adding a new custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$field_create_request = new \Pipedrive\Model\FieldCreateRequest(); // \Pipedrive\Model\FieldCreateRequest + +try { + $result = $apiInstance->addPersonField($field_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonFieldsApi->addPersonField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **field_create_request** | [**\Pipedrive\Model\FieldCreateRequest**](../Model/FieldCreateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deletePersonField()` + +```php +deletePersonField($id): \Pipedrive\Model\DeleteResponse +``` + +Delete a person field + +Marks a field as deleted. For more information, see the tutorial for deleting a custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonFieldsApi( + // If you want use 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 field + +try { + $result = $apiInstance->deletePersonField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonFieldsApi->deletePersonField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + +### Return type + +[**\Pipedrive\Model\DeleteResponse**](../Model/DeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePersonFields()` + +```php +deletePersonFields($ids): \Pipedrive\Model\BulkDeleteResponse +``` + +Delete multiple person fields in bulk + +Marks multiple fields as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated field IDs to delete + +try { + $result = $apiInstance->deletePersonFields($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonFieldsApi->deletePersonFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated field IDs to delete | + +### Return type + +[**\Pipedrive\Model\BulkDeleteResponse**](../Model/BulkDeleteResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonField()` + +```php +getPersonField($id): \Pipedrive\Model\FieldResponse +``` + +Get one person field + +Returns data about a specific person field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonFieldsApi( + // If you want use 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 field + +try { + $result = $apiInstance->getPersonField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonFieldsApi->getPersonField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonFields()` + +```php +getPersonFields($start, $limit): \Pipedrive\Model\FieldsResponse +``` + +Get all person fields + +Returns data about all person fields.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getPersonFields($start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonFieldsApi->getPersonFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\FieldsResponse**](../Model/FieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePersonField()` + +```php +updatePersonField($id, $field_update_request): \Pipedrive\Model\FieldResponse +``` + +Update a person field + +Updates a person field. For more information, see the tutorial for updating custom fields' values. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonFieldsApi( + // If you want use 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 field +$field_update_request = new \Pipedrive\Model\FieldUpdateRequest(); // \Pipedrive\Model\FieldUpdateRequest + +try { + $result = $apiInstance->updatePersonField($id, $field_update_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonFieldsApi->updatePersonField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the field | + **field_update_request** | [**\Pipedrive\Model\FieldUpdateRequest**](../Model/FieldUpdateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\FieldResponse**](../Model/FieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/PersonsApi.md b/docs/Api/PersonsApi.md new file mode 100644 index 00000000..2eadb8cf --- /dev/null +++ b/docs/Api/PersonsApi.md @@ -0,0 +1,1396 @@ +# Pipedrive\PersonsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPerson()**](PersonsApi.md#addPerson) | **POST** /persons | Add a person +[**addPersonFollower()**](PersonsApi.md#addPersonFollower) | **POST** /persons/{id}/followers | Add a follower to a person +[**addPersonPicture()**](PersonsApi.md#addPersonPicture) | **POST** /persons/{id}/picture | Add person picture +[**deletePerson()**](PersonsApi.md#deletePerson) | **DELETE** /persons/{id} | Delete a person +[**deletePersonFollower()**](PersonsApi.md#deletePersonFollower) | **DELETE** /persons/{id}/followers/{follower_id} | Delete a follower from a person +[**deletePersonPicture()**](PersonsApi.md#deletePersonPicture) | **DELETE** /persons/{id}/picture | Delete person picture +[**deletePersons()**](PersonsApi.md#deletePersons) | **DELETE** /persons | Delete multiple persons in bulk +[**getPerson()**](PersonsApi.md#getPerson) | **GET** /persons/{id} | Get details of a person +[**getPersonActivities()**](PersonsApi.md#getPersonActivities) | **GET** /persons/{id}/activities | List activities associated with a person +[**getPersonDeals()**](PersonsApi.md#getPersonDeals) | **GET** /persons/{id}/deals | List deals associated with a person +[**getPersonFiles()**](PersonsApi.md#getPersonFiles) | **GET** /persons/{id}/files | List files attached to a person +[**getPersonFollowers()**](PersonsApi.md#getPersonFollowers) | **GET** /persons/{id}/followers | List followers of a person +[**getPersonMailMessages()**](PersonsApi.md#getPersonMailMessages) | **GET** /persons/{id}/mailMessages | List mail messages associated with a person +[**getPersonProducts()**](PersonsApi.md#getPersonProducts) | **GET** /persons/{id}/products | List products associated with a person +[**getPersonUpdates()**](PersonsApi.md#getPersonUpdates) | **GET** /persons/{id}/flow | List updates about a person +[**getPersonUsers()**](PersonsApi.md#getPersonUsers) | **GET** /persons/{id}/permittedUsers | List permitted users +[**getPersons()**](PersonsApi.md#getPersons) | **GET** /persons | Get all persons +[**mergePersons()**](PersonsApi.md#mergePersons) | **PUT** /persons/{id}/merge | Merge two persons +[**searchPersons()**](PersonsApi.md#searchPersons) | **GET** /persons/search | Search persons +[**updatePerson()**](PersonsApi.md#updatePerson) | **PUT** /persons/{id} | Update a person + + +## `addPerson()` + +```php +addPerson($new_person): \Pipedrive\Model\AddPersonResponse +``` + +Add a person + +Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for `key` values.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$new_person = new \Pipedrive\Model\NewPerson(); // \Pipedrive\Model\NewPerson + +try { + $result = $apiInstance->addPerson($new_person); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->addPerson: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **new_person** | [**\Pipedrive\Model\NewPerson**](../Model/NewPerson.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddPersonResponse**](../Model/AddPersonResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addPersonFollower()` + +```php +addPersonFollower($id, $add_person_follower_request): \Pipedrive\Model\AddFollowerToPersonResponse +``` + +Add a follower to a person + +Adds a follower to a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$add_person_follower_request = new \Pipedrive\Model\AddPersonFollowerRequest(); // \Pipedrive\Model\AddPersonFollowerRequest + +try { + $result = $apiInstance->addPersonFollower($id, $add_person_follower_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->addPersonFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **add_person_follower_request** | [**\Pipedrive\Model\AddPersonFollowerRequest**](../Model/AddPersonFollowerRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddFollowerToPersonResponse**](../Model/AddFollowerToPersonResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addPersonPicture()` + +```php +addPersonPicture($id, $file, $crop_x, $crop_y, $crop_width, $crop_height): \Pipedrive\Model\AddPersonPictureResponse +``` + +Add person picture + +Adds a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$file = "/path/to/file.txt"; // \SplFileObject | One image supplied in the multipart/form-data encoding +$crop_x = 56; // int | X coordinate to where start cropping form (in pixels) +$crop_y = 56; // int | Y coordinate to where start cropping form (in pixels) +$crop_width = 56; // int | The width of the cropping area (in pixels) +$crop_height = 56; // int | The height of the cropping area (in pixels) + +try { + $result = $apiInstance->addPersonPicture($id, $file, $crop_x, $crop_y, $crop_width, $crop_height); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->addPersonPicture: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **file** | **\SplFileObject****\SplFileObject**| One image supplied in the multipart/form-data encoding | + **crop_x** | **int**| X coordinate to where start cropping form (in pixels) | [optional] + **crop_y** | **int**| Y coordinate to where start cropping form (in pixels) | [optional] + **crop_width** | **int**| The width of the cropping area (in pixels) | [optional] + **crop_height** | **int**| The height of the cropping area (in pixels) | [optional] + +### Return type + +[**\Pipedrive\Model\AddPersonPictureResponse**](../Model/AddPersonPictureResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### 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) + +## `deletePerson()` + +```php +deletePerson($id): \Pipedrive\Model\DeletePersonResponse +``` + +Delete a person + +Marks a person as deleted. After 30 days, the person will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person + +try { + $result = $apiInstance->deletePerson($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->deletePerson: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + +### Return type + +[**\Pipedrive\Model\DeletePersonResponse**](../Model/DeletePersonResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePersonFollower()` + +```php +deletePersonFollower($id, $follower_id): \Pipedrive\Model\DeletePersonResponse +``` + +Delete a follower from a person + +Deletes a follower from a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$follower_id = 56; // int | The ID of the follower + +try { + $result = $apiInstance->deletePersonFollower($id, $follower_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->deletePersonFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **follower_id** | **int**| The ID of the follower | + +### Return type + +[**\Pipedrive\Model\DeletePersonResponse**](../Model/DeletePersonResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePersonPicture()` + +```php +deletePersonPicture($id): \Pipedrive\Model\DeletePersonResponse +``` + +Delete person picture + +Deletes a person’s picture. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person + +try { + $result = $apiInstance->deletePersonPicture($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->deletePersonPicture: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + +### Return type + +[**\Pipedrive\Model\DeletePersonResponse**](../Model/DeletePersonResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePersons()` + +```php +deletePersons($ids): \Pipedrive\Model\DeletePersonsInBulkResponse +``` + +Delete multiple persons in bulk + +Marks multiple persons as deleted. After 30 days, the persons will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated IDs that will be deleted + +try { + $result = $apiInstance->deletePersons($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->deletePersons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated IDs that will be deleted | + +### Return type + +[**\Pipedrive\Model\DeletePersonsInBulkResponse**](../Model/DeletePersonsInBulkResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPerson()` + +```php +getPerson($id): \Pipedrive\Model\GetPersonDetailsResponse +``` + +Get details of a person + +Returns the details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of personFields.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person + +try { + $result = $apiInstance->getPerson($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPerson: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + +### Return type + +[**\Pipedrive\Model\GetPersonDetailsResponse**](../Model/GetPersonDetailsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonActivities()` + +```php +getPersonActivities($id, $start, $limit, $done, $exclude): \Pipedrive\Model\ListActivitiesResponse +``` + +List activities associated with a person + +Lists activities associated with a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$done = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. +$exclude = 'exclude_example'; // string | A comma-separated string of activity IDs to exclude from result + +try { + $result = $apiInstance->getPersonActivities($id, $start, $limit, $done, $exclude); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonActivities: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **done** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. | [optional] + **exclude** | **string**| A comma-separated string of activity IDs to exclude from result | [optional] + +### Return type + +[**\Pipedrive\Model\ListActivitiesResponse**](../Model/ListActivitiesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonDeals()` + +```php +getPersonDeals($id, $start, $limit, $status, $sort): \Pipedrive\Model\ListDealsResponse +``` + +List deals associated with a person + +Lists deals associated with a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$status = 'all_not_deleted'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). + +try { + $result = $apiInstance->getPersonDeals($id, $start, $limit, $status, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. | [optional] [default to 'all_not_deleted'] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + +### Return type + +[**\Pipedrive\Model\ListDealsResponse**](../Model/ListDealsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonFiles()` + +```php +getPersonFiles($id, $start, $limit, $sort): \Pipedrive\Model\ListFilesResponse +``` + +List files attached to a person + +Lists files associated with a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. + +try { + $result = $apiInstance->getPersonFiles($id, $start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. | [optional] + +### Return type + +[**\Pipedrive\Model\ListFilesResponse**](../Model/ListFilesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonFollowers()` + +```php +getPersonFollowers($id): \Pipedrive\Model\ListFollowersResponse +``` + +List followers of a person + +Lists the followers of a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person + +try { + $result = $apiInstance->getPersonFollowers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonFollowers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + +### Return type + +[**\Pipedrive\Model\ListFollowersResponse**](../Model/ListFollowersResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonMailMessages()` + +```php +getPersonMailMessages($id, $start, $limit): \Pipedrive\Model\ListMailMessagesResponse +``` + +List mail messages associated with a person + +Lists mail messages associated with a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getPersonMailMessages($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonMailMessages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListMailMessagesResponse**](../Model/ListMailMessagesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonProducts()` + +```php +getPersonProducts($id, $start, $limit): \Pipedrive\Model\ListPersonProductsResponse +``` + +List products associated with a person + +Lists products associated with a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getPersonProducts($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonProducts: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListPersonProductsResponse**](../Model/ListPersonProductsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonUpdates()` + +```php +getPersonUpdates($id, $start, $limit, $all_changes, $items): \Pipedrive\Model\PersonFlowResponse +``` + +List updates about a person + +Lists updates about a person.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint's response will also include updates for the `marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$all_changes = 'all_changes_example'; // string | Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. +$items = 'items_example'; // string | A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) + +try { + $result = $apiInstance->getPersonUpdates($id, $start, $limit, $all_changes, $items); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonUpdates: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **all_changes** | **string**| Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. | [optional] + **items** | **string**| A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) | [optional] + +### Return type + +[**\Pipedrive\Model\PersonFlowResponse**](../Model/PersonFlowResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersonUsers()` + +```php +getPersonUsers($id): \Pipedrive\Model\ListPermittedUsersResponse1 +``` + +List permitted users + +List users permitted to access a person. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person + +try { + $result = $apiInstance->getPersonUsers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersonUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + +### Return type + +[**\Pipedrive\Model\ListPermittedUsersResponse1**](../Model/ListPermittedUsersResponse1.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPersons()` + +```php +getPersons($user_id, $filter_id, $first_char, $start, $limit, $sort): \Pipedrive\Model\GetAllPersonsResponse +``` + +Get all persons + +Returns all persons. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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_id = 56; // int | If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. +$filter_id = 56; // int | The ID of the filter to use +$first_char = 'first_char_example'; // string | If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). + +try { + $result = $apiInstance->getPersons($user_id, $filter_id, $first_char, $start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->getPersons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **first_char** | **string**| If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional] + +### Return type + +[**\Pipedrive\Model\GetAllPersonsResponse**](../Model/GetAllPersonsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `mergePersons()` + +```php +mergePersons($id, $merge_persons_request): \Pipedrive\Model\MergePersonsResponse +``` + +Merge two persons + +Merges a person with another person. For more information, see the tutorial for merging two persons. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$merge_persons_request = new \Pipedrive\Model\MergePersonsRequest(); // \Pipedrive\Model\MergePersonsRequest + +try { + $result = $apiInstance->mergePersons($id, $merge_persons_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->mergePersons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **merge_persons_request** | [**\Pipedrive\Model\MergePersonsRequest**](../Model/MergePersonsRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\MergePersonsResponse**](../Model/MergePersonsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `searchPersons()` + +```php +searchPersons($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit): \Pipedrive\Model\PersonSearchResponse +``` + +Search persons + +Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$fields = 'fields_example'; // string | A comma-separated string array. The fields to perform the search from. Defaults to all of them. +$exact_match = True; // bool | When enabled, only full exact matches against the given term are returned. It is not case sensitive. +$organization_id = 56; // int | Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. +$include_fields = 'include_fields_example'; // string | Supports including optional fields in the results which are not provided by default +$start = 0; // int | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchPersons($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->searchPersons: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **fields** | **string**| A comma-separated string array. The fields to perform the search from. Defaults to all of them. | [optional] + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | [optional] + **organization_id** | **int**| Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. | [optional] + **include_fields** | **string**| Supports including optional fields in the results which are not provided by default | [optional] + **start** | **int**| Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\PersonSearchResponse**](../Model/PersonSearchResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePerson()` + +```php +updatePerson($id, $update_person): \Pipedrive\Model\UpdatePersonResponse +``` + +Update a person + +Updates the properties of a person. For more information, see the tutorial for updating a person.
If a company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `data.marketing_status` field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PersonsApi( + // If you want use 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 person +$update_person = new \Pipedrive\Model\UpdatePerson(); // \Pipedrive\Model\UpdatePerson + +try { + $result = $apiInstance->updatePerson($id, $update_person); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PersonsApi->updatePerson: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the person | + **update_person** | [**\Pipedrive\Model\UpdatePerson**](../Model/UpdatePerson.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\UpdatePersonResponse**](../Model/UpdatePersonResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/PipelinesApi.md b/docs/Api/PipelinesApi.md new file mode 100644 index 00000000..1a105b26 --- /dev/null +++ b/docs/Api/PipelinesApi.md @@ -0,0 +1,564 @@ +# Pipedrive\PipelinesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPipeline()**](PipelinesApi.md#addPipeline) | **POST** /pipelines | Add a new pipeline +[**deletePipeline()**](PipelinesApi.md#deletePipeline) | **DELETE** /pipelines/{id} | Delete a pipeline +[**getPipeline()**](PipelinesApi.md#getPipeline) | **GET** /pipelines/{id} | Get one pipeline +[**getPipelineConversionStatistics()**](PipelinesApi.md#getPipelineConversionStatistics) | **GET** /pipelines/{id}/conversion_statistics | Get deals conversion rates in pipeline +[**getPipelineDeals()**](PipelinesApi.md#getPipelineDeals) | **GET** /pipelines/{id}/deals | Get deals in a pipeline +[**getPipelineMovementStatistics()**](PipelinesApi.md#getPipelineMovementStatistics) | **GET** /pipelines/{id}/movement_statistics | Get deals movements in pipeline +[**getPipelines()**](PipelinesApi.md#getPipelines) | **GET** /pipelines | Get all pipelines +[**updatePipeline()**](PipelinesApi.md#updatePipeline) | **PUT** /pipelines/{id} | Update a pipeline + + +## `addPipeline()` + +```php +addPipeline($pipeline): \Pipedrive\Model\AddNewPipeline +``` + +Add a new pipeline + +Adds a new pipeline. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$pipeline = new \Pipedrive\Model\Pipeline(); // \Pipedrive\Model\Pipeline + +try { + $result = $apiInstance->addPipeline($pipeline); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->addPipeline: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline** | [**\Pipedrive\Model\Pipeline**](../Model/Pipeline.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\AddNewPipeline**](../Model/AddNewPipeline.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deletePipeline()` + +```php +deletePipeline($id): \Pipedrive\Model\DeletePipelineResponse200 +``` + +Delete a pipeline + +Marks a pipeline as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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 pipeline + +try { + $result = $apiInstance->deletePipeline($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->deletePipeline: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the pipeline | + +### Return type + +[**\Pipedrive\Model\DeletePipelineResponse200**](../Model/DeletePipelineResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPipeline()` + +```php +getPipeline($id, $totals_convert_currency): \Pipedrive\Model\GetOnePipeline +``` + +Get one pipeline + +Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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 pipeline +$totals_convert_currency = 'totals_convert_currency_example'; // string | The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. + +try { + $result = $apiInstance->getPipeline($id, $totals_convert_currency); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->getPipeline: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the pipeline | + **totals_convert_currency** | **string**| The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. | [optional] + +### Return type + +[**\Pipedrive\Model\GetOnePipeline**](../Model/GetOnePipeline.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPipelineConversionStatistics()` + +```php +getPipelineConversionStatistics($id, $start_date, $end_date, $user_id): \Pipedrive\Model\GetDealsConversionRatesInPipeline +``` + +Get deals conversion rates in pipeline + +Returns all stage-to-stage conversion and pipeline-to-close rates for the given time period. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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 pipeline +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The start of the period. Date in format of YYYY-MM-DD. +$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The end of the period. Date in format of YYYY-MM-DD. +$user_id = 56; // int | The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. + +try { + $result = $apiInstance->getPipelineConversionStatistics($id, $start_date, $end_date, $user_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->getPipelineConversionStatistics: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the pipeline | + **start_date** | **\DateTime**| The start of the period. Date in format of YYYY-MM-DD. | + **end_date** | **\DateTime**| The end of the period. Date in format of YYYY-MM-DD. | + **user_id** | **int**| The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. | [optional] + +### Return type + +[**\Pipedrive\Model\GetDealsConversionRatesInPipeline**](../Model/GetDealsConversionRatesInPipeline.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPipelineDeals()` + +```php +getPipelineDeals($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency): \Pipedrive\Model\GetStageDeals +``` + +Get deals in a pipeline + +Lists deals in a specific pipeline across all its stages. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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 pipeline +$filter_id = 56; // int | If supplied, only deals matching the given filter will be returned +$user_id = 56; // int | If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. +$everyone = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned +$stage_id = 56; // int | If supplied, only deals within the given stage will be returned +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$get_summary = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether to include a summary of the pipeline in the `additional_data` or not +$totals_convert_currency = 'totals_convert_currency_example'; // string | The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. + +try { + $result = $apiInstance->getPipelineDeals($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->getPipelineDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the pipeline | + **filter_id** | **int**| If supplied, only deals matching the given filter will be returned | [optional] + **user_id** | **int**| If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. | [optional] + **everyone** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned | [optional] + **stage_id** | **int**| If supplied, only deals within the given stage will be returned | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **get_summary** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether to include a summary of the pipeline in the `additional_data` or not | [optional] + **totals_convert_currency** | **string**| The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. | [optional] + +### Return type + +[**\Pipedrive\Model\GetStageDeals**](../Model/GetStageDeals.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPipelineMovementStatistics()` + +```php +getPipelineMovementStatistics($id, $start_date, $end_date, $user_id): \Pipedrive\Model\GetDealsMovementsInPipeline +``` + +Get deals movements in pipeline + +Returns statistics for deals movements for the given time period. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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 pipeline +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The start of the period. Date in format of YYYY-MM-DD. +$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The end of the period. Date in format of YYYY-MM-DD. +$user_id = 56; // int | The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. + +try { + $result = $apiInstance->getPipelineMovementStatistics($id, $start_date, $end_date, $user_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->getPipelineMovementStatistics: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the pipeline | + **start_date** | **\DateTime**| The start of the period. Date in format of YYYY-MM-DD. | + **end_date** | **\DateTime**| The end of the period. Date in format of YYYY-MM-DD. | + **user_id** | **int**| The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. | [optional] + +### Return type + +[**\Pipedrive\Model\GetDealsMovementsInPipeline**](../Model/GetDealsMovementsInPipeline.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPipelines()` + +```php +getPipelines(): \Pipedrive\Model\GetAllPipelines +``` + +Get all pipelines + +Returns data about all pipelines. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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->getPipelines(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->getPipelines: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\GetAllPipelines**](../Model/GetAllPipelines.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePipeline()` + +```php +updatePipeline($id, $pipeline): \Pipedrive\Model\EditPipeline +``` + +Update a pipeline + +Updates the properties of a pipeline. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\PipelinesApi( + // If you want use 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 pipeline +$pipeline = new \Pipedrive\Model\Pipeline(); // \Pipedrive\Model\Pipeline + +try { + $result = $apiInstance->updatePipeline($id, $pipeline); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PipelinesApi->updatePipeline: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the pipeline | + **pipeline** | [**\Pipedrive\Model\Pipeline**](../Model/Pipeline.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\EditPipeline**](../Model/EditPipeline.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/ProductFieldsApi.md b/docs/Api/ProductFieldsApi.md new file mode 100644 index 00000000..f866b675 --- /dev/null +++ b/docs/Api/ProductFieldsApi.md @@ -0,0 +1,407 @@ +# Pipedrive\ProductFieldsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addProductField()**](ProductFieldsApi.md#addProductField) | **POST** /productFields | Add a new product field +[**deleteProductField()**](ProductFieldsApi.md#deleteProductField) | **DELETE** /productFields/{id} | Delete a product field +[**deleteProductFields()**](ProductFieldsApi.md#deleteProductFields) | **DELETE** /productFields | Delete multiple product fields in bulk +[**getProductField()**](ProductFieldsApi.md#getProductField) | **GET** /productFields/{id} | Get one product field +[**getProductFields()**](ProductFieldsApi.md#getProductFields) | **GET** /productFields | Get all product fields +[**updateProductField()**](ProductFieldsApi.md#updateProductField) | **PUT** /productFields/{id} | Update a product field + + +## `addProductField()` + +```php +addProductField($new_product_field): \Pipedrive\Model\GetProductFieldResponse +``` + +Add a new product field + +Adds a new product field. For more information, see the tutorial for adding a new custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$new_product_field = new \Pipedrive\Model\NewProductField(); // \Pipedrive\Model\NewProductField + +try { + $result = $apiInstance->addProductField($new_product_field); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductFieldsApi->addProductField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **new_product_field** | [**\Pipedrive\Model\NewProductField**](../Model/NewProductField.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetProductFieldResponse**](../Model/GetProductFieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteProductField()` + +```php +deleteProductField($id): \Pipedrive\Model\DeleteProductFieldResponse +``` + +Delete a product field + +Marks a product field as deleted. For more information, see the tutorial for deleting a custom field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductFieldsApi( + // If you want use 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 product field + +try { + $result = $apiInstance->deleteProductField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductFieldsApi->deleteProductField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product field | + +### Return type + +[**\Pipedrive\Model\DeleteProductFieldResponse**](../Model/DeleteProductFieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteProductFields()` + +```php +deleteProductFields($ids): \Pipedrive\Model\DeleteMultipleProductFieldsResponse +``` + +Delete multiple product fields in bulk + +Marks multiple fields as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated field IDs to delete + +try { + $result = $apiInstance->deleteProductFields($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductFieldsApi->deleteProductFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated field IDs to delete | + +### Return type + +[**\Pipedrive\Model\DeleteMultipleProductFieldsResponse**](../Model/DeleteMultipleProductFieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProductField()` + +```php +getProductField($id): \Pipedrive\Model\GetProductFieldResponse +``` + +Get one product field + +Returns data about a specific product field. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductFieldsApi( + // If you want use 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 product field + +try { + $result = $apiInstance->getProductField($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductFieldsApi->getProductField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product field | + +### Return type + +[**\Pipedrive\Model\GetProductFieldResponse**](../Model/GetProductFieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProductFields()` + +```php +getProductFields($start, $limit): \Pipedrive\Model\GetAllProductFieldsResponse +``` + +Get all product fields + +Returns data about all product fields. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductFieldsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getProductFields($start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductFieldsApi->getProductFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetAllProductFieldsResponse**](../Model/GetAllProductFieldsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateProductField()` + +```php +updateProductField($id, $update_product_field): \Pipedrive\Model\GetProductFieldResponse +``` + +Update a product field + +Updates a product field. For more information, see the tutorial for updating custom fields' values. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductFieldsApi( + // If you want use 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 product field +$update_product_field = new \Pipedrive\Model\UpdateProductField(); // \Pipedrive\Model\UpdateProductField + +try { + $result = $apiInstance->updateProductField($id, $update_product_field); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductFieldsApi->updateProductField: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product field | + **update_product_field** | [**\Pipedrive\Model\UpdateProductField**](../Model/UpdateProductField.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetProductFieldResponse**](../Model/GetProductFieldResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/ProductsApi.md b/docs/Api/ProductsApi.md new file mode 100644 index 00000000..2b512fc0 --- /dev/null +++ b/docs/Api/ProductsApi.md @@ -0,0 +1,843 @@ +# Pipedrive\ProductsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addProduct()**](ProductsApi.md#addProduct) | **POST** /products | Add a product +[**addProductFollower()**](ProductsApi.md#addProductFollower) | **POST** /products/{id}/followers | Add a follower to a product +[**deleteProduct()**](ProductsApi.md#deleteProduct) | **DELETE** /products/{id} | Delete a product +[**deleteProductFollower()**](ProductsApi.md#deleteProductFollower) | **DELETE** /products/{id}/followers/{follower_id} | Delete a follower from a product +[**getProduct()**](ProductsApi.md#getProduct) | **GET** /products/{id} | Get one product +[**getProductDeals()**](ProductsApi.md#getProductDeals) | **GET** /products/{id}/deals | Get deals where a product is attached to +[**getProductFiles()**](ProductsApi.md#getProductFiles) | **GET** /products/{id}/files | List files attached to a product +[**getProductFollowers()**](ProductsApi.md#getProductFollowers) | **GET** /products/{id}/followers | List followers of a product +[**getProductUsers()**](ProductsApi.md#getProductUsers) | **GET** /products/{id}/permittedUsers | List permitted users +[**getProducts()**](ProductsApi.md#getProducts) | **GET** /products | Get all products +[**searchProducts()**](ProductsApi.md#searchProducts) | **GET** /products/search | Search products +[**updateProduct()**](ProductsApi.md#updateProduct) | **PUT** /products/{id} | Update a product + + +## `addProduct()` + +```php +addProduct($add_product_request_body): \Pipedrive\Model\ProductResponse +``` + +Add a product + +Adds a new product to the Products inventory. For more information, see the tutorial for adding a product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_product_request_body = new \Pipedrive\Model\AddProductRequestBody(); // \Pipedrive\Model\AddProductRequestBody + +try { + $result = $apiInstance->addProduct($add_product_request_body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->addProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_product_request_body** | [**\Pipedrive\Model\AddProductRequestBody**](../Model/AddProductRequestBody.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\ProductResponse**](../Model/ProductResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addProductFollower()` + +```php +addProductFollower($id, $add_product_follower_request): \Pipedrive\Model\NewFollowerResponse +``` + +Add a follower to a product + +Adds a follower to a product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product +$add_product_follower_request = new \Pipedrive\Model\AddProductFollowerRequest(); // \Pipedrive\Model\AddProductFollowerRequest + +try { + $result = $apiInstance->addProductFollower($id, $add_product_follower_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->addProductFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + **add_product_follower_request** | [**\Pipedrive\Model\AddProductFollowerRequest**](../Model/AddProductFollowerRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\NewFollowerResponse**](../Model/NewFollowerResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteProduct()` + +```php +deleteProduct($id): \Pipedrive\Model\DeleteProductResponse +``` + +Delete a product + +Marks a product as deleted. After 30 days, the product will be permanently deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product + +try { + $result = $apiInstance->deleteProduct($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->deleteProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + +### Return type + +[**\Pipedrive\Model\DeleteProductResponse**](../Model/DeleteProductResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteProductFollower()` + +```php +deleteProductFollower($id, $follower_id): \Pipedrive\Model\DeleteProductFollowerResponse +``` + +Delete a follower from a product + +Deletes a follower from a product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product +$follower_id = 56; // int | The ID of the relationship between the follower and the product + +try { + $result = $apiInstance->deleteProductFollower($id, $follower_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->deleteProductFollower: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + **follower_id** | **int**| The ID of the relationship between the follower and the product | + +### Return type + +[**\Pipedrive\Model\DeleteProductFollowerResponse**](../Model/DeleteProductFollowerResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProduct()` + +```php +getProduct($id): \Pipedrive\Model\ProductResponse +``` + +Get one product + +Returns data about a specific product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product + +try { + $result = $apiInstance->getProduct($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->getProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + +### Return type + +[**\Pipedrive\Model\ProductResponse**](../Model/ProductResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProductDeals()` + +```php +getProductDeals($id, $start, $limit, $status): \Pipedrive\Model\ListDealsResponse +``` + +Get deals where a product is attached to + +Returns data about deals that have a product attached to it. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$status = 'all_not_deleted'; // string | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. + +try { + $result = $apiInstance->getProductDeals($id, $start, $limit, $status); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->getProductDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **status** | **string**| Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. | [optional] [default to 'all_not_deleted'] + +### Return type + +[**\Pipedrive\Model\ListDealsResponse**](../Model/ListDealsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProductFiles()` + +```php +getProductFiles($id, $start, $limit, $sort): \Pipedrive\Model\ListProductFilesResponse +``` + +List files attached to a product + +Lists files associated with a product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page +$sort = 'sort_example'; // string | The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` + +try { + $result = $apiInstance->getProductFiles($id, $start, $limit, $sort); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->getProductFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + **sort** | **string**| The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` | [optional] + +### Return type + +[**\Pipedrive\Model\ListProductFilesResponse**](../Model/ListProductFilesResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProductFollowers()` + +```php +getProductFollowers($id, $start, $limit): \Pipedrive\Model\ListProductFollowersResponse +``` + +List followers of a product + +Lists the followers of a product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getProductFollowers($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->getProductFollowers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ListProductFollowersResponse**](../Model/ListProductFollowersResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProductUsers()` + +```php +getProductUsers($id): \Pipedrive\Model\UserIDs +``` + +List permitted users + +Lists users permitted to access a product. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product + +try { + $result = $apiInstance->getProductUsers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->getProductUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + +### Return type + +[**\Pipedrive\Model\UserIDs**](../Model/UserIDs.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProducts()` + +```php +getProducts($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit): \Pipedrive\Model\ProductsResponse +``` + +Get all products + +Returns data about all products. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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_id = 56; // int | If supplied, only products owned by the given user will be returned +$filter_id = 56; // int | The ID of the filter to use +$ids = array(56); // int[] | An array of integers with the IDs of the products that should be returned in the response +$first_char = 'first_char_example'; // string | If supplied, only products whose name starts with the specified letter will be returned (case insensitive) +$get_summary = True; // bool | If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getProducts($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->getProducts: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **int**| If supplied, only products owned by the given user will be returned | [optional] + **filter_id** | **int**| The ID of the filter to use | [optional] + **ids** | [**int[]**](../Model/int.md)| An array of integers with the IDs of the products that should be returned in the response | [optional] + **first_char** | **string**| If supplied, only products whose name starts with the specified letter will be returned (case insensitive) | [optional] + **get_summary** | **bool**| If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ProductsResponse**](../Model/ProductsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchProducts()` + +```php +searchProducts($term, $fields, $exact_match, $include_fields, $start, $limit): \Pipedrive\Model\ProductSearchResponse +``` + +Search products + +Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. +$fields = 'fields_example'; // string | A comma-separated string array. The fields to perform the search from. Defaults to all of them. +$exact_match = True; // bool | When enabled, only full exact matches against the given term are returned. It is not case sensitive. +$include_fields = 'include_fields_example'; // string | Supports including optional fields in the results which are not provided by default +$start = 0; // int | Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->searchProducts($term, $fields, $exact_match, $include_fields, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->searchProducts: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. | + **fields** | **string**| A comma-separated string array. The fields to perform the search from. Defaults to all of them. | [optional] + **exact_match** | **bool**| When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. | [optional] + **include_fields** | **string**| Supports including optional fields in the results which are not provided by default | [optional] + **start** | **int**| Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\ProductSearchResponse**](../Model/ProductSearchResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateProduct()` + +```php +updateProduct($id, $update_product_request_body): \Pipedrive\Model\UpdateProductResponse +``` + +Update a product + +Updates product data. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\ProductsApi( + // If you want use 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 product +$update_product_request_body = new \Pipedrive\Model\UpdateProductRequestBody(); // \Pipedrive\Model\UpdateProductRequestBody + +try { + $result = $apiInstance->updateProduct($id, $update_product_request_body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductsApi->updateProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the product | + **update_product_request_body** | [**\Pipedrive\Model\UpdateProductRequestBody**](../Model/UpdateProductRequestBody.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\UpdateProductResponse**](../Model/UpdateProductResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/RecentsApi.md b/docs/Api/RecentsApi.md new file mode 100644 index 00000000..e9e81e32 --- /dev/null +++ b/docs/Api/RecentsApi.md @@ -0,0 +1,79 @@ +# Pipedrive\RecentsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getRecents()**](RecentsApi.md#getRecents) | **GET** /recents | Get recents + + +## `getRecents()` + +```php +getRecents($since_timestamp, $items, $start, $limit): \Pipedrive\Model\GetRecents +``` + +Get recents + +Returns data about all recent changes occurred after the given timestamp. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RecentsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$since_timestamp = 'since_timestamp_example'; // string | The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS +$items = 'items_example'; // string | Multiple selection of item types to include in the query (optional) +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getRecents($since_timestamp, $items, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RecentsApi->getRecents: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **since_timestamp** | **string**| The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS | + **items** | **string**| Multiple selection of item types to include in the query (optional) | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetRecents**](../Model/GetRecents.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/RolesApi.md b/docs/Api/RolesApi.md new file mode 100644 index 00000000..95db193a --- /dev/null +++ b/docs/Api/RolesApi.md @@ -0,0 +1,817 @@ +# Pipedrive\RolesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addOrUpdateRoleSetting()**](RolesApi.md#addOrUpdateRoleSetting) | **POST** /roles/{id}/settings | Add or update role setting +[**addRole()**](RolesApi.md#addRole) | **POST** /roles | Add a role +[**addRoleAssignment()**](RolesApi.md#addRoleAssignment) | **POST** /roles/{id}/assignments | Add role assignment +[**deleteRole()**](RolesApi.md#deleteRole) | **DELETE** /roles/{id} | Delete a role +[**deleteRoleAssignment()**](RolesApi.md#deleteRoleAssignment) | **DELETE** /roles/{id}/assignments | Delete a role assignment +[**getRole()**](RolesApi.md#getRole) | **GET** /roles/{id} | Get one role +[**getRoleAssignments()**](RolesApi.md#getRoleAssignments) | **GET** /roles/{id}/assignments | List role assignments +[**getRolePipelines()**](RolesApi.md#getRolePipelines) | **GET** /roles/{id}/pipelines | List pipeline visibility for a role +[**getRoleSettings()**](RolesApi.md#getRoleSettings) | **GET** /roles/{id}/settings | List role settings +[**getRoles()**](RolesApi.md#getRoles) | **GET** /roles | Get all roles +[**updateRole()**](RolesApi.md#updateRole) | **PUT** /roles/{id} | Update role details +[**updateRolePipelines()**](RolesApi.md#updateRolePipelines) | **PUT** /roles/{id}/pipelines | Update pipeline visibility for a role + + +## `addOrUpdateRoleSetting()` + +```php +addOrUpdateRoleSetting($id, $add_or_update_role_setting_request): \Pipedrive\Model\PostRoleSettings +``` + +Add or update role setting + +Adds or updates the visibility setting for a role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$add_or_update_role_setting_request = new \Pipedrive\Model\AddOrUpdateRoleSettingRequest(); // \Pipedrive\Model\AddOrUpdateRoleSettingRequest + +try { + $result = $apiInstance->addOrUpdateRoleSetting($id, $add_or_update_role_setting_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->addOrUpdateRoleSetting: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **add_or_update_role_setting_request** | [**\Pipedrive\Model\AddOrUpdateRoleSettingRequest**](../Model/AddOrUpdateRoleSettingRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostRoleSettings**](../Model/PostRoleSettings.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addRole()` + +```php +addRole($add_role): \Pipedrive\Model\PostRoles +``` + +Add a role + +Adds a new role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_role = new \Pipedrive\Model\AddRole(); // \Pipedrive\Model\AddRole + +try { + $result = $apiInstance->addRole($add_role); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->addRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_role** | [**\Pipedrive\Model\AddRole**](../Model/AddRole.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostRoles**](../Model/PostRoles.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addRoleAssignment()` + +```php +addRoleAssignment($id, $add_role_assignment_request): \Pipedrive\Model\PostRoleAssignment +``` + +Add role assignment + +Assigns a user to a role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$add_role_assignment_request = new \Pipedrive\Model\AddRoleAssignmentRequest(); // \Pipedrive\Model\AddRoleAssignmentRequest + +try { + $result = $apiInstance->addRoleAssignment($id, $add_role_assignment_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->addRoleAssignment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **add_role_assignment_request** | [**\Pipedrive\Model\AddRoleAssignmentRequest**](../Model/AddRoleAssignmentRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PostRoleAssignment**](../Model/PostRoleAssignment.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteRole()` + +```php +deleteRole($id): \Pipedrive\Model\DeleteRole +``` + +Delete a role + +Marks a role as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role + +try { + $result = $apiInstance->deleteRole($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->deleteRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + +### Return type + +[**\Pipedrive\Model\DeleteRole**](../Model/DeleteRole.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteRoleAssignment()` + +```php +deleteRoleAssignment($id, $delete_role_assignment_request): \Pipedrive\Model\DeleteRoleAssignment +``` + +Delete a role assignment + +Removes the assigned user from a role and adds to the default role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$delete_role_assignment_request = new \Pipedrive\Model\DeleteRoleAssignmentRequest(); // \Pipedrive\Model\DeleteRoleAssignmentRequest + +try { + $result = $apiInstance->deleteRoleAssignment($id, $delete_role_assignment_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->deleteRoleAssignment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **delete_role_assignment_request** | [**\Pipedrive\Model\DeleteRoleAssignmentRequest**](../Model/DeleteRoleAssignmentRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\DeleteRoleAssignment**](../Model/DeleteRoleAssignment.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `getRole()` + +```php +getRole($id): \Pipedrive\Model\GetRole +``` + +Get one role + +Returns the details of a specific role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role + +try { + $result = $apiInstance->getRole($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->getRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + +### Return type + +[**\Pipedrive\Model\GetRole**](../Model/GetRole.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRoleAssignments()` + +```php +getRoleAssignments($id, $start, $limit): \Pipedrive\Model\GetRoleAssignments +``` + +List role assignments + +Returns all users assigned to a role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getRoleAssignments($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->getRoleAssignments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetRoleAssignments**](../Model/GetRoleAssignments.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRolePipelines()` + +```php +getRolePipelines($id, $visible): \Pipedrive\Model\GetRolePipelines +``` + +List pipeline visibility for a role + +Returns the list of either visible or hidden pipeline IDs for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$visible = true; // bool | Whether to return the visible or hidden pipelines for the role + +try { + $result = $apiInstance->getRolePipelines($id, $visible); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->getRolePipelines: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **visible** | **bool**| Whether to return the visible or hidden pipelines for the role | [optional] [default to true] + +### Return type + +[**\Pipedrive\Model\GetRolePipelines**](../Model/GetRolePipelines.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRoleSettings()` + +```php +getRoleSettings($id): \Pipedrive\Model\GetRoleSettings +``` + +List role settings + +Returns the visibility settings of a specific role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role + +try { + $result = $apiInstance->getRoleSettings($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->getRoleSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + +### Return type + +[**\Pipedrive\Model\GetRoleSettings**](../Model/GetRoleSettings.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRoles()` + +```php +getRoles($start, $limit): \Pipedrive\Model\GetRoles +``` + +Get all roles + +Returns all the roles within the company. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getRoles($start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->getRoles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetRoles**](../Model/GetRoles.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateRole()` + +```php +updateRole($id, $base_role): \Pipedrive\Model\PutRole +``` + +Update role details + +Updates the parent role and/or the name of a specific role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$base_role = new \Pipedrive\Model\BaseRole(); // \Pipedrive\Model\BaseRole + +try { + $result = $apiInstance->updateRole($id, $base_role); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->updateRole: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **base_role** | [**\Pipedrive\Model\BaseRole**](../Model/BaseRole.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\PutRole**](../Model/PutRole.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `updateRolePipelines()` + +```php +updateRolePipelines($id, $put_role_pipelines_body): \Pipedrive\Model\GetRolePipelines +``` + +Update pipeline visibility for a role + +Updates the specified pipelines to be visible and/or hidden for a specific role. For more information on pipeline visibility, please refer to the Visibility groups article. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\RolesApi( + // If you want use 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 role +$put_role_pipelines_body = new \Pipedrive\Model\PutRolePipelinesBody(); // \Pipedrive\Model\PutRolePipelinesBody + +try { + $result = $apiInstance->updateRolePipelines($id, $put_role_pipelines_body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->updateRolePipelines: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the role | + **put_role_pipelines_body** | [**\Pipedrive\Model\PutRolePipelinesBody**](../Model/PutRolePipelinesBody.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetRolePipelines**](../Model/GetRolePipelines.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/StagesApi.md b/docs/Api/StagesApi.md new file mode 100644 index 00000000..4fdb6baf --- /dev/null +++ b/docs/Api/StagesApi.md @@ -0,0 +1,487 @@ +# Pipedrive\StagesApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addStage()**](StagesApi.md#addStage) | **POST** /stages | Add a new stage +[**deleteStage()**](StagesApi.md#deleteStage) | **DELETE** /stages/{id} | Delete a stage +[**deleteStages()**](StagesApi.md#deleteStages) | **DELETE** /stages | Delete multiple stages in bulk +[**getStage()**](StagesApi.md#getStage) | **GET** /stages/{id} | Get one stage +[**getStageDeals()**](StagesApi.md#getStageDeals) | **GET** /stages/{id}/deals | Get deals in a stage +[**getStages()**](StagesApi.md#getStages) | **GET** /stages | Get all stages +[**updateStage()**](StagesApi.md#updateStage) | **PUT** /stages/{id} | Update stage details + + +## `addStage()` + +```php +addStage($stage): \Pipedrive\Model\GetAddUpdateStage +``` + +Add a new stage + +Adds a new stage, returns the ID upon success. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$stage = new \Pipedrive\Model\Stage(); // \Pipedrive\Model\Stage + +try { + $result = $apiInstance->addStage($stage); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->addStage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **stage** | [**\Pipedrive\Model\Stage**](../Model/Stage.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetAddUpdateStage**](../Model/GetAddUpdateStage.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteStage()` + +```php +deleteStage($id): \Pipedrive\Model\DeleteStageResponse200 +``` + +Delete a stage + +Marks a stage as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use 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 stage + +try { + $result = $apiInstance->deleteStage($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->deleteStage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the stage | + +### Return type + +[**\Pipedrive\Model\DeleteStageResponse200**](../Model/DeleteStageResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteStages()` + +```php +deleteStages($ids): \Pipedrive\Model\DeleteStagesResponse200 +``` + +Delete multiple stages in bulk + +Marks multiple stages as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$ids = 'ids_example'; // string | The comma-separated stage IDs to delete + +try { + $result = $apiInstance->deleteStages($ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->deleteStages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | **string**| The comma-separated stage IDs to delete | + +### Return type + +[**\Pipedrive\Model\DeleteStagesResponse200**](../Model/DeleteStagesResponse200.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getStage()` + +```php +getStage($id, $everyone): \Pipedrive\Model\GetOneStage +``` + +Get one stage + +Returns data about a specific stage. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use 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 stage +$everyone = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If `everyone=1` is provided, deals summary will return deals owned by every user + +try { + $result = $apiInstance->getStage($id, $everyone); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->getStage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the stage | + **everyone** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If `everyone=1` is provided, deals summary will return deals owned by every user | [optional] + +### Return type + +[**\Pipedrive\Model\GetOneStage**](../Model/GetOneStage.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getStageDeals()` + +```php +getStageDeals($id, $filter_id, $user_id, $everyone, $start, $limit): \Pipedrive\Model\GetStageDeals +``` + +Get deals in a stage + +Lists deals in a specific stage. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use 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 stage +$filter_id = 56; // int | If supplied, only deals matching the given filter will be returned +$user_id = 56; // int | If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. +$everyone = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getStageDeals($id, $filter_id, $user_id, $everyone, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->getStageDeals: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the stage | + **filter_id** | **int**| If supplied, only deals matching the given filter will be returned | [optional] + **user_id** | **int**| If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. | [optional] + **everyone** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetStageDeals**](../Model/GetStageDeals.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getStages()` + +```php +getStages($pipeline_id, $start, $limit): \Pipedrive\Model\GetStages +``` + +Get all stages + +Returns data about all stages. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$pipeline_id = 56; // int | The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getStages($pipeline_id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->getStages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_id** | **int**| The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. | [optional] + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetStages**](../Model/GetStages.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateStage()` + +```php +updateStage($id, $update_stage_request): \Pipedrive\Model\GetAddUpdateStage +``` + +Update stage details + +Updates the properties of a stage. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\StagesApi( + // If you want use 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 stage +$update_stage_request = new \Pipedrive\Model\UpdateStageRequest(); // \Pipedrive\Model\UpdateStageRequest + +try { + $result = $apiInstance->updateStage($id, $update_stage_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling StagesApi->updateStage: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the stage | + **update_stage_request** | [**\Pipedrive\Model\UpdateStageRequest**](../Model/UpdateStageRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\GetAddUpdateStage**](../Model/GetAddUpdateStage.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/SubscriptionsApi.md b/docs/Api/SubscriptionsApi.md new file mode 100644 index 00000000..a95efef9 --- /dev/null +++ b/docs/Api/SubscriptionsApi.md @@ -0,0 +1,607 @@ +# Pipedrive\SubscriptionsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addRecurringSubscription()**](SubscriptionsApi.md#addRecurringSubscription) | **POST** /subscriptions/recurring | Add a recurring subscription +[**addSubscriptionInstallment()**](SubscriptionsApi.md#addSubscriptionInstallment) | **POST** /subscriptions/installment | Add an installment subscription +[**cancelRecurringSubscription()**](SubscriptionsApi.md#cancelRecurringSubscription) | **PUT** /subscriptions/recurring/{id}/cancel | Cancel a recurring subscription +[**deleteSubscription()**](SubscriptionsApi.md#deleteSubscription) | **DELETE** /subscriptions/{id} | Delete a subscription +[**findSubscriptionByDeal()**](SubscriptionsApi.md#findSubscriptionByDeal) | **GET** /subscriptions/find/{dealId} | Find subscription by deal +[**getSubscription()**](SubscriptionsApi.md#getSubscription) | **GET** /subscriptions/{id} | Get details of a subscription +[**getSubscriptionPayments()**](SubscriptionsApi.md#getSubscriptionPayments) | **GET** /subscriptions/{id}/payments | Get all payments of a subscription +[**updateRecurringSubscription()**](SubscriptionsApi.md#updateRecurringSubscription) | **PUT** /subscriptions/recurring/{id} | Update a recurring subscription +[**updateSubscriptionInstallment()**](SubscriptionsApi.md#updateSubscriptionInstallment) | **PUT** /subscriptions/installment/{id} | Update an installment subscription + + +## `addRecurringSubscription()` + +```php +addRecurringSubscription($subscription_recurring_create_request): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Add a recurring subscription + +Adds a new recurring subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$subscription_recurring_create_request = new \Pipedrive\Model\SubscriptionRecurringCreateRequest(); // \Pipedrive\Model\SubscriptionRecurringCreateRequest + +try { + $result = $apiInstance->addRecurringSubscription($subscription_recurring_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->addRecurringSubscription: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_recurring_create_request** | [**\Pipedrive\Model\SubscriptionRecurringCreateRequest**](../Model/SubscriptionRecurringCreateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `addSubscriptionInstallment()` + +```php +addSubscriptionInstallment($subscription_installment_create_request): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Add an installment subscription + +Adds a new installment subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$subscription_installment_create_request = new \Pipedrive\Model\SubscriptionInstallmentCreateRequest(); // \Pipedrive\Model\SubscriptionInstallmentCreateRequest + +try { + $result = $apiInstance->addSubscriptionInstallment($subscription_installment_create_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->addSubscriptionInstallment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscription_installment_create_request** | [**\Pipedrive\Model\SubscriptionInstallmentCreateRequest**](../Model/SubscriptionInstallmentCreateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `cancelRecurringSubscription()` + +```php +cancelRecurringSubscription($id, $subscription_recurring_cancel_request): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Cancel a recurring subscription + +Cancels a recurring subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use 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 subscription +$subscription_recurring_cancel_request = new \Pipedrive\Model\SubscriptionRecurringCancelRequest(); // \Pipedrive\Model\SubscriptionRecurringCancelRequest + +try { + $result = $apiInstance->cancelRecurringSubscription($id, $subscription_recurring_cancel_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->cancelRecurringSubscription: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the subscription | + **subscription_recurring_cancel_request** | [**\Pipedrive\Model\SubscriptionRecurringCancelRequest**](../Model/SubscriptionRecurringCancelRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteSubscription()` + +```php +deleteSubscription($id): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Delete a subscription + +Marks an installment or a recurring subscription as deleted. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use 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 subscription + +try { + $result = $apiInstance->deleteSubscription($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->deleteSubscription: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the subscription | + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `findSubscriptionByDeal()` + +```php +findSubscriptionByDeal($deal_id): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Find subscription by deal + +Returns details of an installment or a recurring subscription by the deal ID. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$deal_id = 56; // int | The ID of the deal + +try { + $result = $apiInstance->findSubscriptionByDeal($deal_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->findSubscriptionByDeal: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deal_id** | **int**| The ID of the deal | + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSubscription()` + +```php +getSubscription($id): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Get details of a subscription + +Returns details of an installment or a recurring subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use 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 subscription + +try { + $result = $apiInstance->getSubscription($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->getSubscription: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the subscription | + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSubscriptionPayments()` + +```php +getSubscriptionPayments($id): \Pipedrive\Model\PaymentsResponse +``` + +Get all payments of a subscription + +Returns all payments of an installment or recurring subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use 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 subscription + +try { + $result = $apiInstance->getSubscriptionPayments($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->getSubscriptionPayments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the subscription | + +### Return type + +[**\Pipedrive\Model\PaymentsResponse**](../Model/PaymentsResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateRecurringSubscription()` + +```php +updateRecurringSubscription($id, $subscription_recurring_update_request): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Update a recurring subscription + +Updates a recurring subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use 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 subscription +$subscription_recurring_update_request = new \Pipedrive\Model\SubscriptionRecurringUpdateRequest(); // \Pipedrive\Model\SubscriptionRecurringUpdateRequest + +try { + $result = $apiInstance->updateRecurringSubscription($id, $subscription_recurring_update_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->updateRecurringSubscription: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the subscription | + **subscription_recurring_update_request** | [**\Pipedrive\Model\SubscriptionRecurringUpdateRequest**](../Model/SubscriptionRecurringUpdateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `updateSubscriptionInstallment()` + +```php +updateSubscriptionInstallment($id, $subscription_installment_update_request): \Pipedrive\Model\SubscriptionsIdResponse +``` + +Update an installment subscription + +Updates an installment subscription. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\SubscriptionsApi( + // If you want use 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 subscription +$subscription_installment_update_request = new \Pipedrive\Model\SubscriptionInstallmentUpdateRequest(); // \Pipedrive\Model\SubscriptionInstallmentUpdateRequest + +try { + $result = $apiInstance->updateSubscriptionInstallment($id, $subscription_installment_update_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionsApi->updateSubscriptionInstallment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the subscription | + **subscription_installment_update_request** | [**\Pipedrive\Model\SubscriptionInstallmentUpdateRequest**](../Model/SubscriptionInstallmentUpdateRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\SubscriptionsIdResponse**](../Model/SubscriptionsIdResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/UserConnectionsApi.md b/docs/Api/UserConnectionsApi.md new file mode 100644 index 00000000..a9411e36 --- /dev/null +++ b/docs/Api/UserConnectionsApi.md @@ -0,0 +1,70 @@ +# Pipedrive\UserConnectionsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getUserConnections()**](UserConnectionsApi.md#getUserConnections) | **GET** /userConnections | Get all user connections + + +## `getUserConnections()` + +```php +getUserConnections(): \Pipedrive\Model\UserConnections +``` + +Get all user connections + +Returns data about all connections for the authorized user. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UserConnectionsApi( + // If you want use 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->getUserConnections(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UserConnectionsApi->getUserConnections: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\UserConnections**](../Model/UserConnections.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/UserSettingsApi.md b/docs/Api/UserSettingsApi.md new file mode 100644 index 00000000..f5cf4a2b --- /dev/null +++ b/docs/Api/UserSettingsApi.md @@ -0,0 +1,70 @@ +# Pipedrive\UserSettingsApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getUserSettings()**](UserSettingsApi.md#getUserSettings) | **GET** /userSettings | List settings of an authorized user + + +## `getUserSettings()` + +```php +getUserSettings(): \Pipedrive\Model\UserSettings +``` + +List settings of an authorized user + +Lists the settings of an authorized user. Example response contains a shortened list of settings. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UserSettingsApi( + // If you want use 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->getUserSettings(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UserSettingsApi->getUserSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\UserSettings**](../Model/UserSettings.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/UsersApi.md b/docs/Api/UsersApi.md new file mode 100644 index 00000000..ba463105 --- /dev/null +++ b/docs/Api/UsersApi.md @@ -0,0 +1,669 @@ +# Pipedrive\UsersApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addUser()**](UsersApi.md#addUser) | **POST** /users | Add a new user +[**findUsersByName()**](UsersApi.md#findUsersByName) | **GET** /users/find | Find users by name +[**getCurrentUser()**](UsersApi.md#getCurrentUser) | **GET** /users/me | Get current user data +[**getUser()**](UsersApi.md#getUser) | **GET** /users/{id} | Get one user +[**getUserFollowers()**](UsersApi.md#getUserFollowers) | **GET** /users/{id}/followers | List followers of a user +[**getUserPermissions()**](UsersApi.md#getUserPermissions) | **GET** /users/{id}/permissions | List user permissions +[**getUserRoleAssignments()**](UsersApi.md#getUserRoleAssignments) | **GET** /users/{id}/roleAssignments | List role assignments +[**getUserRoleSettings()**](UsersApi.md#getUserRoleSettings) | **GET** /users/{id}/roleSettings | List user role settings +[**getUsers()**](UsersApi.md#getUsers) | **GET** /users | Get all users +[**updateUser()**](UsersApi.md#updateUser) | **PUT** /users/{id} | Update user details + + +## `addUser()` + +```php +addUser($add_user_request): \Pipedrive\Model\User +``` + +Add a new user + +Adds a new user to the company, returns the ID upon success. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_user_request = new \Pipedrive\Model\AddUserRequest(); // \Pipedrive\Model\AddUserRequest + +try { + $result = $apiInstance->addUser($add_user_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->addUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_user_request** | [**\Pipedrive\Model\AddUserRequest**](../Model/AddUserRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\User**](../Model/User.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `findUsersByName()` + +```php +findUsersByName($term, $search_by_email): \Pipedrive\Model\Users +``` + +Find users by name + +Finds users by their name. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$term = 'term_example'; // string | The search term to look for +$search_by_email = new \Pipedrive\Model\\Pipedrive\Model\NumberBooleanDefault0(); // \Pipedrive\Model\NumberBooleanDefault0 | When enabled, the term will only be matched against email addresses of users. Default: `false` + +try { + $result = $apiInstance->findUsersByName($term, $search_by_email); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->findUsersByName: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **term** | **string**| The search term to look for | + **search_by_email** | [**\Pipedrive\Model\NumberBooleanDefault0**](../Model/.md)| When enabled, the term will only be matched against email addresses of users. Default: `false` | [optional] + +### Return type + +[**\Pipedrive\Model\Users**](../Model/Users.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getCurrentUser()` + +```php +getCurrentUser(): \Pipedrive\Model\UserMe +``` + +Get current user data + +Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the `locale` property means 'Date/number format' in the Pipedrive account settings, not the chosen language. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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->getCurrentUser(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getCurrentUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\UserMe**](../Model/UserMe.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUser()` + +```php +getUser($id): \Pipedrive\Model\User +``` + +Get one user + +Returns data about a specific user within the company. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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 + +try { + $result = $apiInstance->getUser($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + +### Return type + +[**\Pipedrive\Model\User**](../Model/User.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserFollowers()` + +```php +getUserFollowers($id): \Pipedrive\Model\UserIDs +``` + +List followers of a user + +Lists the followers of a specific user. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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 + +try { + $result = $apiInstance->getUserFollowers($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getUserFollowers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + +### Return type + +[**\Pipedrive\Model\UserIDs**](../Model/UserIDs.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserPermissions()` + +```php +getUserPermissions($id): \Pipedrive\Model\UserPermissions +``` + +List user permissions + +Lists aggregated permissions over all assigned permission sets for a user. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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 + +try { + $result = $apiInstance->getUserPermissions($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getUserPermissions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + +### Return type + +[**\Pipedrive\Model\UserPermissions**](../Model/UserPermissions.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserRoleAssignments()` + +```php +getUserRoleAssignments($id, $start, $limit): \Pipedrive\Model\GetRoleAssignments +``` + +List role assignments + +Lists role assignments for a user. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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 +$start = 0; // int | Pagination start +$limit = 56; // int | Items shown per page + +try { + $result = $apiInstance->getUserRoleAssignments($id, $start, $limit); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getUserRoleAssignments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + **start** | **int**| Pagination start | [optional] [default to 0] + **limit** | **int**| Items shown per page | [optional] + +### Return type + +[**\Pipedrive\Model\GetRoleAssignments**](../Model/GetRoleAssignments.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserRoleSettings()` + +```php +getUserRoleSettings($id): \Pipedrive\Model\GetRoleSettings +``` + +List user role settings + +Lists the settings of user's assigned role. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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 + +try { + $result = $apiInstance->getUserRoleSettings($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getUserRoleSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + +### Return type + +[**\Pipedrive\Model\GetRoleSettings**](../Model/GetRoleSettings.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUsers()` + +```php +getUsers(): \Pipedrive\Model\Users +``` + +Get all users + +Returns data about all users within the company. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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->getUsers(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->getUsers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\Users**](../Model/Users.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateUser()` + +```php +updateUser($id, $update_user_request): \Pipedrive\Model\User +``` + +Update user details + +Updates the properties of a user. Currently, only `active_flag` can be updated. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\UsersApi( + // If you want use 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 +$update_user_request = new \Pipedrive\Model\UpdateUserRequest(); // \Pipedrive\Model\UpdateUserRequest + +try { + $result = $apiInstance->updateUser($id, $update_user_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->updateUser: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the user | + **update_user_request** | [**\Pipedrive\Model\UpdateUserRequest**](../Model/UpdateUserRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\User**](../Model/User.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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/WebhooksApi.md b/docs/Api/WebhooksApi.md new file mode 100644 index 00000000..29ee0047 --- /dev/null +++ b/docs/Api/WebhooksApi.md @@ -0,0 +1,202 @@ +# Pipedrive\WebhooksApi + +All URIs are relative to https://api.pipedrive.com/v1. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addWebhook()**](WebhooksApi.md#addWebhook) | **POST** /webhooks | Create a new Webhook +[**deleteWebhook()**](WebhooksApi.md#deleteWebhook) | **DELETE** /webhooks/{id} | Delete existing Webhook +[**getWebhooks()**](WebhooksApi.md#getWebhooks) | **GET** /webhooks | Get all Webhooks + + +## `addWebhook()` + +```php +addWebhook($add_webhook_request): \Pipedrive\Model\Webhook +``` + +Create a new Webhook + +Creates a new Webhook and returns its details. Note that specifying an event which triggers the Webhook combines 2 parameters - `event_action` and `event_object`. E.g., use `*.*` for getting notifications about all events, `added.deal` for any newly added deals, `deleted.persons` for any deleted persons, etc. See the guide for Webhooks for more details. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\WebhooksApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$add_webhook_request = new \Pipedrive\Model\AddWebhookRequest(); // \Pipedrive\Model\AddWebhookRequest + +try { + $result = $apiInstance->addWebhook($add_webhook_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhooksApi->addWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **add_webhook_request** | [**\Pipedrive\Model\AddWebhookRequest**](../Model/AddWebhookRequest.md)| | [optional] + +### Return type + +[**\Pipedrive\Model\Webhook**](../Model/Webhook.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `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) + +## `deleteWebhook()` + +```php +deleteWebhook($id): \Pipedrive\Model\BaseResponseWithStatus +``` + +Delete existing Webhook + +Deletes the specified Webhook. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\WebhooksApi( + // If you want use 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 Webhook to delete + +try { + $result = $apiInstance->deleteWebhook($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhooksApi->deleteWebhook: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| The ID of the Webhook to delete | + +### Return type + +[**\Pipedrive\Model\BaseResponseWithStatus**](../Model/BaseResponseWithStatus.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getWebhooks()` + +```php +getWebhooks(): \Pipedrive\Model\Webhooks +``` + +Get all Webhooks + +Returns data about all the Webhooks of a company. + +### Example + +```php +setApiKey('api_token', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer'); + +// Configure OAuth2 access token for authorization: oauth2 +$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Pipedrive\Api\WebhooksApi( + // If you want use 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->getWebhooks(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling WebhooksApi->getWebhooks: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Pipedrive\Model\Webhooks**](../Model/Webhooks.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `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/ActivityCollectionResponseObject.md b/docs/Model/ActivityCollectionResponseObject.md new file mode 100644 index 00000000..c8ea5d23 --- /dev/null +++ b/docs/Model/ActivityCollectionResponseObject.md @@ -0,0 +1,44 @@ +# # ActivityCollectionResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **\DateTime** | The due date of the activity. Format: YYYY-MM-DD | [optional] +**due_time** | **string** | The due time of the activity in UTC. Format: HH:MM | [optional] +**duration** | **string** | The duration of the activity. Format: HH:MM | [optional] +**deal_id** | **int** | The ID of the deal this activity is associated with | [optional] +**lead_id** | **string** | The ID of the lead in the UUID format this activity is associated with | [optional] +**person_id** | **int** | The ID of the person this activity is associated with | [optional] +**project_id** | **int** | The ID of the project this activity is associated with | [optional] +**org_id** | **int** | The ID of the organization this activity is associated with | [optional] +**location** | **string** | The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. | [optional] +**public_description** | **string** | Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. | [optional] +**id** | **int** | The ID of the activity, generated when the activity was created | [optional] +**done** | **bool** | Whether the activity is done or not | [optional] +**subject** | **string** | The subject of the activity | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to | [optional] +**busy_flag** | **bool** | Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**company_id** | **int** | The user's company ID | [optional] +**conference_meeting_client** | **string** | The ID of the Marketplace app, which is connected to this activity | [optional] +**conference_meeting_url** | **string** | The link to join the meeting which is associated with this activity | [optional] +**conference_meeting_id** | **string** | The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity | [optional] +**add_time** | **string** | The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**marked_as_done_time** | **string** | The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**active_flag** | **bool** | Whether the activity is active or not | [optional] +**update_time** | **string** | The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_user_id** | **int** | The ID of the user who was the last to update this activity | [optional] +**source_timezone** | **string** | The timezone the activity was created in an external calendar | [optional] +**location_subpremise** | **string** | A subfield of the location field. Indicates apartment/suite number. | [optional] +**location_street_number** | **string** | A subfield of the location field. Indicates house number. | [optional] +**location_route** | **string** | A subfield of the location field. Indicates street name. | [optional] +**location_sublocality** | **string** | A subfield of the location field. Indicates district/sublocality. | [optional] +**location_locality** | **string** | A subfield of the location field. Indicates city/town/village/locality. | [optional] +**location_admin_area_level_1** | **string** | A subfield of the location field. Indicates state/county. | [optional] +**location_admin_area_level_2** | **string** | A subfield of the location field. Indicates region. | [optional] +**location_country** | **string** | A subfield of the location field. Indicates country. | [optional] +**location_postal_code** | **string** | A subfield of the location field. Indicates ZIP/postal code. | [optional] +**location_formatted_address** | **string** | A subfield of the location field. Indicates full/combined address. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityCollectionResponseObjectAllOf.md b/docs/Model/ActivityCollectionResponseObjectAllOf.md new file mode 100644 index 00000000..f6e62cbe --- /dev/null +++ b/docs/Model/ActivityCollectionResponseObjectAllOf.md @@ -0,0 +1,34 @@ +# # ActivityCollectionResponseObjectAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the activity, generated when the activity was created | [optional] +**done** | **bool** | Whether the activity is done or not | [optional] +**subject** | **string** | The subject of the activity | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to | [optional] +**busy_flag** | **bool** | Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**company_id** | **int** | The user's company ID | [optional] +**conference_meeting_client** | **string** | The ID of the Marketplace app, which is connected to this activity | [optional] +**conference_meeting_url** | **string** | The link to join the meeting which is associated with this activity | [optional] +**conference_meeting_id** | **string** | The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity | [optional] +**add_time** | **string** | The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**marked_as_done_time** | **string** | The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**active_flag** | **bool** | Whether the activity is active or not | [optional] +**update_time** | **string** | The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_user_id** | **int** | The ID of the user who was the last to update this activity | [optional] +**source_timezone** | **string** | The timezone the activity was created in an external calendar | [optional] +**location_subpremise** | **string** | A subfield of the location field. Indicates apartment/suite number. | [optional] +**location_street_number** | **string** | A subfield of the location field. Indicates house number. | [optional] +**location_route** | **string** | A subfield of the location field. Indicates street name. | [optional] +**location_sublocality** | **string** | A subfield of the location field. Indicates district/sublocality. | [optional] +**location_locality** | **string** | A subfield of the location field. Indicates city/town/village/locality. | [optional] +**location_admin_area_level_1** | **string** | A subfield of the location field. Indicates state/county. | [optional] +**location_admin_area_level_2** | **string** | A subfield of the location field. Indicates region. | [optional] +**location_country** | **string** | A subfield of the location field. Indicates country. | [optional] +**location_postal_code** | **string** | A subfield of the location field. Indicates ZIP/postal code. | [optional] +**location_formatted_address** | **string** | A subfield of the location field. Indicates full/combined address. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityDistributionData.md b/docs/Model/ActivityDistributionData.md new file mode 100644 index 00000000..221126d7 --- /dev/null +++ b/docs/Model/ActivityDistributionData.md @@ -0,0 +1,9 @@ +# # ActivityDistributionData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activity_distribution** | [**\Pipedrive\Model\ActivityDistributionDataActivityDistribution**](ActivityDistributionDataActivityDistribution.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/ActivityDistributionDataActivityDistribution.md b/docs/Model/ActivityDistributionDataActivityDistribution.md new file mode 100644 index 00000000..1b141aac --- /dev/null +++ b/docs/Model/ActivityDistributionDataActivityDistribution.md @@ -0,0 +1,9 @@ +# # ActivityDistributionDataActivityDistribution + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assigned_to_user_id** | [**\Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID**](ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.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/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.md b/docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.md new file mode 100644 index 00000000..3153a73b --- /dev/null +++ b/docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.md @@ -0,0 +1,12 @@ +# # ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activities** | [**\Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities**](ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md) | | [optional] +**name** | **string** | The name of the user | [optional] +**activity_count** | **int** | The overall count of activities for the user | [optional] +**share** | **int** | The percentage of activities belongs to the user | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md b/docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md new file mode 100644 index 00000000..c11c68ed --- /dev/null +++ b/docs/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.md @@ -0,0 +1,9 @@ +# # ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activity_type_name** | **int** | The count of activities related to a specific type | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityDistributionDataWithAdditionalData.md b/docs/Model/ActivityDistributionDataWithAdditionalData.md new file mode 100644 index 00000000..e4bf4c60 --- /dev/null +++ b/docs/Model/ActivityDistributionDataWithAdditionalData.md @@ -0,0 +1,12 @@ +# # ActivityDistributionDataWithAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activity_distribution** | [**\Pipedrive\Model\ActivityDistributionDataActivityDistribution**](ActivityDistributionDataActivityDistribution.md) | | [optional] +**start** | **int** | Pagination start | [optional] +**limit** | **int** | Items shown per page | [optional] +**more_items_in_collection** | **bool** | If there are more list items in the collection than displayed 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/ActivityInfo.md b/docs/Model/ActivityInfo.md new file mode 100644 index 00000000..804ee917 --- /dev/null +++ b/docs/Model/ActivityInfo.md @@ -0,0 +1,13 @@ +# # ActivityInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityObjectFragment.md b/docs/Model/ActivityObjectFragment.md new file mode 100644 index 00000000..cd979cd2 --- /dev/null +++ b/docs/Model/ActivityObjectFragment.md @@ -0,0 +1,18 @@ +# # ActivityObjectFragment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **\DateTime** | The due date of the activity. Format: YYYY-MM-DD | [optional] +**due_time** | **string** | The due time of the activity in UTC. Format: HH:MM | [optional] +**duration** | **string** | The duration of the activity. Format: HH:MM | [optional] +**deal_id** | **int** | The ID of the deal this activity is associated with | [optional] +**lead_id** | **string** | The ID of the lead in the UUID format this activity is associated with | [optional] +**person_id** | **int** | The ID of the person this activity is associated with | [optional] +**project_id** | **int** | The ID of the project this activity is associated with | [optional] +**org_id** | **int** | The ID of the organization this activity is associated with | [optional] +**location** | **string** | The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. | [optional] +**public_description** | **string** | Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityPostObject.md b/docs/Model/ActivityPostObject.md new file mode 100644 index 00000000..0dc8a117 --- /dev/null +++ b/docs/Model/ActivityPostObject.md @@ -0,0 +1,26 @@ +# # ActivityPostObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **\DateTime** | The due date of the activity. Format: YYYY-MM-DD | [optional] +**due_time** | **string** | The due time of the activity in UTC. Format: HH:MM | [optional] +**duration** | **string** | The duration of the activity. Format: HH:MM | [optional] +**deal_id** | **int** | The ID of the deal this activity is associated with | [optional] +**lead_id** | **string** | The ID of the lead in the UUID format this activity is associated with | [optional] +**person_id** | **int** | The ID of the person this activity is associated with | [optional] +**project_id** | **int** | The ID of the project this activity is associated with | [optional] +**org_id** | **int** | The ID of the organization this activity is associated with | [optional] +**location** | **string** | The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. | [optional] +**public_description** | **string** | Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. | [optional] +**note** | **string** | The note of the activity (HTML format) | [optional] +**subject** | **string** | The subject of the activity. When value for subject is not set, it will be given a default value `Call`. | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to. If omitted, the activity is assigned to the authorized user. | [optional] +**participants** | **object[]** | List of multiple persons (participants) this activity is associated with. If omitted, single participant from `person_id` field is used. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` | [optional] +**busy_flag** | **bool** | Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**attendees** | **object[]** | The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` | [optional] +**done** | [**NumberBoolean**](NumberBoolean.md) | Whether the activity is done or not. 0 = Not done, 1 = Done | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityPostObjectAllOf.md b/docs/Model/ActivityPostObjectAllOf.md new file mode 100644 index 00000000..d35b5cbc --- /dev/null +++ b/docs/Model/ActivityPostObjectAllOf.md @@ -0,0 +1,16 @@ +# # ActivityPostObjectAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**note** | **string** | The note of the activity (HTML format) | [optional] +**subject** | **string** | The subject of the activity. When value for subject is not set, it will be given a default value `Call`. | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to. If omitted, the activity is assigned to the authorized user. | [optional] +**participants** | **object[]** | List of multiple persons (participants) this activity is associated with. If omitted, single participant from `person_id` field is used. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` | [optional] +**busy_flag** | **bool** | Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**attendees** | **object[]** | The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` | [optional] +**done** | [**NumberBoolean**](NumberBoolean.md) | Whether the activity is done or not. 0 = Not done, 1 = Done | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityPutObject.md b/docs/Model/ActivityPutObject.md new file mode 100644 index 00000000..78044d27 --- /dev/null +++ b/docs/Model/ActivityPutObject.md @@ -0,0 +1,26 @@ +# # ActivityPutObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **\DateTime** | The due date of the activity. Format: YYYY-MM-DD | [optional] +**due_time** | **string** | The due time of the activity in UTC. Format: HH:MM | [optional] +**duration** | **string** | The duration of the activity. Format: HH:MM | [optional] +**deal_id** | **int** | The ID of the deal this activity is associated with | [optional] +**lead_id** | **string** | The ID of the lead in the UUID format this activity is associated with | [optional] +**person_id** | **int** | The ID of the person this activity is associated with | [optional] +**project_id** | **int** | The ID of the project this activity is associated with | [optional] +**org_id** | **int** | The ID of the organization this activity is associated with | [optional] +**location** | **string** | The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. | [optional] +**public_description** | **string** | Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. | [optional] +**note** | **string** | The note of the activity (HTML format) | [optional] +**subject** | **string** | The subject of the activity | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to | [optional] +**participants** | **object[]** | List of multiple persons (participants) this activity is associated with. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` | [optional] +**busy_flag** | **bool** | Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**attendees** | **object[]** | The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` | [optional] +**done** | [**NumberBoolean**](NumberBoolean.md) | Whether the activity is done or not. 0 = Not done, 1 = Done | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityPutObjectAllOf.md b/docs/Model/ActivityPutObjectAllOf.md new file mode 100644 index 00000000..a5399e35 --- /dev/null +++ b/docs/Model/ActivityPutObjectAllOf.md @@ -0,0 +1,16 @@ +# # ActivityPutObjectAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**note** | **string** | The note of the activity (HTML format) | [optional] +**subject** | **string** | The subject of the activity | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to | [optional] +**participants** | **object[]** | List of multiple persons (participants) this activity is associated with. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` | [optional] +**busy_flag** | **bool** | Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**attendees** | **object[]** | The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` | [optional] +**done** | [**NumberBoolean**](NumberBoolean.md) | Whether the activity is done or not. 0 = Not done, 1 = Done | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityRecordAdditionalData.md b/docs/Model/ActivityRecordAdditionalData.md new file mode 100644 index 00000000..a129bcd4 --- /dev/null +++ b/docs/Model/ActivityRecordAdditionalData.md @@ -0,0 +1,9 @@ +# # ActivityRecordAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updates_story_id** | **int** | This field will be deprecated | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityResponseObject.md b/docs/Model/ActivityResponseObject.md new file mode 100644 index 00000000..ba3ff616 --- /dev/null +++ b/docs/Model/ActivityResponseObject.md @@ -0,0 +1,69 @@ +# # ActivityResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **\DateTime** | The due date of the activity. Format: YYYY-MM-DD | [optional] +**due_time** | **string** | The due time of the activity in UTC. Format: HH:MM | [optional] +**duration** | **string** | The duration of the activity. Format: HH:MM | [optional] +**deal_id** | **int** | The ID of the deal this activity is associated with | [optional] +**lead_id** | **string** | The ID of the lead in the UUID format this activity is associated with | [optional] +**person_id** | **int** | The ID of the person this activity is associated with | [optional] +**project_id** | **int** | The ID of the project this activity is associated with | [optional] +**org_id** | **int** | The ID of the organization this activity is associated with | [optional] +**location** | **string** | The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. | [optional] +**public_description** | **string** | Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. | [optional] +**id** | **int** | The ID of the activity, generated when the activity was created | [optional] +**note** | **string** | The note of the activity (HTML format) | [optional] +**done** | **bool** | Whether the activity is done or not | [optional] +**subject** | **string** | The subject of the activity | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to | [optional] +**participants** | **object[]** | List of multiple persons (participants) this activity is associated with | [optional] +**busy_flag** | **bool** | Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**attendees** | **object[]** | The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. | [optional] +**company_id** | **int** | The user's company ID | [optional] +**reference_type** | **string** | If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. | [optional] +**reference_id** | **int** | Together with the `reference_type`, gives the ID of the other object | [optional] +**conference_meeting_client** | **string** | The ID of the Marketplace app, which is connected to this activity | [optional] +**conference_meeting_url** | **string** | The link to join the meeting which is associated with this activity | [optional] +**conference_meeting_id** | **string** | The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity | [optional] +**add_time** | **string** | The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**marked_as_done_time** | **string** | The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**last_notification_time** | **string** | The date and time of latest notifications sent about this activity to the participants or the attendees of this activity | [optional] +**last_notification_user_id** | **int** | The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity | [optional] +**notification_language_id** | **int** | The ID of the language the notifications are sent in | [optional] +**active_flag** | **bool** | Whether the activity is active or not | [optional] +**update_time** | **string** | The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_user_id** | **int** | The ID of the user who was the last to update this activity | [optional] +**gcal_event_id** | **string** | For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. | [optional] +**google_calendar_id** | **string** | The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. | [optional] +**google_calendar_etag** | **string** | The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. | [optional] +**calendar_sync_include_context** | **string** | For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) | [optional] +**source_timezone** | **string** | The timezone the activity was created in an external calendar | [optional] +**rec_rule** | **string** | The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: \"RRULE:FREQ=WEEKLY;BYDAY=WE\" | [optional] +**rec_rule_extension** | **string** | Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. | [optional] +**rec_master_activity_id** | **int** | The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules | [optional] +**series** | **object[]** | The list of recurring activity instances. It is in a structure as follows: `[{due_date: \"2020-06-24\", due_time: \"10:00:00\"}]` | [optional] +**created_by_user_id** | **int** | The ID of the user who created the activity | [optional] +**location_subpremise** | **string** | A subfield of the location field. Indicates apartment/suite number. | [optional] +**location_street_number** | **string** | A subfield of the location field. Indicates house number. | [optional] +**location_route** | **string** | A subfield of the location field. Indicates street name. | [optional] +**location_sublocality** | **string** | A subfield of the location field. Indicates district/sublocality. | [optional] +**location_locality** | **string** | A subfield of the location field. Indicates city/town/village/locality. | [optional] +**location_admin_area_level_1** | **string** | A subfield of the location field. Indicates state/county. | [optional] +**location_admin_area_level_2** | **string** | A subfield of the location field. Indicates region. | [optional] +**location_country** | **string** | A subfield of the location field. Indicates country. | [optional] +**location_postal_code** | **string** | A subfield of the location field. Indicates ZIP/postal code. | [optional] +**location_formatted_address** | **string** | A subfield of the location field. Indicates full/combined address. | [optional] +**org_name** | **string** | The name of the organization this activity is associated with | [optional] +**person_name** | **string** | The name of the person this activity is associated with | [optional] +**deal_title** | **string** | The name of the deal this activity is associated with | [optional] +**owner_name** | **string** | The name of the user this activity is owned by | [optional] +**person_dropbox_bcc** | **string** | The BCC email address of the person | [optional] +**deal_dropbox_bcc** | **string** | The BCC email address of the deal | [optional] +**assigned_to_user_id** | **int** | The ID of the user to whom the activity is assigned to. Equal to `user_id`. | [optional] +**file** | **object** | The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityResponseObjectAllOf.md b/docs/Model/ActivityResponseObjectAllOf.md new file mode 100644 index 00000000..246a3c1c --- /dev/null +++ b/docs/Model/ActivityResponseObjectAllOf.md @@ -0,0 +1,59 @@ +# # ActivityResponseObjectAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the activity, generated when the activity was created | [optional] +**note** | **string** | The note of the activity (HTML format) | [optional] +**done** | **bool** | Whether the activity is done or not | [optional] +**subject** | **string** | The subject of the activity | [optional] +**type** | **string** | The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. | [optional] +**user_id** | **int** | The ID of the user whom the activity is assigned to | [optional] +**participants** | **object[]** | List of multiple persons (participants) this activity is associated with | [optional] +**busy_flag** | **bool** | Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. | [optional] +**attendees** | **object[]** | The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. | [optional] +**company_id** | **int** | The user's company ID | [optional] +**reference_type** | **string** | If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. | [optional] +**reference_id** | **int** | Together with the `reference_type`, gives the ID of the other object | [optional] +**conference_meeting_client** | **string** | The ID of the Marketplace app, which is connected to this activity | [optional] +**conference_meeting_url** | **string** | The link to join the meeting which is associated with this activity | [optional] +**conference_meeting_id** | **string** | The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity | [optional] +**add_time** | **string** | The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**marked_as_done_time** | **string** | The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**last_notification_time** | **string** | The date and time of latest notifications sent about this activity to the participants or the attendees of this activity | [optional] +**last_notification_user_id** | **int** | The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity | [optional] +**notification_language_id** | **int** | The ID of the language the notifications are sent in | [optional] +**active_flag** | **bool** | Whether the activity is active or not | [optional] +**update_time** | **string** | The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_user_id** | **int** | The ID of the user who was the last to update this activity | [optional] +**gcal_event_id** | **string** | For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. | [optional] +**google_calendar_id** | **string** | The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. | [optional] +**google_calendar_etag** | **string** | The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. | [optional] +**calendar_sync_include_context** | **string** | For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) | [optional] +**source_timezone** | **string** | The timezone the activity was created in an external calendar | [optional] +**rec_rule** | **string** | The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: \"RRULE:FREQ=WEEKLY;BYDAY=WE\" | [optional] +**rec_rule_extension** | **string** | Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. | [optional] +**rec_master_activity_id** | **int** | The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules | [optional] +**series** | **object[]** | The list of recurring activity instances. It is in a structure as follows: `[{due_date: \"2020-06-24\", due_time: \"10:00:00\"}]` | [optional] +**created_by_user_id** | **int** | The ID of the user who created the activity | [optional] +**location_subpremise** | **string** | A subfield of the location field. Indicates apartment/suite number. | [optional] +**location_street_number** | **string** | A subfield of the location field. Indicates house number. | [optional] +**location_route** | **string** | A subfield of the location field. Indicates street name. | [optional] +**location_sublocality** | **string** | A subfield of the location field. Indicates district/sublocality. | [optional] +**location_locality** | **string** | A subfield of the location field. Indicates city/town/village/locality. | [optional] +**location_admin_area_level_1** | **string** | A subfield of the location field. Indicates state/county. | [optional] +**location_admin_area_level_2** | **string** | A subfield of the location field. Indicates region. | [optional] +**location_country** | **string** | A subfield of the location field. Indicates country. | [optional] +**location_postal_code** | **string** | A subfield of the location field. Indicates ZIP/postal code. | [optional] +**location_formatted_address** | **string** | A subfield of the location field. Indicates full/combined address. | [optional] +**org_name** | **string** | The name of the organization this activity is associated with | [optional] +**person_name** | **string** | The name of the person this activity is associated with | [optional] +**deal_title** | **string** | The name of the deal this activity is associated with | [optional] +**owner_name** | **string** | The name of the user this activity is owned by | [optional] +**person_dropbox_bcc** | **string** | The BCC email address of the person | [optional] +**deal_dropbox_bcc** | **string** | The BCC email address of the deal | [optional] +**assigned_to_user_id** | **int** | The ID of the user to whom the activity is assigned to. Equal to `user_id`. | [optional] +**file** | **object** | The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityTypeBulkDeleteResponse.md b/docs/Model/ActivityTypeBulkDeleteResponse.md new file mode 100644 index 00000000..a50dc29a --- /dev/null +++ b/docs/Model/ActivityTypeBulkDeleteResponse.md @@ -0,0 +1,10 @@ +# # ActivityTypeBulkDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData**](ActivityTypeBulkDeleteResponseAllOfData.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/ActivityTypeBulkDeleteResponseAllOf.md b/docs/Model/ActivityTypeBulkDeleteResponseAllOf.md new file mode 100644 index 00000000..d603a5f3 --- /dev/null +++ b/docs/Model/ActivityTypeBulkDeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # ActivityTypeBulkDeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData**](ActivityTypeBulkDeleteResponseAllOfData.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/ActivityTypeBulkDeleteResponseAllOfData.md b/docs/Model/ActivityTypeBulkDeleteResponseAllOfData.md new file mode 100644 index 00000000..44ce711d --- /dev/null +++ b/docs/Model/ActivityTypeBulkDeleteResponseAllOfData.md @@ -0,0 +1,9 @@ +# # ActivityTypeBulkDeleteResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The IDs of the deleted activity types | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityTypeCreateRequest.md b/docs/Model/ActivityTypeCreateRequest.md new file mode 100644 index 00000000..af0cdc31 --- /dev/null +++ b/docs/Model/ActivityTypeCreateRequest.md @@ -0,0 +1,11 @@ +# # ActivityTypeCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the activity type | +**icon_key** | [**\Pipedrive\Model\IconKey**](IconKey.md) | | +**color** | **string** | A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityTypeCreateUpdateDeleteResponse.md b/docs/Model/ActivityTypeCreateUpdateDeleteResponse.md new file mode 100644 index 00000000..9098bf49 --- /dev/null +++ b/docs/Model/ActivityTypeCreateUpdateDeleteResponse.md @@ -0,0 +1,10 @@ +# # ActivityTypeCreateUpdateDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ActivityTypeObjectResponse**](ActivityTypeObjectResponse.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/ActivityTypeCreateUpdateDeleteResponseAllOf.md b/docs/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.md new file mode 100644 index 00000000..0961f069 --- /dev/null +++ b/docs/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # ActivityTypeCreateUpdateDeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ActivityTypeObjectResponse**](ActivityTypeObjectResponse.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/ActivityTypeListResponse.md b/docs/Model/ActivityTypeListResponse.md new file mode 100644 index 00000000..4481836c --- /dev/null +++ b/docs/Model/ActivityTypeListResponse.md @@ -0,0 +1,10 @@ +# # ActivityTypeListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ActivityTypeObjectResponse[]**](ActivityTypeObjectResponse.md) | The array of activity types | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityTypeListResponseAllOf.md b/docs/Model/ActivityTypeListResponseAllOf.md new file mode 100644 index 00000000..3fdfffba --- /dev/null +++ b/docs/Model/ActivityTypeListResponseAllOf.md @@ -0,0 +1,9 @@ +# # ActivityTypeListResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ActivityTypeObjectResponse[]**](ActivityTypeObjectResponse.md) | The array of activity types | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityTypeObjectResponse.md b/docs/Model/ActivityTypeObjectResponse.md new file mode 100644 index 00000000..646d9b62 --- /dev/null +++ b/docs/Model/ActivityTypeObjectResponse.md @@ -0,0 +1,18 @@ +# # ActivityTypeObjectResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the activity type | [optional] +**name** | **string** | The name of the activity type | [optional] +**icon_key** | [**\Pipedrive\Model\IconKey**](IconKey.md) | | [optional] +**color** | **string** | A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) | [optional] +**order_nr** | **int** | An order number for the activity type. Order numbers should be used to order the types in the activity type selections. | [optional] +**key_string** | **string** | A string that is generated by the API based on the given name of the activity type upon creation | [optional] +**active_flag** | **bool** | The active flag of the activity type | [optional] +**is_custom_flag** | **bool** | Whether the activity type is a custom one or not | [optional] +**add_time** | **string** | The creation time of the activity type | [optional] +**update_time** | **string** | The update time of the activity type | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivityTypeUpdateRequest.md b/docs/Model/ActivityTypeUpdateRequest.md new file mode 100644 index 00000000..202a3696 --- /dev/null +++ b/docs/Model/ActivityTypeUpdateRequest.md @@ -0,0 +1,12 @@ +# # ActivityTypeUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the activity type | [optional] +**icon_key** | [**\Pipedrive\Model\IconKey**](IconKey.md) | | [optional] +**color** | **string** | A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) | [optional] +**order_nr** | **int** | An order number for this activity type. Order numbers should be used to order the types in the activity type selections. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddActivityResponse200.md b/docs/Model/AddActivityResponse200.md new file mode 100644 index 00000000..d46df51c --- /dev/null +++ b/docs/Model/AddActivityResponse200.md @@ -0,0 +1,12 @@ +# # AddActivityResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject**](ActivityResponseObject.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ActivityRecordAdditionalData**](ActivityRecordAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AddActivityResponse200RelatedObjects**](AddActivityResponse200RelatedObjects.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/AddActivityResponse200RelatedObjects.md b/docs/Model/AddActivityResponse200RelatedObjects.md new file mode 100644 index 00000000..39238b8d --- /dev/null +++ b/docs/Model/AddActivityResponse200RelatedObjects.md @@ -0,0 +1,12 @@ +# # AddActivityResponse200RelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.md) | | [optional] +**deal** | [**\Pipedrive\Model\RelatedDealData**](RelatedDealData.md) | | [optional] +**person** | [**\Pipedrive\Model\RelatedPersonDataWithActiveFlag**](RelatedPersonDataWithActiveFlag.md) | | [optional] +**organization** | [**\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag**](RelatedOrganizationDataWithActiveFlag.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/AddDealFollowerRequest.md b/docs/Model/AddDealFollowerRequest.md new file mode 100644 index 00000000..7d681503 --- /dev/null +++ b/docs/Model/AddDealFollowerRequest.md @@ -0,0 +1,9 @@ +# # AddDealFollowerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddDealParticipantRequest.md b/docs/Model/AddDealParticipantRequest.md new file mode 100644 index 00000000..da6b64f0 --- /dev/null +++ b/docs/Model/AddDealParticipantRequest.md @@ -0,0 +1,9 @@ +# # AddDealParticipantRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**person_id** | **int** | The ID of the person | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddFile.md b/docs/Model/AddFile.md new file mode 100644 index 00000000..182e8093 --- /dev/null +++ b/docs/Model/AddFile.md @@ -0,0 +1,10 @@ +# # AddFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FileData**](FileData.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/AddFilterRequest.md b/docs/Model/AddFilterRequest.md new file mode 100644 index 00000000..d3a6eae3 --- /dev/null +++ b/docs/Model/AddFilterRequest.md @@ -0,0 +1,11 @@ +# # AddFilterRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the filter | +**conditions** | **object** | The conditions of the filter as a JSON object. Please note that a maximum of 16 conditions is allowed per filter and `date` values must be supplied in the `YYYY-MM-DD` format. It requires a minimum structure as follows: `{\"glue\":\"and\",\"conditions\":[{\"glue\":\"and\",\"conditions\": [CONDITION_OBJECTS]},{\"glue\":\"or\",\"conditions\":[CONDITION_OBJECTS]}]}`. Replace `CONDITION_OBJECTS` with JSON objects of the following structure: `{\"object\":\"\",\"field_id\":\"\", \"operator\":\"\",\"value\":\"\", \"extra_value\":\"\"}` or leave the array empty. Depending on the object type you should use another API endpoint to get `field_id`. There are five types of objects you can choose from: `\"person\"`, `\"deal\"`, `\"organization\"`, `\"product\"`, `\"activity\"` and you can use these types of operators depending on what type of a field you have: `\"IS NOT NULL\"`, `\"IS NULL\"`, `\"<=\"`, `\">=\"`, `\"<\"`, `\">\"`, `\"!=\"`, `\"=\"`, `\"LIKE '$%'\"`, `\"LIKE '%$%'\"`, `\"NOT LIKE '$%'\"`. To get a better understanding of how filters work try creating them directly from the Pipedrive application. | +**type** | [**FilterType**](FilterType.md) | The type of filter to create | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddFollowerToPersonResponse.md b/docs/Model/AddFollowerToPersonResponse.md new file mode 100644 index 00000000..a7f4c691 --- /dev/null +++ b/docs/Model/AddFollowerToPersonResponse.md @@ -0,0 +1,10 @@ +# # AddFollowerToPersonResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\AddFollowerToPersonResponseAllOfData**](AddFollowerToPersonResponseAllOfData.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/AddFollowerToPersonResponseAllOf.md b/docs/Model/AddFollowerToPersonResponseAllOf.md new file mode 100644 index 00000000..4b798206 --- /dev/null +++ b/docs/Model/AddFollowerToPersonResponseAllOf.md @@ -0,0 +1,9 @@ +# # AddFollowerToPersonResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\AddFollowerToPersonResponseAllOfData**](AddFollowerToPersonResponseAllOfData.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/AddFollowerToPersonResponseAllOfData.md b/docs/Model/AddFollowerToPersonResponseAllOfData.md new file mode 100644 index 00000000..b8262c6a --- /dev/null +++ b/docs/Model/AddFollowerToPersonResponseAllOfData.md @@ -0,0 +1,12 @@ +# # AddFollowerToPersonResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user who was added as a follower to a person | [optional] +**id** | **int** | The ID of the follower | [optional] +**person_id** | **int** | The ID of the person to whom the follower was added | [optional] +**add_time** | **string** | The date and time when the follower was added to a person. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddLeadLabelRequest.md b/docs/Model/AddLeadLabelRequest.md new file mode 100644 index 00000000..8dfca789 --- /dev/null +++ b/docs/Model/AddLeadLabelRequest.md @@ -0,0 +1,10 @@ +# # AddLeadLabelRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the lead label | +**color** | [**\Pipedrive\Model\LeadLabelColor**](LeadLabelColor.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddLeadRequest.md b/docs/Model/AddLeadRequest.md new file mode 100644 index 00000000..aaa5ae51 --- /dev/null +++ b/docs/Model/AddLeadRequest.md @@ -0,0 +1,17 @@ +# # AddLeadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The name of the lead | +**owner_id** | **int** | The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used. | [optional] +**label_ids** | **string[]** | The IDs of the lead labels which will be associated with the lead | [optional] +**person_id** | **int** | The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `organization_id` is specified. | [optional] +**organization_id** | **int** | The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. | [optional] +**value** | [**\Pipedrive\Model\LeadValue**](LeadValue.md) | | [optional] +**expected_close_date** | **\DateTime** | The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**was_seen** | **bool** | A flag indicating whether the lead was seen by someone in the Pipedrive UI | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddNewPipeline.md b/docs/Model/AddNewPipeline.md new file mode 100644 index 00000000..1d7c6de7 --- /dev/null +++ b/docs/Model/AddNewPipeline.md @@ -0,0 +1,10 @@ +# # AddNewPipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BasePipeline**](.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/AddNewPipelineAllOf.md b/docs/Model/AddNewPipelineAllOf.md new file mode 100644 index 00000000..3222c5b1 --- /dev/null +++ b/docs/Model/AddNewPipelineAllOf.md @@ -0,0 +1,9 @@ +# # AddNewPipelineAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BasePipeline**](.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/AddNoteRequest.md b/docs/Model/AddNoteRequest.md new file mode 100644 index 00000000..5ec016e9 --- /dev/null +++ b/docs/Model/AddNoteRequest.md @@ -0,0 +1,19 @@ +# # AddNoteRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | +**lead_id** | **string** | The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. | [optional] +**deal_id** | **int** | The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. | [optional] +**person_id** | **int** | The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. | [optional] +**org_id** | **int** | The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. | [optional] +**user_id** | **int** | The ID of the user who will be marked as the author of the note. Only an admin can change the author. | [optional] +**add_time** | **string** | The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] +**pinned_to_lead_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to lead pinning state (`lead_id` is also required) | [optional] +**pinned_to_deal_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to deal pinning state (`deal_id` is also required) | [optional] +**pinned_to_organization_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to organization pinning state (`org_id` is also required) | [optional] +**pinned_to_person_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to person pinning state (`person_id` is also required) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddNoteRequestAllOf.md b/docs/Model/AddNoteRequestAllOf.md new file mode 100644 index 00000000..66a4aa7d --- /dev/null +++ b/docs/Model/AddNoteRequestAllOf.md @@ -0,0 +1,13 @@ +# # AddNoteRequestAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | +**lead_id** | **string** | The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. | [optional] +**deal_id** | **int** | The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. | [optional] +**person_id** | **int** | The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. | [optional] +**org_id** | **int** | The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddOrUpdateGoalResponse200.md b/docs/Model/AddOrUpdateGoalResponse200.md new file mode 100644 index 00000000..4e32dc23 --- /dev/null +++ b/docs/Model/AddOrUpdateGoalResponse200.md @@ -0,0 +1,10 @@ +# # AddOrUpdateGoalResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\PostGoalResponse**](PostGoalResponse.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/AddOrUpdateLeadLabelResponse200.md b/docs/Model/AddOrUpdateLeadLabelResponse200.md new file mode 100644 index 00000000..c79f9ac1 --- /dev/null +++ b/docs/Model/AddOrUpdateLeadLabelResponse200.md @@ -0,0 +1,10 @@ +# # AddOrUpdateLeadLabelResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\LeadLabelResponse**](LeadLabelResponse.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/AddOrUpdateRoleSettingRequest.md b/docs/Model/AddOrUpdateRoleSettingRequest.md new file mode 100644 index 00000000..81595fbf --- /dev/null +++ b/docs/Model/AddOrUpdateRoleSettingRequest.md @@ -0,0 +1,10 @@ +# # AddOrUpdateRoleSettingRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**setting_key** | **string** | | +**value** | **int** | Possible values for the `default_visibility` setting depending on the subscription plan:<br> <table class='role-setting'> <caption><b>Essential / Advanced plan</b></caption> <tr><th><b>Value</b></th><th><b>Description</b></th></tr> <tr><td>`1`</td><td>Owner & Followers</td></tr> <tr><td>`3`</td><td>Entire company</td></tr> </table> <br> <table class='role-setting'> <caption><b>Professional / Enterprise plan</b></caption> <tr><th><b>Value</b></th><th><b>Description</b></th></tr> <tr><td>`1`</td><td>Owner only</td></tr> <tr><td>`3`</td><td>Owner&#39;s visibility group</td></tr> <tr><td>`5`</td><td>Owner&#39;s visibility group and sub-groups</td></tr> <tr><td>`7`</td><td>Entire company</td></tr> </table> <br> Read more about visibility groups <a href='https://support.pipedrive.com/en/article/visibility-groups'>here</a>. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddOrganizationFollowerRequest.md b/docs/Model/AddOrganizationFollowerRequest.md new file mode 100644 index 00000000..20308cc1 --- /dev/null +++ b/docs/Model/AddOrganizationFollowerRequest.md @@ -0,0 +1,9 @@ +# # AddOrganizationFollowerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddOrganizationRelationshipRequest.md b/docs/Model/AddOrganizationRelationshipRequest.md new file mode 100644 index 00000000..57e22611 --- /dev/null +++ b/docs/Model/AddOrganizationRelationshipRequest.md @@ -0,0 +1,12 @@ +# # AddOrganizationRelationshipRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **int** | The ID of the base organization for the returned calculated values | [optional] +**type** | **string** | The type of organization relationship | +**rel_owner_org_id** | **int** | The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter. | +**rel_linked_org_id** | **int** | The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddPersonFollowerRequest.md b/docs/Model/AddPersonFollowerRequest.md new file mode 100644 index 00000000..e6f7aeac --- /dev/null +++ b/docs/Model/AddPersonFollowerRequest.md @@ -0,0 +1,9 @@ +# # AddPersonFollowerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddPersonPictureResponse.md b/docs/Model/AddPersonPictureResponse.md new file mode 100644 index 00000000..46046103 --- /dev/null +++ b/docs/Model/AddPersonPictureResponse.md @@ -0,0 +1,10 @@ +# # AddPersonPictureResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\RelatedPictureData**](RelatedPictureData.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/AddPersonPictureResponseAllOf.md b/docs/Model/AddPersonPictureResponseAllOf.md new file mode 100644 index 00000000..3ce2456c --- /dev/null +++ b/docs/Model/AddPersonPictureResponseAllOf.md @@ -0,0 +1,9 @@ +# # AddPersonPictureResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\RelatedPictureData**](RelatedPictureData.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/AddPersonResponse.md b/docs/Model/AddPersonResponse.md new file mode 100644 index 00000000..61b37f2e --- /dev/null +++ b/docs/Model/AddPersonResponse.md @@ -0,0 +1,11 @@ +# # AddPersonResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonItem**](PersonItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects**](ListProductsResponseAllOfRelatedObjects.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/AddPersonResponseAllOf.md b/docs/Model/AddPersonResponseAllOf.md new file mode 100644 index 00000000..0aed1387 --- /dev/null +++ b/docs/Model/AddPersonResponseAllOf.md @@ -0,0 +1,10 @@ +# # AddPersonResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PersonItem**](PersonItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects**](ListProductsResponseAllOfRelatedObjects.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/AddProductAttachmentDetails.md b/docs/Model/AddProductAttachmentDetails.md new file mode 100644 index 00000000..cf3f1c51 --- /dev/null +++ b/docs/Model/AddProductAttachmentDetails.md @@ -0,0 +1,29 @@ +# # AddProductAttachmentDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | The ID of the product | +**item_price** | **float** | The price at which this product will be added to the deal | +**quantity** | **int** | Quantity – e.g. how many items of this product will be added to the deal | +**discount_percentage** | **float** | The discount %. If omitted, will be set to 0. | [optional] [default to 0] +**duration** | **float** | The duration of the product. If omitted, will be set to 1. | [optional] [default to 1] +**duration_unit** | **string** | The type of the duration. (For example hourly, daily, etc.) | [optional] +**product_variation_id** | **int** | The ID of the product variation to use. When omitted, no variation will be used. | [optional] +**comments** | **string** | A textual comment associated with this product-deal attachment | [optional] +**tax** | **float** | The product tax | [optional] +**enabled_flag** | **bool** | Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. | [optional] [default to true] +**id** | **int** | The ID of the deal-product (the ID of the product attached to the deal) | [optional] +**company_id** | **int** | The ID of the company | [optional] +**deal_id** | **int** | The ID of the deal | [optional] +**sum_no_discount** | **float** | The product sum without the discount | [optional] +**sum** | **float** | The sum of all the products attached to the deal | [optional] +**currency** | **string** | The currency associated with the deal product | [optional] +**add_time** | **string** | The date and time when the product was added to the deal | [optional] +**last_edit** | **string** | The date and time when the deal product was last edited | [optional] +**active_flag** | **bool** | Whether the product is active or not | [optional] +**name** | **string** | The product name | [optional] +**product_attachment_id** | **int** | The ID of the deal-product (the ID of the product attached to the deal) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddProductAttachmentDetailsAllOf.md b/docs/Model/AddProductAttachmentDetailsAllOf.md new file mode 100644 index 00000000..574fa327 --- /dev/null +++ b/docs/Model/AddProductAttachmentDetailsAllOf.md @@ -0,0 +1,9 @@ +# # AddProductAttachmentDetailsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_attachment_id** | **int** | The ID of the deal-product (the ID of the product attached to the deal) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddProductFollowerRequest.md b/docs/Model/AddProductFollowerRequest.md new file mode 100644 index 00000000..5bf35313 --- /dev/null +++ b/docs/Model/AddProductFollowerRequest.md @@ -0,0 +1,9 @@ +# # AddProductFollowerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddProductRequestBody.md b/docs/Model/AddProductRequestBody.md new file mode 100644 index 00000000..28633e07 --- /dev/null +++ b/docs/Model/AddProductRequestBody.md @@ -0,0 +1,17 @@ +# # AddProductRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the product | +**code** | **string** | The product code | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**active_flag** | **bool** | Whether this product will be made active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product can be selected in deals or not | [optional] [default to true] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. | [optional] +**prices** | **object[]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddRole.md b/docs/Model/AddRole.md new file mode 100644 index 00000000..d0c24b4a --- /dev/null +++ b/docs/Model/AddRole.md @@ -0,0 +1,10 @@ +# # AddRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the role | +**parent_role_id** | **int** | The ID of the parent 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/AddRoleAssignmentRequest.md b/docs/Model/AddRoleAssignmentRequest.md new file mode 100644 index 00000000..ba361413 --- /dev/null +++ b/docs/Model/AddRoleAssignmentRequest.md @@ -0,0 +1,9 @@ +# # AddRoleAssignmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddTeamUserRequest.md b/docs/Model/AddTeamUserRequest.md new file mode 100644 index 00000000..b07c2bcf --- /dev/null +++ b/docs/Model/AddTeamUserRequest.md @@ -0,0 +1,9 @@ +# # AddTeamUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | **int[]** | The list of user IDs | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddUserRequest.md b/docs/Model/AddUserRequest.md new file mode 100644 index 00000000..3483516f --- /dev/null +++ b/docs/Model/AddUserRequest.md @@ -0,0 +1,11 @@ +# # AddUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | The email of the user | +**access** | [**\Pipedrive\Model\UserAccess[]**](UserAccess.md) | The access given to the user. Each item in the array represents access to a specific app. Optionally may include either admin flag or permission set ID to specify which access to give within the app. If both are omitted, the default access for the corresponding app will be used. It requires structure as follows: `[{ app: 'sales', permission_set_id: '62cc4d7f-4038-4352-abf3-a8c1c822b631' }, { app: 'global', admin: true }, { app: 'account_settings' }]` | [optional] +**active_flag** | **bool** | Whether the user is active or not. `false` = Not activated, `true` = Activated | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddWebhookRequest.md b/docs/Model/AddWebhookRequest.md new file mode 100644 index 00000000..9e78c809 --- /dev/null +++ b/docs/Model/AddWebhookRequest.md @@ -0,0 +1,15 @@ +# # AddWebhookRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscription_url** | **string** | A full, valid, publicly accessible URL which determines where to send the notifications. Please note that you cannot use Pipedrive API endpoints as the `subscription_url` and the chosen URL must not redirect to another link. | +**event_action** | **string** | The type of action to receive notifications about. Wildcard will match all supported actions. | +**event_object** | **string** | The type of object to receive notifications about. Wildcard will match all supported objects. | +**user_id** | **int** | The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a user’s permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`. | [optional] +**http_auth_user** | **string** | The HTTP basic auth username of the subscription URL endpoint (if required) | [optional] +**http_auth_password** | **string** | The HTTP basic auth password of the subscription URL endpoint (if required) | [optional] +**version** | **string** | The webhook's version | [optional] [default to '1.0'] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddedDealFollower.md b/docs/Model/AddedDealFollower.md new file mode 100644 index 00000000..b2cb7b3f --- /dev/null +++ b/docs/Model/AddedDealFollower.md @@ -0,0 +1,10 @@ +# # AddedDealFollower + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\AddedDealFollowerData**](AddedDealFollowerData.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/AddedDealFollowerData.md b/docs/Model/AddedDealFollowerData.md new file mode 100644 index 00000000..e3c90cb2 --- /dev/null +++ b/docs/Model/AddedDealFollowerData.md @@ -0,0 +1,12 @@ +# # AddedDealFollowerData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The user ID who added the follower | [optional] +**id** | **int** | The follower ID | [optional] +**deal_id** | **int** | The ID of the deal which the follower was added to | [optional] +**add_time** | **string** | The date and time when the deal follower was added | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdditionalBaseOrganizationItemInfo.md b/docs/Model/AdditionalBaseOrganizationItemInfo.md new file mode 100644 index 00000000..7827a301 --- /dev/null +++ b/docs/Model/AdditionalBaseOrganizationItemInfo.md @@ -0,0 +1,40 @@ +# # AdditionalBaseOrganizationItemInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_messages_count** | **int** | The count of email messages related to the organization | [optional] +**people_count** | **int** | The count of persons related to the organization | [optional] +**activities_count** | **int** | The count of activities related to the organization | [optional] +**done_activities_count** | **int** | The count of done activities related to the organization | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the organization | [optional] +**files_count** | **int** | The count of files related to the organization | [optional] +**notes_count** | **int** | The count of notes related to the organization | [optional] +**followers_count** | **int** | The count of followers related to the organization | [optional] +**address** | **string** | The full address of the organization | [optional] +**address_subpremise** | **string** | The sub-premise of the organization location | [optional] +**address_street_number** | **string** | The street number of the organization location | [optional] +**address_route** | **string** | The route of the organization location | [optional] +**address_sublocality** | **string** | The sub-locality of the organization location | [optional] +**address_locality** | **string** | The locality of the organization location | [optional] +**address_admin_area_level_1** | **string** | The level 1 admin area of the organization location | [optional] +**address_admin_area_level_2** | **string** | The level 2 admin area of the organization location | [optional] +**address_country** | **string** | The country of the organization location | [optional] +**address_postal_code** | **string** | The postal code of the organization location | [optional] +**address_formatted_address** | **string** | The formatted organization location | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdditionalData.md b/docs/Model/AdditionalData.md new file mode 100644 index 00000000..8e3c905c --- /dev/null +++ b/docs/Model/AdditionalData.md @@ -0,0 +1,11 @@ +# # AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **int** | Pagination start | [optional] +**limit** | **int** | Items shown per page | [optional] +**more_items_in_collection** | **bool** | If there are more list items in the collection than displayed 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/AdditionalDataWithCursorPagination.md b/docs/Model/AdditionalDataWithCursorPagination.md new file mode 100644 index 00000000..e5ba4941 --- /dev/null +++ b/docs/Model/AdditionalDataWithCursorPagination.md @@ -0,0 +1,9 @@ +# # AdditionalDataWithCursorPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_cursor** | **string** | The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdditionalDataWithOffsetPagination.md b/docs/Model/AdditionalDataWithOffsetPagination.md new file mode 100644 index 00000000..49b68941 --- /dev/null +++ b/docs/Model/AdditionalDataWithOffsetPagination.md @@ -0,0 +1,9 @@ +# # AdditionalDataWithOffsetPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**AdditionalData**](AdditionalData.md) | The pagination details of the list | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdditionalDataWithPaginationDetails.md b/docs/Model/AdditionalDataWithPaginationDetails.md new file mode 100644 index 00000000..0658b45b --- /dev/null +++ b/docs/Model/AdditionalDataWithPaginationDetails.md @@ -0,0 +1,9 @@ +# # AdditionalDataWithPaginationDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**\Pipedrive\Model\PaginationDetails**](PaginationDetails.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/AdditionalMergePersonInfo.md b/docs/Model/AdditionalMergePersonInfo.md new file mode 100644 index 00000000..c7f371a8 --- /dev/null +++ b/docs/Model/AdditionalMergePersonInfo.md @@ -0,0 +1,38 @@ +# # AdditionalMergePersonInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | **int** | The ID of the owner related to the person | [optional] +**org_id** | **int** | The ID of the organization related to the person | [optional] +**merge_what_id** | **int** | The ID of the person with what the main person was merged | [optional] +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**participant_open_deals_count** | **int** | The count of open participant deals related with the item | [optional] +**participant_closed_deals_count** | **int** | The count of closed participant deals related with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AdditionalPersonInfo.md b/docs/Model/AdditionalPersonInfo.md new file mode 100644 index 00000000..f0baf578 --- /dev/null +++ b/docs/Model/AdditionalPersonInfo.md @@ -0,0 +1,35 @@ +# # AdditionalPersonInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag**](RelationshipOrganizationInfoItemWithActiveFlag.md) | | [optional] +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AllOrganizationRelationshipsGetResponse.md b/docs/Model/AllOrganizationRelationshipsGetResponse.md new file mode 100644 index 00000000..ef17ea72 --- /dev/null +++ b/docs/Model/AllOrganizationRelationshipsGetResponse.md @@ -0,0 +1,12 @@ +# # AllOrganizationRelationshipsGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationRelationshipDetails[]**](OrganizationRelationshipDetails.md) | The array of organization relationships | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/AllOrganizationRelationshipsGetResponseAllOf.md b/docs/Model/AllOrganizationRelationshipsGetResponseAllOf.md new file mode 100644 index 00000000..56b0fa98 --- /dev/null +++ b/docs/Model/AllOrganizationRelationshipsGetResponseAllOf.md @@ -0,0 +1,11 @@ +# # AllOrganizationRelationshipsGetResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\OrganizationRelationshipDetails[]**](OrganizationRelationshipDetails.md) | The array of organization relationships | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.md b/docs/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..5364c90b --- /dev/null +++ b/docs/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.md @@ -0,0 +1,9 @@ +# # AllOrganizationRelationshipsGetResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**\Pipedrive\Model\RelatedOrganizationData**](RelatedOrganizationData.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/AllOrganizationsGetResponse.md b/docs/Model/AllOrganizationsGetResponse.md new file mode 100644 index 00000000..ee961d9a --- /dev/null +++ b/docs/Model/AllOrganizationsGetResponse.md @@ -0,0 +1,12 @@ +# # AllOrganizationsGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseOrganizationItem[]**](BaseOrganizationItem.md) | The array of organizations | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/AllOrganizationsGetResponseAllOf.md b/docs/Model/AllOrganizationsGetResponseAllOf.md new file mode 100644 index 00000000..aacb2ef0 --- /dev/null +++ b/docs/Model/AllOrganizationsGetResponseAllOf.md @@ -0,0 +1,11 @@ +# # AllOrganizationsGetResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseOrganizationItem[]**](BaseOrganizationItem.md) | The array of organizations | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/AllOrganizationsGetResponseAllOfRelatedObjects.md b/docs/Model/AllOrganizationsGetResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..1bf7d6c9 --- /dev/null +++ b/docs/Model/AllOrganizationsGetResponseAllOfRelatedObjects.md @@ -0,0 +1,11 @@ +# # AllOrganizationsGetResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**\Pipedrive\Model\RelatedOrganizationData**](RelatedOrganizationData.md) | | [optional] +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.md) | | [optional] +**picture** | [**\Pipedrive\Model\RelatedPictureData**](RelatedPictureData.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/ArrayPrices.md b/docs/Model/ArrayPrices.md new file mode 100644 index 00000000..43d46fc6 --- /dev/null +++ b/docs/Model/ArrayPrices.md @@ -0,0 +1,9 @@ +# # ArrayPrices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prices** | **object[]** | Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Assignee.md b/docs/Model/Assignee.md new file mode 100644 index 00000000..74b09539 --- /dev/null +++ b/docs/Model/Assignee.md @@ -0,0 +1,10 @@ +# # Assignee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the goal assignee | [optional] +**type** | **string** | The type of the assignee | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseComment.md b/docs/Model/BaseComment.md new file mode 100644 index 00000000..be12bec1 --- /dev/null +++ b/docs/Model/BaseComment.md @@ -0,0 +1,18 @@ +# # BaseComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **string** | The ID of the note | [optional] +**active_flag** | **bool** | Whether the note is active or deleted | [optional] +**add_time** | **string** | The creation date and time of the note | [optional] +**update_time** | **string** | The creation date and time of the note | [optional] +**content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | [optional] +**object_id** | **string** | The ID of the object that the comment is attached to, will be the id of the note | [optional] +**object_type** | **string** | The type of object that the comment is attached to, will be \"note\" | [optional] +**user_id** | **int** | The ID of the user who created the comment | [optional] +**updater_id** | **int** | The ID of the user who last updated the comment | [optional] +**company_id** | **int** | The ID of the company | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseCurrency.md b/docs/Model/BaseCurrency.md new file mode 100644 index 00000000..db83a77a --- /dev/null +++ b/docs/Model/BaseCurrency.md @@ -0,0 +1,15 @@ +# # BaseCurrency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the currency | [optional] +**code** | **string** | The code of the currency | [optional] +**name** | **string** | The name of the currency | [optional] +**decimal_points** | **int** | The amount of decimal points of the currency | [optional] +**symbol** | **string** | The symbol of the currency | [optional] +**active_flag** | **bool** | Whether the currency is active or not | [optional] +**is_custom_flag** | **bool** | Whether the currency is a custom one 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/BaseDeal.md b/docs/Model/BaseDeal.md new file mode 100644 index 00000000..67f9e5d4 --- /dev/null +++ b/docs/Model/BaseDeal.md @@ -0,0 +1,60 @@ +# # BaseDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal | [optional] +**update_time** | **string** | The last updated date and time of the deal | [optional] +**stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**active** | **bool** | Whether the deal is active or not | [optional] +**deleted** | **bool** | Whether the deal is deleted or not | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status as won | [optional] +**first_won_time** | **string** | The date and time of the first time changing the deal status as won | [optional] +**lost_time** | **string** | The date and time of changing the deal status as lost | [optional] +**products_count** | **int** | The number of products associated with the deal | [optional] +**files_count** | **int** | The number of files associated with the deal | [optional] +**notes_count** | **int** | The number of notes associated with the deal | [optional] +**followers_count** | **int** | The number of followers associated with the deal | [optional] +**email_messages_count** | **int** | The number of emails associated with the deal | [optional] +**activities_count** | **int** | The number of activities associated with the deal | [optional] +**done_activities_count** | **int** | The number of completed activities associated with the deal | [optional] +**undone_activities_count** | **int** | The number of incomplete activities associated with the deal | [optional] +**participants_count** | **int** | The number of participants associated with the deal | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the deal | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] +**stage_order_nr** | **int** | The order number of the deal stage associated with the deal | [optional] +**person_name** | **string** | The name of the person associated with the deal | [optional] +**org_name** | **string** | The name of the organization associated with the deal | [optional] +**next_activity_subject** | **string** | The subject of the next activity associated with the deal | [optional] +**next_activity_type** | **string** | The type of the next activity associated with the deal | [optional] +**next_activity_duration** | **string** | The duration of the next activity associated with the deal | [optional] +**next_activity_note** | **string** | The note of the next activity associated with the deal | [optional] +**formatted_value** | **string** | The deal value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value** | **float** | Probability times deal value. Probability can either be deal probability or if not set, then stage probability. | [optional] +**formatted_weighted_value** | **string** | The weighted_value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value_currency** | **string** | The currency associated with the deal | [optional] +**rotten_time** | **string** | The date and time of changing the deal status as rotten | [optional] +**owner_name** | **string** | The name of the deal owner | [optional] +**cc_email** | **string** | The BCC email of the deal | [optional] +**org_hidden** | **bool** | If the organization that is associated with the deal is hidden or not | [optional] +**person_hidden** | **bool** | If the person that is associated with the deal is hidden 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/BaseFollowerItem.md b/docs/Model/BaseFollowerItem.md new file mode 100644 index 00000000..1062bae6 --- /dev/null +++ b/docs/Model/BaseFollowerItem.md @@ -0,0 +1,11 @@ +# # BaseFollowerItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The user ID of the follower related to the item | [optional] +**id** | **int** | The ID of the follower | [optional] +**add_time** | **\DateTime** | The date and time of adding the follower to the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseMailThread.md b/docs/Model/BaseMailThread.md new file mode 100644 index 00000000..fd285237 --- /dev/null +++ b/docs/Model/BaseMailThread.md @@ -0,0 +1,45 @@ +# # BaseMailThread + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail thread | [optional] +**account_id** | **string** | The connection account ID | [optional] +**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] +**subject** | **string** | The subject | [optional] +**snippet** | **string** | A snippet | [optional] +**read_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is read | [optional] +**mail_tracking_status** | **string** | Mail tracking status | [optional] +**has_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has an attachment | [optional] +**has_inline_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has inline attachments | [optional] +**has_real_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has real attachments (which are not inline) | [optional] +**deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is deleted | [optional] +**synced_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is synced | [optional] +**smart_bcc_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether one of the parties of the mail thread is Bcc | [optional] +**mail_link_tracking_enabled_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the link tracking of the mail thread is enabled | [optional] +**parties** | [**\Pipedrive\Model\BaseMailThreadAllOfParties**](BaseMailThreadAllOfParties.md) | | [optional] +**drafts_parties** | **object[]** | Parties of the drafted mail thread | [optional] +**folders** | **string[]** | Folders in which messages from thread are being stored | [optional] +**version** | **float** | Version | [optional] +**snippet_draft** | **string** | A snippet from a draft | [optional] +**snippet_sent** | **string** | A snippet from a message sent | [optional] +**message_count** | **int** | An amount of messages | [optional] +**has_draft_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has any drafts | [optional] +**has_sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has messages sent | [optional] +**archived_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is archived | [optional] +**shared_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is shared | [optional] +**external_deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has been deleted externally | [optional] +**first_message_to_me_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread was initialized by others | [optional] +**last_message_timestamp** | **\DateTime** | Last message timestamp | [optional] +**first_message_timestamp** | **\DateTime** | The time when the mail thread has had the first message received or created | [optional] +**last_message_sent_timestamp** | **\DateTime** | The last time when the mail thread has had a message sent | [optional] +**last_message_received_timestamp** | **\DateTime** | The last time when the mail thread has had a message received | [optional] +**add_time** | **\DateTime** | The time when the mail thread was inserted to database | [optional] +**update_time** | **\DateTime** | The time when the mail thread was updated in database received | [optional] +**deal_id** | **int** | The ID of the deal | [optional] +**deal_status** | **string** | Status of the deal | [optional] +**lead_id** | **string** | The ID of the lead | [optional] +**all_messages_sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether all the mail thread messages have 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/BaseMailThreadAllOf.md b/docs/Model/BaseMailThreadAllOf.md new file mode 100644 index 00000000..d151eb1e --- /dev/null +++ b/docs/Model/BaseMailThreadAllOf.md @@ -0,0 +1,31 @@ +# # BaseMailThreadAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parties** | [**\Pipedrive\Model\BaseMailThreadAllOfParties**](BaseMailThreadAllOfParties.md) | | [optional] +**drafts_parties** | **object[]** | Parties of the drafted mail thread | [optional] +**folders** | **string[]** | Folders in which messages from thread are being stored | [optional] +**version** | **float** | Version | [optional] +**snippet_draft** | **string** | A snippet from a draft | [optional] +**snippet_sent** | **string** | A snippet from a message sent | [optional] +**message_count** | **int** | An amount of messages | [optional] +**has_draft_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has any drafts | [optional] +**has_sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has messages sent | [optional] +**archived_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is archived | [optional] +**shared_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is shared | [optional] +**external_deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has been deleted externally | [optional] +**first_message_to_me_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread was initialized by others | [optional] +**last_message_timestamp** | **\DateTime** | Last message timestamp | [optional] +**first_message_timestamp** | **\DateTime** | The time when the mail thread has had the first message received or created | [optional] +**last_message_sent_timestamp** | **\DateTime** | The last time when the mail thread has had a message sent | [optional] +**last_message_received_timestamp** | **\DateTime** | The last time when the mail thread has had a message received | [optional] +**add_time** | **\DateTime** | The time when the mail thread was inserted to database | [optional] +**update_time** | **\DateTime** | The time when the mail thread was updated in database received | [optional] +**deal_id** | **int** | The ID of the deal | [optional] +**deal_status** | **string** | Status of the deal | [optional] +**lead_id** | **string** | The ID of the lead | [optional] +**all_messages_sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether all the mail thread messages have 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/BaseMailThreadAllOfParties.md b/docs/Model/BaseMailThreadAllOfParties.md new file mode 100644 index 00000000..2202b7c4 --- /dev/null +++ b/docs/Model/BaseMailThreadAllOfParties.md @@ -0,0 +1,10 @@ +# # BaseMailThreadAllOfParties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Recipients of the mail thread | [optional] +**from** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Senders of the mail thread | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseMailThreadMessages.md b/docs/Model/BaseMailThreadMessages.md new file mode 100644 index 00000000..717a52ba --- /dev/null +++ b/docs/Model/BaseMailThreadMessages.md @@ -0,0 +1,35 @@ +# # BaseMailThreadMessages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail thread | [optional] +**account_id** | **string** | The connection account ID | [optional] +**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] +**subject** | **string** | The subject | [optional] +**snippet** | **string** | A snippet | [optional] +**read_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is read | [optional] +**mail_tracking_status** | **string** | Mail tracking status | [optional] +**has_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has an attachment | [optional] +**has_inline_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has inline attachments | [optional] +**has_real_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has real attachments (which are not inline) | [optional] +**deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is deleted | [optional] +**synced_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is synced | [optional] +**smart_bcc_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether one of the parties of the mail thread is Bcc | [optional] +**mail_link_tracking_enabled_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the link tracking of the mail thread is enabled | [optional] +**from** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Senders of the mail thread | [optional] +**to** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Recipients of the mail thread | [optional] +**cc** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Participants of the Cc | [optional] +**bcc** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Participants of the Bcc | [optional] +**body_url** | **string** | A link to the mail thread message | [optional] +**mail_thread_id** | **int** | ID of the mail thread | [optional] +**draft** | **string** | If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. | [optional] +**has_body_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread message has a body | [optional] +**sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread message is sent | [optional] +**sent_from_pipedrive_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread message is sent from Pipedrive | [optional] +**message_time** | **\DateTime** | The time when the mail message was received or created | [optional] +**add_time** | **\DateTime** | The time when the mail message was inserted to database | [optional] +**update_time** | **\DateTime** | The time when the mail message was updated in database received | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseMailThreadMessagesAllOf.md b/docs/Model/BaseMailThreadMessagesAllOf.md new file mode 100644 index 00000000..d4ccd7f3 --- /dev/null +++ b/docs/Model/BaseMailThreadMessagesAllOf.md @@ -0,0 +1,21 @@ +# # BaseMailThreadMessagesAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Senders of the mail thread | [optional] +**to** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Recipients of the mail thread | [optional] +**cc** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Participants of the Cc | [optional] +**bcc** | [**\Pipedrive\Model\MailThreadParticipant[]**](MailThreadParticipant.md) | Participants of the Bcc | [optional] +**body_url** | **string** | A link to the mail thread message | [optional] +**mail_thread_id** | **int** | ID of the mail thread | [optional] +**draft** | **string** | If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. | [optional] +**has_body_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread message has a body | [optional] +**sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread message is sent | [optional] +**sent_from_pipedrive_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread message is sent from Pipedrive | [optional] +**message_time** | **\DateTime** | The time when the mail message was received or created | [optional] +**add_time** | **\DateTime** | The time when the mail message was inserted to database | [optional] +**update_time** | **\DateTime** | The time when the mail message was updated in database received | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseNote.md b/docs/Model/BaseNote.md new file mode 100644 index 00000000..43b59b2a --- /dev/null +++ b/docs/Model/BaseNote.md @@ -0,0 +1,26 @@ +# # BaseNote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the note | [optional] +**active_flag** | **bool** | Whether the note is active or deleted | [optional] +**add_time** | **string** | The creation date and time of the note | [optional] +**content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | [optional] +**deal** | [**\Pipedrive\Model\BaseNoteDealTitle**](BaseNoteDealTitle.md) | | [optional] +**lead_id** | **string** | The ID of the lead the note is attached to | [optional] +**deal_id** | **int** | The ID of the deal the note is attached to | [optional] +**last_update_user_id** | **int** | The ID of the user who last updated the note | [optional] +**org_id** | **int** | The ID of the organization the note is attached to | [optional] +**organization** | [**\Pipedrive\Model\BaseNoteOrganization**](BaseNoteOrganization.md) | | [optional] +**person** | [**\Pipedrive\Model\BaseNotePerson**](BaseNotePerson.md) | | [optional] +**person_id** | **int** | The ID of the person the note is attached to | [optional] +**pinned_to_deal_flag** | **bool** | If true, the results are filtered by note to deal pinning state | [optional] +**pinned_to_organization_flag** | **bool** | If true, the results are filtered by note to organization pinning state | [optional] +**pinned_to_person_flag** | **bool** | If true, the results are filtered by note to person pinning state | [optional] +**update_time** | **string** | The last updated date and time of the note | [optional] +**user** | [**\Pipedrive\Model\NoteCreatorUser**](NoteCreatorUser.md) | | [optional] +**user_id** | **int** | The ID of the note creator | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseNoteDealTitle.md b/docs/Model/BaseNoteDealTitle.md new file mode 100644 index 00000000..bc616b89 --- /dev/null +++ b/docs/Model/BaseNoteDealTitle.md @@ -0,0 +1,9 @@ +# # BaseNoteDealTitle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the deal this note is attached 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/BaseNoteOrganization.md b/docs/Model/BaseNoteOrganization.md new file mode 100644 index 00000000..2fcffc47 --- /dev/null +++ b/docs/Model/BaseNoteOrganization.md @@ -0,0 +1,9 @@ +# # BaseNoteOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization the note is attached 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/BaseNotePerson.md b/docs/Model/BaseNotePerson.md new file mode 100644 index 00000000..f288e517 --- /dev/null +++ b/docs/Model/BaseNotePerson.md @@ -0,0 +1,9 @@ +# # BaseNotePerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person the note is attached 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/BaseOrganizationItem.md b/docs/Model/BaseOrganizationItem.md new file mode 100644 index 00000000..45c19ff2 --- /dev/null +++ b/docs/Model/BaseOrganizationItem.md @@ -0,0 +1,54 @@ +# # BaseOrganizationItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization | [optional] +**company_id** | **int** | The ID of the company related to the organization | [optional] +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**name** | **string** | The name of the organization | [optional] +**active_flag** | **bool** | Whether the organization is active or not | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithValue**](PictureDataWithValue.md) | | [optional] +**country_code** | **string** | The country code of the organization | [optional] +**first_char** | **string** | The first character of the organization name | [optional] +**add_time** | **string** | The creation date and time of the organization | [optional] +**update_time** | **string** | The last updated date and time of the organization | [optional] +**visible_to** | **string** | The visibility group ID of who can see the organization | [optional] +**label** | **int** | The ID of the label | [optional] +**owner_name** | **string** | The name of the organization owner | [optional] +**cc_email** | **string** | The BCC email of the organization | [optional] +**email_messages_count** | **int** | The count of email messages related to the organization | [optional] +**people_count** | **int** | The count of persons related to the organization | [optional] +**activities_count** | **int** | The count of activities related to the organization | [optional] +**done_activities_count** | **int** | The count of done activities related to the organization | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the organization | [optional] +**files_count** | **int** | The count of files related to the organization | [optional] +**notes_count** | **int** | The count of notes related to the organization | [optional] +**followers_count** | **int** | The count of followers related to the organization | [optional] +**address** | **string** | The full address of the organization | [optional] +**address_subpremise** | **string** | The sub-premise of the organization location | [optional] +**address_street_number** | **string** | The street number of the organization location | [optional] +**address_route** | **string** | The route of the organization location | [optional] +**address_sublocality** | **string** | The sub-locality of the organization location | [optional] +**address_locality** | **string** | The locality of the organization location | [optional] +**address_admin_area_level_1** | **string** | The level 1 admin area of the organization location | [optional] +**address_admin_area_level_2** | **string** | The level 2 admin area of the organization location | [optional] +**address_country** | **string** | The country of the organization location | [optional] +**address_postal_code** | **string** | The postal code of the organization location | [optional] +**address_formatted_address** | **string** | The formatted organization location | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseOrganizationItemFields.md b/docs/Model/BaseOrganizationItemFields.md new file mode 100644 index 00000000..8a445362 --- /dev/null +++ b/docs/Model/BaseOrganizationItemFields.md @@ -0,0 +1,22 @@ +# # BaseOrganizationItemFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization | [optional] +**company_id** | **int** | The ID of the company related to the organization | [optional] +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**name** | **string** | The name of the organization | [optional] +**active_flag** | **bool** | Whether the organization is active or not | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithValue**](PictureDataWithValue.md) | | [optional] +**country_code** | **string** | The country code of the organization | [optional] +**first_char** | **string** | The first character of the organization name | [optional] +**add_time** | **string** | The creation date and time of the organization | [optional] +**update_time** | **string** | The last updated date and time of the organization | [optional] +**visible_to** | **string** | The visibility group ID of who can see the organization | [optional] +**label** | **int** | The ID of the label | [optional] +**owner_name** | **string** | The name of the organization owner | [optional] +**cc_email** | **string** | The BCC email of the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseOrganizationItemWithEditNameFlag.md b/docs/Model/BaseOrganizationItemWithEditNameFlag.md new file mode 100644 index 00000000..243ef918 --- /dev/null +++ b/docs/Model/BaseOrganizationItemWithEditNameFlag.md @@ -0,0 +1,55 @@ +# # BaseOrganizationItemWithEditNameFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization | [optional] +**company_id** | **int** | The ID of the company related to the organization | [optional] +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**name** | **string** | The name of the organization | [optional] +**active_flag** | **bool** | Whether the organization is active or not | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithValue**](PictureDataWithValue.md) | | [optional] +**country_code** | **string** | The country code of the organization | [optional] +**first_char** | **string** | The first character of the organization name | [optional] +**add_time** | **string** | The creation date and time of the organization | [optional] +**update_time** | **string** | The last updated date and time of the organization | [optional] +**visible_to** | **string** | The visibility group ID of who can see the organization | [optional] +**label** | **int** | The ID of the label | [optional] +**owner_name** | **string** | The name of the organization owner | [optional] +**cc_email** | **string** | The BCC email of the organization | [optional] +**email_messages_count** | **int** | The count of email messages related to the organization | [optional] +**people_count** | **int** | The count of persons related to the organization | [optional] +**activities_count** | **int** | The count of activities related to the organization | [optional] +**done_activities_count** | **int** | The count of done activities related to the organization | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the organization | [optional] +**files_count** | **int** | The count of files related to the organization | [optional] +**notes_count** | **int** | The count of notes related to the organization | [optional] +**followers_count** | **int** | The count of followers related to the organization | [optional] +**address** | **string** | The full address of the organization | [optional] +**address_subpremise** | **string** | The sub-premise of the organization location | [optional] +**address_street_number** | **string** | The street number of the organization location | [optional] +**address_route** | **string** | The route of the organization location | [optional] +**address_sublocality** | **string** | The sub-locality of the organization location | [optional] +**address_locality** | **string** | The locality of the organization location | [optional] +**address_admin_area_level_1** | **string** | The level 1 admin area of the organization location | [optional] +**address_admin_area_level_2** | **string** | The level 2 admin area of the organization location | [optional] +**address_country** | **string** | The country of the organization location | [optional] +**address_postal_code** | **string** | The postal code of the organization location | [optional] +**address_formatted_address** | **string** | The formatted organization location | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**edit_name** | **bool** | If the company ID of the organization and company ID of the request is same 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/BaseOrganizationItemWithEditNameFlagAllOf.md b/docs/Model/BaseOrganizationItemWithEditNameFlagAllOf.md new file mode 100644 index 00000000..208e456b --- /dev/null +++ b/docs/Model/BaseOrganizationItemWithEditNameFlagAllOf.md @@ -0,0 +1,9 @@ +# # BaseOrganizationItemWithEditNameFlagAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**edit_name** | **bool** | If the company ID of the organization and company ID of the request is same 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/BaseOrganizationRelationshipItem.md b/docs/Model/BaseOrganizationRelationshipItem.md new file mode 100644 index 00000000..7b9ef3bc --- /dev/null +++ b/docs/Model/BaseOrganizationRelationshipItem.md @@ -0,0 +1,15 @@ +# # BaseOrganizationRelationshipItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization relationship | [optional] +**type** | **string** | The type of the relationship | [optional] +**rel_owner_org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItem**](RelationshipOrganizationInfoItem.md) | | [optional] +**rel_linked_org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItem**](RelationshipOrganizationInfoItem.md) | | [optional] +**add_time** | **string** | The creation date and time of the relationship | [optional] +**update_time** | **string** | The last updated date and time of the relationship | [optional] +**active_flag** | **string** | Whether the relationship is active 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/BasePersonItem.md b/docs/Model/BasePersonItem.md new file mode 100644 index 00000000..aec29e54 --- /dev/null +++ b/docs/Model/BasePersonItem.md @@ -0,0 +1,22 @@ +# # BasePersonItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person | [optional] +**company_id** | **int** | The ID of the company related to the person | [optional] +**active_flag** | **bool** | Whether the person is active or not | [optional] +**phone** | [**\Pipedrive\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**email** | [**\Pipedrive\Model\BasePersonItemEmail[]**](BasePersonItemEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required. | [optional] +**first_char** | **string** | The first letter of the name of the person | [optional] +**add_time** | **string** | The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS | [optional] +**visible_to** | **string** | The visibility group ID of who can see the person | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithID**](PictureDataWithID.md) | | [optional] +**label** | **int** | The label assigned to the person | [optional] +**org_name** | **string** | The name of the organization associated with the person | [optional] +**owner_name** | **string** | The name of the owner associated with the person | [optional] +**cc_email** | **string** | The BCC email associated with the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasePersonItemEmail.md b/docs/Model/BasePersonItemEmail.md new file mode 100644 index 00000000..1d981e7e --- /dev/null +++ b/docs/Model/BasePersonItemEmail.md @@ -0,0 +1,11 @@ +# # BasePersonItemEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | Email | [optional] +**primary** | **bool** | Boolean that indicates if email is primary for the person or not | [optional] +**label** | **string** | The label that indicates the type of the email. (Possible values - work, home or other) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasePersonItemPhone.md b/docs/Model/BasePersonItemPhone.md new file mode 100644 index 00000000..32e2ce59 --- /dev/null +++ b/docs/Model/BasePersonItemPhone.md @@ -0,0 +1,11 @@ +# # BasePersonItemPhone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The phone number | [optional] +**primary** | **bool** | Boolean that indicates if phone number is primary for the person or not | [optional] +**label** | **string** | The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasePipeline.md b/docs/Model/BasePipeline.md new file mode 100644 index 00000000..e6966849 --- /dev/null +++ b/docs/Model/BasePipeline.md @@ -0,0 +1,16 @@ +# # BasePipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the pipeline | [optional] +**name** | **string** | The name of the pipeline | [optional] +**url_title** | **string** | The pipeline title displayed in the URL | [optional] +**order_nr** | **int** | Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. | [optional] +**active** | **bool** | Whether this pipeline will be made inactive (hidden) or active | [optional] +**deal_probability** | **bool** | Whether deal probability is disabled or enabled for this pipeline | [optional] +**add_time** | **string** | The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasePipelineWithSelectedFlag.md b/docs/Model/BasePipelineWithSelectedFlag.md new file mode 100644 index 00000000..eed694cb --- /dev/null +++ b/docs/Model/BasePipelineWithSelectedFlag.md @@ -0,0 +1,17 @@ +# # BasePipelineWithSelectedFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the pipeline | [optional] +**name** | **string** | The name of the pipeline | [optional] +**url_title** | **string** | The pipeline title displayed in the URL | [optional] +**order_nr** | **int** | Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. | [optional] +**active** | **bool** | Whether this pipeline will be made inactive (hidden) or active | [optional] +**deal_probability** | **bool** | Whether deal probability is disabled or enabled for this pipeline | [optional] +**add_time** | **string** | The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**selected** | **bool** | A boolean that shows if the pipeline is selected from a filter 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/BasePipelineWithSelectedFlagAllOf.md b/docs/Model/BasePipelineWithSelectedFlagAllOf.md new file mode 100644 index 00000000..6186977a --- /dev/null +++ b/docs/Model/BasePipelineWithSelectedFlagAllOf.md @@ -0,0 +1,9 @@ +# # BasePipelineWithSelectedFlagAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**selected** | **bool** | A boolean that shows if the pipeline is selected from a filter 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/BaseProduct.md b/docs/Model/BaseProduct.md new file mode 100644 index 00000000..fdb525c9 --- /dev/null +++ b/docs/Model/BaseProduct.md @@ -0,0 +1,17 @@ +# # BaseProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **float** | The ID of the product | [optional] +**name** | **string** | The name of the product | [optional] +**code** | **string** | The product code | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The ax percentage | [optional] [default to 0] +**active_flag** | **bool** | Whether this product is active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product is selected in deals or not | [optional] [default to true] +**visible_to** | [**VisibleTo**](VisibleTo.md) | Visibility of the product | [optional] +**owner_id** | **object** | Information about the Pipedrive user who owns the product | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseResponse.md b/docs/Model/BaseResponse.md new file mode 100644 index 00000000..d7fab50f --- /dev/null +++ b/docs/Model/BaseResponse.md @@ -0,0 +1,9 @@ +# # BaseResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful 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/BaseResponseWithStatus.md b/docs/Model/BaseResponseWithStatus.md new file mode 100644 index 00000000..d65bdd51 --- /dev/null +++ b/docs/Model/BaseResponseWithStatus.md @@ -0,0 +1,10 @@ +# # BaseResponseWithStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**status** | **string** | The status of the response | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseResponseWithStatusAllOf.md b/docs/Model/BaseResponseWithStatusAllOf.md new file mode 100644 index 00000000..ec1dc7f5 --- /dev/null +++ b/docs/Model/BaseResponseWithStatusAllOf.md @@ -0,0 +1,9 @@ +# # BaseResponseWithStatusAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | The status of the response | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseRole.md b/docs/Model/BaseRole.md new file mode 100644 index 00000000..dec8db28 --- /dev/null +++ b/docs/Model/BaseRole.md @@ -0,0 +1,10 @@ +# # BaseRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_role_id** | **int** | The ID of the parent role | [optional] +**name** | **string** | The name of the 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/BaseStage.md b/docs/Model/BaseStage.md new file mode 100644 index 00000000..a04240f1 --- /dev/null +++ b/docs/Model/BaseStage.md @@ -0,0 +1,18 @@ +# # BaseStage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the stage | [optional] +**order_nr** | **int** | Defines the order of the stage | [optional] +**name** | **string** | The name of the stage | [optional] +**active_flag** | **bool** | Whether the stage is active or deleted | [optional] +**deal_probability** | **int** | The success probability percentage of the deal. Used/shown when the deal weighted values are used. | [optional] +**pipeline_id** | **int** | The ID of the pipeline to add the stage to | [optional] +**rotten_flag** | **bool** | Whether deals in this stage can become rotten | [optional] +**rotten_days** | **int** | The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. | [optional] +**add_time** | **string** | The stage creation time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The stage update time. Format: YYYY-MM-DD HH:MM:SS. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseTeam.md b/docs/Model/BaseTeam.md new file mode 100644 index 00000000..c8f2311b --- /dev/null +++ b/docs/Model/BaseTeam.md @@ -0,0 +1,17 @@ +# # BaseTeam + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The team ID | [optional] +**name** | **string** | The team name | [optional] +**description** | **string** | The team description | [optional] +**manager_id** | **int** | The team manager ID | [optional] +**users** | **int[]** | The list of user IDs | [optional] +**active_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is active | [optional] +**deleted_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is deleted | [optional] +**add_time** | **string** | The team creation time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**created_by_user_id** | **int** | The ID of the user who created the team | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseTeamAdditionalProperties.md b/docs/Model/BaseTeamAdditionalProperties.md new file mode 100644 index 00000000..fa0aa7c4 --- /dev/null +++ b/docs/Model/BaseTeamAdditionalProperties.md @@ -0,0 +1,10 @@ +# # BaseTeamAdditionalProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add_time** | **string** | The team creation time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**created_by_user_id** | **int** | The ID of the user who created the team | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseUser.md b/docs/Model/BaseUser.md new file mode 100644 index 00000000..cf9ba6aa --- /dev/null +++ b/docs/Model/BaseUser.md @@ -0,0 +1,27 @@ +# # BaseUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The user ID | [optional] +**name** | **string** | The user name | [optional] +**default_currency** | **string** | The user default currency | [optional] +**locale** | **string** | The user locale | [optional] +**lang** | **int** | The user language ID | [optional] +**email** | **string** | The user email | [optional] +**phone** | **string** | The user phone | [optional] +**activated** | **bool** | Boolean that indicates whether the user is activated | [optional] +**last_login** | **string** | The last login date and time of the user. Format: YYYY-MM-DD HH:MM:SS | [optional] +**created** | **string** | The creation date and time of the user. Format: YYYY-MM-DD HH:MM:SS | [optional] +**modified** | **string** | The last modification date and time of the user. Format: YYYY-MM-DD HH:MM:SS | [optional] +**has_created_company** | **bool** | Boolean that indicates whether the user has created a company | [optional] +**access** | [**\Pipedrive\Model\UserAccess[]**](UserAccess.md) | | [optional] +**active_flag** | **bool** | Boolean that indicates whether the user is activated | [optional] +**timezone_name** | **string** | The user timezone name | [optional] +**timezone_offset** | **string** | The user timezone offset | [optional] +**role_id** | **int** | The ID of the user role | [optional] +**icon_url** | **string** | The user icon URL | [optional] +**is_you** | **bool** | Boolean that indicates if the requested user is the same which is logged in (in this case, always true) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseUserMe.md b/docs/Model/BaseUserMe.md new file mode 100644 index 00000000..6df3b7d4 --- /dev/null +++ b/docs/Model/BaseUserMe.md @@ -0,0 +1,33 @@ +# # BaseUserMe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The user ID | [optional] +**name** | **string** | The user name | [optional] +**default_currency** | **string** | The user default currency | [optional] +**locale** | **string** | The user locale | [optional] +**lang** | **int** | The user language ID | [optional] +**email** | **string** | The user email | [optional] +**phone** | **string** | The user phone | [optional] +**activated** | **bool** | Boolean that indicates whether the user is activated | [optional] +**last_login** | **string** | The last login date and time of the user. Format: YYYY-MM-DD HH:MM:SS | [optional] +**created** | **string** | The creation date and time of the user. Format: YYYY-MM-DD HH:MM:SS | [optional] +**modified** | **string** | The last modification date and time of the user. Format: YYYY-MM-DD HH:MM:SS | [optional] +**has_created_company** | **bool** | Boolean that indicates whether the user has created a company | [optional] +**access** | [**\Pipedrive\Model\UserAccess[]**](UserAccess.md) | | [optional] +**active_flag** | **bool** | Boolean that indicates whether the user is activated | [optional] +**timezone_name** | **string** | The user timezone name | [optional] +**timezone_offset** | **string** | The user timezone offset | [optional] +**role_id** | **int** | The ID of the user role | [optional] +**icon_url** | **string** | The user icon URL | [optional] +**is_you** | **bool** | Boolean that indicates if the requested user is the same which is logged in (in this case, always true) | [optional] +**company_id** | **int** | The user company ID | [optional] +**company_name** | **string** | The user company name | [optional] +**company_domain** | **string** | The user company domain | [optional] +**company_country** | **string** | The user company country | [optional] +**company_industry** | **string** | The user company industry | [optional] +**language** | [**\Pipedrive\Model\BaseUserMeAllOfLanguage**](BaseUserMeAllOfLanguage.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/BaseUserMeAllOf.md b/docs/Model/BaseUserMeAllOf.md new file mode 100644 index 00000000..0e174994 --- /dev/null +++ b/docs/Model/BaseUserMeAllOf.md @@ -0,0 +1,14 @@ +# # BaseUserMeAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_id** | **int** | The user company ID | [optional] +**company_name** | **string** | The user company name | [optional] +**company_domain** | **string** | The user company domain | [optional] +**company_country** | **string** | The user company country | [optional] +**company_industry** | **string** | The user company industry | [optional] +**language** | [**\Pipedrive\Model\BaseUserMeAllOfLanguage**](BaseUserMeAllOfLanguage.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/BaseUserMeAllOfLanguage.md b/docs/Model/BaseUserMeAllOfLanguage.md new file mode 100644 index 00000000..d1cd1fca --- /dev/null +++ b/docs/Model/BaseUserMeAllOfLanguage.md @@ -0,0 +1,10 @@ +# # BaseUserMeAllOfLanguage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**language_code** | **string** | The language code. E.g. en | [optional] +**country_code** | **string** | The country code. E.g. US | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BaseWebhook.md b/docs/Model/BaseWebhook.md new file mode 100644 index 00000000..a950e89b --- /dev/null +++ b/docs/Model/BaseWebhook.md @@ -0,0 +1,26 @@ +# # BaseWebhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the Webhook | [optional] +**company_id** | **int** | The ID of the company related to the Webhook | [optional] +**owner_id** | **int** | The ID of the user who owns the Webhook | [optional] +**user_id** | **int** | The ID of the user related to the Webhook | [optional] +**event_action** | **string** | The Webhook action | [optional] +**event_object** | **string** | The Webhook object | [optional] +**subscription_url** | **string** | The subscription URL of the Webhook | [optional] +**is_active** | [**NumberBooleanDefault1**](NumberBooleanDefault1.md) | The Webhook's status | [optional] +**add_time** | **\DateTime** | The date when the Webhook was added | [optional] +**remove_time** | **\DateTime** | The date when the Webhook was removed (if removed) | [optional] +**type** | **string** | The type of the Webhook | [optional] +**http_auth_user** | **string** | The username of the `subscription_url` of the Webhook | [optional] +**http_auth_password** | **string** | The password of the `subscription_url` of the Webhook | [optional] +**additional_data** | **object** | Any additional data related to the Webhook | [optional] +**remove_reason** | **string** | The removal reason of the Webhook (if removed) | [optional] +**last_delivery_time** | **\DateTime** | The last delivery time of the Webhook | [optional] +**last_http_status** | **int** | The last delivery HTTP status of the Webhook | [optional] +**admin_id** | **int** | The ID of the admin of the Webhook | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasicDeal.md b/docs/Model/BasicDeal.md new file mode 100644 index 00000000..4e1f88cd --- /dev/null +++ b/docs/Model/BasicDeal.md @@ -0,0 +1,20 @@ +# # BasicDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The value of the deal. If omitted, value will be set to 0. | [optional] +**currency** | **string** | The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. | [optional] +**user_id** | **int** | The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. | [optional] +**person_id** | **int** | The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. | [optional] +**org_id** | **int** | The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. | [optional] +**pipeline_id** | **int** | The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. | [optional] +**stage_id** | **int** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. | [optional] +**status** | **string** | open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional] +**probability** | **float** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional] +**lost_reason** | **string** | The optional message about why the deal was lost (to be used when status = lost) | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></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/BasicDealProduct.md b/docs/Model/BasicDealProduct.md new file mode 100644 index 00000000..8e68f3f6 --- /dev/null +++ b/docs/Model/BasicDealProduct.md @@ -0,0 +1,18 @@ +# # BasicDealProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | The ID of the product to use | +**item_price** | **float** | The price at which this product will be added to the deal | +**quantity** | **int** | Quantity – e.g. how many items of this product will be added to the deal | +**discount_percentage** | **float** | The discount %. If omitted, will be set to 0. | [optional] [default to 0] +**duration** | **float** | The duration of the product. If omitted, will be set to 1. | [optional] [default to 1] +**duration_unit** | [**DealProductUnitDuration**](DealProductUnitDuration.md) | The unit duration of the product | [optional] +**product_variation_id** | **int** | The ID of the product variation to use. When omitted, no variation will be used. | [optional] +**comments** | **string** | A textual comment associated with this product-deal attachment | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**enabled_flag** | **bool** | Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasicGoal.md b/docs/Model/BasicGoal.md new file mode 100644 index 00000000..fe527328 --- /dev/null +++ b/docs/Model/BasicGoal.md @@ -0,0 +1,14 @@ +# # BasicGoal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the goal | [optional] +**assignee** | **object** | Who this goal is assigned to. It requires the following JSON structure: `{ \"id\": \"1\", \"type\": \"person\" }`. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. | [optional] +**type** | **object** | The type of the goal. It requires the following JSON structure: `{ \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }`. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.” | [optional] +**expected_outcome** | **object** | The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: `{ \"target\": \"50\", \"tracking_metric\": \"quantity\" }` or `{ \"target\": \"50\", \"tracking_metric\": \"sum\", \"currency_id\": 1 }`. `currency_id` should only be added to `sum` type of goals. | [optional] +**duration** | **object** | The date when the goal starts and ends. It requires the following JSON structure: `{ \"start\": \"2019-01-01\", \"end\": \"2022-12-31\" }`. Date in format of YYYY-MM-DD. \"end\" can be set to `null` for an infinite, open-ended goal. | [optional] +**interval** | **string** | The interval of the goal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasicOrganization.md b/docs/Model/BasicOrganization.md new file mode 100644 index 00000000..d43cbe60 --- /dev/null +++ b/docs/Model/BasicOrganization.md @@ -0,0 +1,10 @@ +# # BasicOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | **int** | The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></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/BasicPerson.md b/docs/Model/BasicPerson.md new file mode 100644 index 00000000..305d0f37 --- /dev/null +++ b/docs/Model/BasicPerson.md @@ -0,0 +1,15 @@ +# # BasicPerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | **int** | The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. | [optional] +**org_id** | **int** | The ID of the organization this person will belong to | [optional] +**email** | [**\Pipedrive\Model\BasicPersonEmail[]**](BasicPersonEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. | [optional] +**phone** | [**\Pipedrive\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**marketing_status** | [**MarketingStatus**](MarketingStatus.md) | If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> | [optional] +**add_time** | **string** | The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BasicPersonEmail.md b/docs/Model/BasicPersonEmail.md new file mode 100644 index 00000000..71601397 --- /dev/null +++ b/docs/Model/BasicPersonEmail.md @@ -0,0 +1,11 @@ +# # BasicPersonEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | The email | [optional] +**primary** | **bool** | Boolean that indicates if email is primary for the person or not | [optional] +**label** | **string** | The label that indicates the type of the email. (Possible values - work, home or other) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BulkDeleteResponse.md b/docs/Model/BulkDeleteResponse.md new file mode 100644 index 00000000..975ef531 --- /dev/null +++ b/docs/Model/BulkDeleteResponse.md @@ -0,0 +1,10 @@ +# # BulkDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BulkDeleteResponseAllOfData**](BulkDeleteResponseAllOfData.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/BulkDeleteResponseAllOf.md b/docs/Model/BulkDeleteResponseAllOf.md new file mode 100644 index 00000000..1464d8e2 --- /dev/null +++ b/docs/Model/BulkDeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # BulkDeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BulkDeleteResponseAllOfData**](BulkDeleteResponseAllOfData.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/BulkDeleteResponseAllOfData.md b/docs/Model/BulkDeleteResponseAllOfData.md new file mode 100644 index 00000000..73726afa --- /dev/null +++ b/docs/Model/BulkDeleteResponseAllOfData.md @@ -0,0 +1,9 @@ +# # BulkDeleteResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The list of deleted field IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CalculatedFields.md b/docs/Model/CalculatedFields.md new file mode 100644 index 00000000..aac6a65a --- /dev/null +++ b/docs/Model/CalculatedFields.md @@ -0,0 +1,10 @@ +# # CalculatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**calculated_type** | **string** | The calculated type of the relationship with the linked organization | [optional] +**calculated_related_org_id** | **int** | The ID of the linked organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogObject.md b/docs/Model/CallLogObject.md new file mode 100644 index 00000000..a32e1e1f --- /dev/null +++ b/docs/Model/CallLogObject.md @@ -0,0 +1,21 @@ +# # CallLogObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. | [optional] +**activity_id** | **int** | If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. The `activity_id` must refer to a `call` type activity. | [optional] +**subject** | **string** | The name of the activity this call is attached to | [optional] +**duration** | **string** | The duration of the call in seconds | [optional] +**outcome** | **string** | Describes the outcome of the call | +**from_phone_number** | **string** | The number that made the call | [optional] +**to_phone_number** | **string** | The number called | +**start_time** | **\DateTime** | The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. | +**end_time** | **\DateTime** | The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. | +**person_id** | **int** | The ID of the person this call is associated with | [optional] +**org_id** | **int** | The ID of the organization this call is associated with | [optional] +**deal_id** | **int** | The ID of the deal this call is associated with | [optional] +**note** | **string** | The note for the call log in HTML format | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogResponse200.md b/docs/Model/CallLogResponse200.md new file mode 100644 index 00000000..0b98833b --- /dev/null +++ b/docs/Model/CallLogResponse200.md @@ -0,0 +1,10 @@ +# # CallLogResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ResponseCallLogObject**](ResponseCallLogObject.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/CallLogResponse400.md b/docs/Model/CallLogResponse400.md new file mode 100644 index 00000000..7a53e8fb --- /dev/null +++ b/docs/Model/CallLogResponse400.md @@ -0,0 +1,13 @@ +# # CallLogResponse400 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogResponse403.md b/docs/Model/CallLogResponse403.md new file mode 100644 index 00000000..ffefccc5 --- /dev/null +++ b/docs/Model/CallLogResponse403.md @@ -0,0 +1,13 @@ +# # CallLogResponse403 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogResponse404.md b/docs/Model/CallLogResponse404.md new file mode 100644 index 00000000..0a9835ad --- /dev/null +++ b/docs/Model/CallLogResponse404.md @@ -0,0 +1,13 @@ +# # CallLogResponse404 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogResponse409.md b/docs/Model/CallLogResponse409.md new file mode 100644 index 00000000..fe28947a --- /dev/null +++ b/docs/Model/CallLogResponse409.md @@ -0,0 +1,13 @@ +# # CallLogResponse409 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogResponse410.md b/docs/Model/CallLogResponse410.md new file mode 100644 index 00000000..f0fce06f --- /dev/null +++ b/docs/Model/CallLogResponse410.md @@ -0,0 +1,13 @@ +# # CallLogResponse410 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogResponse500.md b/docs/Model/CallLogResponse500.md new file mode 100644 index 00000000..d5ec87d9 --- /dev/null +++ b/docs/Model/CallLogResponse500.md @@ -0,0 +1,13 @@ +# # CallLogResponse500 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CallLogsResponse.md b/docs/Model/CallLogsResponse.md new file mode 100644 index 00000000..62f23e1e --- /dev/null +++ b/docs/Model/CallLogsResponse.md @@ -0,0 +1,11 @@ +# # CallLogsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ResponseCallLogObject[]**](ResponseCallLogObject.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\CallLogsResponseAdditionalData**](CallLogsResponseAdditionalData.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/CallLogsResponseAdditionalData.md b/docs/Model/CallLogsResponseAdditionalData.md new file mode 100644 index 00000000..918ec7d0 --- /dev/null +++ b/docs/Model/CallLogsResponseAdditionalData.md @@ -0,0 +1,9 @@ +# # CallLogsResponseAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ChannelObject.md b/docs/Model/ChannelObject.md new file mode 100644 index 00000000..2e58228a --- /dev/null +++ b/docs/Model/ChannelObject.md @@ -0,0 +1,13 @@ +# # ChannelObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the channel | +**provider_channel_id** | **string** | The channel ID | +**avatar_url** | **string** | The URL for an icon that represents your channel | [optional] +**template_support** | **bool** | If true, enables templates logic on UI. Requires getTemplates endpoint implemented. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension). | [optional] [default to false] +**provider_type** | **string** | It controls the icons (like the icon next to the conversation) | [optional] [default to 'other'] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChannelObjectResponse.md b/docs/Model/ChannelObjectResponse.md new file mode 100644 index 00000000..e0d70b3b --- /dev/null +++ b/docs/Model/ChannelObjectResponse.md @@ -0,0 +1,10 @@ +# # ChannelObjectResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\ChannelObjectResponseData**](ChannelObjectResponseData.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/ChannelObjectResponseData.md b/docs/Model/ChannelObjectResponseData.md new file mode 100644 index 00000000..323149de --- /dev/null +++ b/docs/Model/ChannelObjectResponseData.md @@ -0,0 +1,18 @@ +# # ChannelObjectResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique channel ID used internally in omnichannel-api and the frontend of the extension | [optional] +**name** | **string** | The name of the channel | [optional] +**avatar_url** | **string** | The URL for an icon that represents your channel | [optional] +**provider_channel_id** | **string** | The channel ID you specified while creating the channel | [optional] +**marketplace_client_id** | **string** | The client_id of your app in Pipedrive marketplace | [optional] +**pd_company_id** | **int** | The ID of the user's company in Pipedrive | [optional] +**pd_user_id** | **int** | The ID of the user in Pipedrive | [optional] +**created_at** | **\DateTime** | The date and time when your channel was created in the API | [optional] +**provider_type** | **string** | Value of the provider_type sent to this endpoint | [optional] +**template_support** | **bool** | Value of the template_support sent to this endpoint | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CommentPostPutObject.md b/docs/Model/CommentPostPutObject.md new file mode 100644 index 00000000..c069ddf4 --- /dev/null +++ b/docs/Model/CommentPostPutObject.md @@ -0,0 +1,9 @@ +# # CommentPostPutObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **string** | The content of the comment in HTML format. Subject to sanitization on the back-end. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CommonMailThread.md b/docs/Model/CommonMailThread.md new file mode 100644 index 00000000..985b75ee --- /dev/null +++ b/docs/Model/CommonMailThread.md @@ -0,0 +1,22 @@ +# # CommonMailThread + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail thread | [optional] +**account_id** | **string** | The connection account ID | [optional] +**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] +**subject** | **string** | The subject | [optional] +**snippet** | **string** | A snippet | [optional] +**read_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is read | [optional] +**mail_tracking_status** | **string** | Mail tracking status | [optional] +**has_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has an attachment | [optional] +**has_inline_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has inline attachments | [optional] +**has_real_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread has real attachments (which are not inline) | [optional] +**deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is deleted | [optional] +**synced_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail thread is synced | [optional] +**smart_bcc_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether one of the parties of the mail thread is Bcc | [optional] +**mail_link_tracking_enabled_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the link tracking of the mail thread is enabled | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateRemoteFileAndLinkItToItem.md b/docs/Model/CreateRemoteFileAndLinkItToItem.md new file mode 100644 index 00000000..77bae39f --- /dev/null +++ b/docs/Model/CreateRemoteFileAndLinkItToItem.md @@ -0,0 +1,10 @@ +# # CreateRemoteFileAndLinkItToItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FileData**](FileData.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/CreateTeam.md b/docs/Model/CreateTeam.md new file mode 100644 index 00000000..c63315f6 --- /dev/null +++ b/docs/Model/CreateTeam.md @@ -0,0 +1,12 @@ +# # CreateTeam + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The team name | [optional] +**description** | **string** | The team description | [optional] +**manager_id** | **int** | The team manager ID | [optional] +**users** | **int[]** | The list of user IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Currencies.md b/docs/Model/Currencies.md new file mode 100644 index 00000000..bbb5a9a7 --- /dev/null +++ b/docs/Model/Currencies.md @@ -0,0 +1,10 @@ +# # Currencies + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseCurrency[]**](BaseCurrency.md) | The array of currencies | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealCollectionResponseObject.md b/docs/Model/DealCollectionResponseObject.md new file mode 100644 index 00000000..c53d41c5 --- /dev/null +++ b/docs/Model/DealCollectionResponseObject.md @@ -0,0 +1,29 @@ +# # DealCollectionResponseObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | **int** | The ID of the deal creator | [optional] +**user_id** | **int** | The ID of the user | [optional] +**person_id** | **int** | The ID of the person associated with the deal | [optional] +**org_id** | **int** | The ID of the organization associated with the deal | [optional] +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The last update date and time of the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status to won in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**lost_time** | **string** | The date and time of changing the deal status to lost in UTC. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealCountAndActivityInfo.md b/docs/Model/DealCountAndActivityInfo.md new file mode 100644 index 00000000..1522e1b6 --- /dev/null +++ b/docs/Model/DealCountAndActivityInfo.md @@ -0,0 +1,21 @@ +# # DealCountAndActivityInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealFlowResponse.md b/docs/Model/DealFlowResponse.md new file mode 100644 index 00000000..e0bfec0e --- /dev/null +++ b/docs/Model/DealFlowResponse.md @@ -0,0 +1,12 @@ +# # DealFlowResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealFlowResponseAllOfData[]**](DealFlowResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects**](DealFlowResponseAllOfRelatedObjects.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/DealFlowResponseAllOf.md b/docs/Model/DealFlowResponseAllOf.md new file mode 100644 index 00000000..acaab755 --- /dev/null +++ b/docs/Model/DealFlowResponseAllOf.md @@ -0,0 +1,11 @@ +# # DealFlowResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DealFlowResponseAllOfData[]**](DealFlowResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects**](DealFlowResponseAllOfRelatedObjects.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/DealFlowResponseAllOfData.md b/docs/Model/DealFlowResponseAllOfData.md new file mode 100644 index 00000000..00c03f8c --- /dev/null +++ b/docs/Model/DealFlowResponseAllOfData.md @@ -0,0 +1,11 @@ +# # DealFlowResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | The type of the deal update. (Possible object types - dealChange, note, activity, mailMessage, invoice, document, file) | [optional] +**timestamp** | **string** | The creation date and time of the update | [optional] +**data** | **object** | The data related to the update | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealFlowResponseAllOfRelatedObjects.md b/docs/Model/DealFlowResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..3821e21f --- /dev/null +++ b/docs/Model/DealFlowResponseAllOfRelatedObjects.md @@ -0,0 +1,12 @@ +# # DealFlowResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal** | [**\Pipedrive\Model\RelatedDealData**](RelatedDealData.md) | | [optional] +**organization** | [**\Pipedrive\Model\RelatedOrganizationData**](RelatedOrganizationData.md) | | [optional] +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.md) | | [optional] +**person** | [**\Pipedrive\Model\RelatedPersonDataWithActiveFlag**](RelatedPersonDataWithActiveFlag.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/DealListActivitiesResponse.md b/docs/Model/DealListActivitiesResponse.md new file mode 100644 index 00000000..fad16d27 --- /dev/null +++ b/docs/Model/DealListActivitiesResponse.md @@ -0,0 +1,12 @@ +# # DealListActivitiesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject[]**](ActivityResponseObject.md) | The array of activities | [optional] +**additional_data** | [**\Pipedrive\Model\ActivityDistributionDataWithAdditionalData**](ActivityDistributionDataWithAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects**](DealListActivitiesResponseAllOfRelatedObjects.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/DealListActivitiesResponseAllOf.md b/docs/Model/DealListActivitiesResponseAllOf.md new file mode 100644 index 00000000..e2d67f82 --- /dev/null +++ b/docs/Model/DealListActivitiesResponseAllOf.md @@ -0,0 +1,11 @@ +# # DealListActivitiesResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ActivityResponseObject[]**](ActivityResponseObject.md) | The array of activities | [optional] +**additional_data** | [**\Pipedrive\Model\ActivityDistributionDataWithAdditionalData**](ActivityDistributionDataWithAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects**](DealListActivitiesResponseAllOfRelatedObjects.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/DealListActivitiesResponseAllOfRelatedObjects.md b/docs/Model/DealListActivitiesResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..18780614 --- /dev/null +++ b/docs/Model/DealListActivitiesResponseAllOfRelatedObjects.md @@ -0,0 +1,12 @@ +# # DealListActivitiesResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag**](RelatedOrganizationDataWithActiveFlag.md) | | [optional] +**person** | [**\Pipedrive\Model\RelatedPersonDataWithActiveFlag**](RelatedPersonDataWithActiveFlag.md) | | [optional] +**deal** | [**\Pipedrive\Model\RelatedDealData**](RelatedDealData.md) | | [optional] +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.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/DealNonStrict.md b/docs/Model/DealNonStrict.md new file mode 100644 index 00000000..7c9f4666 --- /dev/null +++ b/docs/Model/DealNonStrict.md @@ -0,0 +1,65 @@ +# # DealNonStrict + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | [**\Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId**](DealNonStrictModeFieldsCreatorUserId.md) | | [optional] +**user_id** | [**\Pipedrive\Model\DealUserDataWithId**](DealUserDataWithId.md) | | [optional] +**person_id** | [**\Pipedrive\Model\DealPersonDataWithId**](DealPersonDataWithId.md) | | [optional] +**org_id** | [**\Pipedrive\Model\DealOrganizationDataWithId**](DealOrganizationDataWithId.md) | | [optional] +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal | [optional] +**update_time** | **string** | The last updated date and time of the deal | [optional] +**stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**active** | **bool** | Whether the deal is active or not | [optional] +**deleted** | **bool** | Whether the deal is deleted or not | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status as won | [optional] +**first_won_time** | **string** | The date and time of the first time changing the deal status as won | [optional] +**lost_time** | **string** | The date and time of changing the deal status as lost | [optional] +**products_count** | **int** | The number of products associated with the deal | [optional] +**files_count** | **int** | The number of files associated with the deal | [optional] +**notes_count** | **int** | The number of notes associated with the deal | [optional] +**followers_count** | **int** | The number of followers associated with the deal | [optional] +**email_messages_count** | **int** | The number of emails associated with the deal | [optional] +**activities_count** | **int** | The number of activities associated with the deal | [optional] +**done_activities_count** | **int** | The number of completed activities associated with the deal | [optional] +**undone_activities_count** | **int** | The number of incomplete activities associated with the deal | [optional] +**participants_count** | **int** | The number of participants associated with the deal | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the deal | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] +**stage_order_nr** | **int** | The order number of the deal stage associated with the deal | [optional] +**person_name** | **string** | The name of the person associated with the deal | [optional] +**org_name** | **string** | The name of the organization associated with the deal | [optional] +**next_activity_subject** | **string** | The subject of the next activity associated with the deal | [optional] +**next_activity_type** | **string** | The type of the next activity associated with the deal | [optional] +**next_activity_duration** | **string** | The duration of the next activity associated with the deal | [optional] +**next_activity_note** | **string** | The note of the next activity associated with the deal | [optional] +**formatted_value** | **string** | The deal value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value** | **float** | Probability times deal value. Probability can either be deal probability or if not set, then stage probability. | [optional] +**formatted_weighted_value** | **string** | The weighted_value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value_currency** | **string** | The currency associated with the deal | [optional] +**rotten_time** | **string** | The date and time of changing the deal status as rotten | [optional] +**owner_name** | **string** | The name of the deal owner | [optional] +**cc_email** | **string** | The BCC email of the deal | [optional] +**org_hidden** | **bool** | If the organization that is associated with the deal is hidden or not | [optional] +**person_hidden** | **bool** | If the person that is associated with the deal is hidden 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/DealNonStrictModeFields.md b/docs/Model/DealNonStrictModeFields.md new file mode 100644 index 00000000..785df42b --- /dev/null +++ b/docs/Model/DealNonStrictModeFields.md @@ -0,0 +1,13 @@ +# # DealNonStrictModeFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | [**\Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId**](DealNonStrictModeFieldsCreatorUserId.md) | | [optional] +**user_id** | [**\Pipedrive\Model\DealUserDataWithId**](DealUserDataWithId.md) | | [optional] +**person_id** | [**\Pipedrive\Model\DealPersonDataWithId**](DealPersonDataWithId.md) | | [optional] +**org_id** | [**\Pipedrive\Model\DealOrganizationDataWithId**](DealOrganizationDataWithId.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/DealNonStrictModeFieldsCreatorUserId.md b/docs/Model/DealNonStrictModeFieldsCreatorUserId.md new file mode 100644 index 00000000..d64d97f3 --- /dev/null +++ b/docs/Model/DealNonStrictModeFieldsCreatorUserId.md @@ -0,0 +1,15 @@ +# # DealNonStrictModeFieldsCreatorUserId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal creator | [optional] +**name** | **string** | The name of the deal creator | [optional] +**email** | **string** | The email of the deal creator | [optional] +**has_pic** | **bool** | If the creator has a picture or not | [optional] +**pic_hash** | **string** | The creator picture hash | [optional] +**active_flag** | **bool** | Whether the creator is active or not | [optional] +**value** | **int** | The ID of the deal creator | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealNonStrictWithDetails.md b/docs/Model/DealNonStrictWithDetails.md new file mode 100644 index 00000000..df3f6726 --- /dev/null +++ b/docs/Model/DealNonStrictWithDetails.md @@ -0,0 +1,71 @@ +# # DealNonStrictWithDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | [**\Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId**](DealNonStrictModeFieldsCreatorUserId.md) | | [optional] +**user_id** | [**\Pipedrive\Model\DealUserDataWithId**](DealUserDataWithId.md) | | [optional] +**person_id** | [**\Pipedrive\Model\DealPersonDataWithId**](DealPersonDataWithId.md) | | [optional] +**org_id** | [**\Pipedrive\Model\DealOrganizationDataWithId**](DealOrganizationDataWithId.md) | | [optional] +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal | [optional] +**update_time** | **string** | The last updated date and time of the deal | [optional] +**stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**active** | **bool** | Whether the deal is active or not | [optional] +**deleted** | **bool** | Whether the deal is deleted or not | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status as won | [optional] +**first_won_time** | **string** | The date and time of the first time changing the deal status as won | [optional] +**lost_time** | **string** | The date and time of changing the deal status as lost | [optional] +**products_count** | **int** | The number of products associated with the deal | [optional] +**files_count** | **int** | The number of files associated with the deal | [optional] +**notes_count** | **int** | The number of notes associated with the deal | [optional] +**followers_count** | **int** | The number of followers associated with the deal | [optional] +**email_messages_count** | **int** | The number of emails associated with the deal | [optional] +**activities_count** | **int** | The number of activities associated with the deal | [optional] +**done_activities_count** | **int** | The number of completed activities associated with the deal | [optional] +**undone_activities_count** | **int** | The number of incomplete activities associated with the deal | [optional] +**participants_count** | **int** | The number of participants associated with the deal | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the deal | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] +**stage_order_nr** | **int** | The order number of the deal stage associated with the deal | [optional] +**person_name** | **string** | The name of the person associated with the deal | [optional] +**org_name** | **string** | The name of the organization associated with the deal | [optional] +**next_activity_subject** | **string** | The subject of the next activity associated with the deal | [optional] +**next_activity_type** | **string** | The type of the next activity associated with the deal | [optional] +**next_activity_duration** | **string** | The duration of the next activity associated with the deal | [optional] +**next_activity_note** | **string** | The note of the next activity associated with the deal | [optional] +**formatted_value** | **string** | The deal value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value** | **float** | Probability times deal value. Probability can either be deal probability or if not set, then stage probability. | [optional] +**formatted_weighted_value** | **string** | The weighted_value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value_currency** | **string** | The currency associated with the deal | [optional] +**rotten_time** | **string** | The date and time of changing the deal status as rotten | [optional] +**owner_name** | **string** | The name of the deal owner | [optional] +**cc_email** | **string** | The BCC email of the deal | [optional] +**org_hidden** | **bool** | If the organization that is associated with the deal is hidden or not | [optional] +**person_hidden** | **bool** | If the person that is associated with the deal is hidden or not | [optional] +**average_time_to_won** | [**\Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon**](DealNonStrictWithDetailsAllOfAverageTimeToWon.md) | | [optional] +**average_stage_progress** | **float** | The average of the deal stage progression | [optional] +**age** | [**\Pipedrive\Model\DealNonStrictWithDetailsAllOfAge**](DealNonStrictWithDetailsAllOfAge.md) | | [optional] +**stay_in_pipeline_stages** | [**\Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages**](DealNonStrictWithDetailsAllOfStayInPipelineStages.md) | | [optional] +**last_activity** | **object** | The details of the last activity associated with the deal | [optional] +**next_activity** | **object** | The details of the next activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealNonStrictWithDetailsAllOf.md b/docs/Model/DealNonStrictWithDetailsAllOf.md new file mode 100644 index 00000000..fc1e5163 --- /dev/null +++ b/docs/Model/DealNonStrictWithDetailsAllOf.md @@ -0,0 +1,14 @@ +# # DealNonStrictWithDetailsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**average_time_to_won** | [**\Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon**](DealNonStrictWithDetailsAllOfAverageTimeToWon.md) | | [optional] +**average_stage_progress** | **float** | The average of the deal stage progression | [optional] +**age** | [**\Pipedrive\Model\DealNonStrictWithDetailsAllOfAge**](DealNonStrictWithDetailsAllOfAge.md) | | [optional] +**stay_in_pipeline_stages** | [**\Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages**](DealNonStrictWithDetailsAllOfStayInPipelineStages.md) | | [optional] +**last_activity** | **object** | The details of the last activity associated with the deal | [optional] +**next_activity** | **object** | The details of the next activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealNonStrictWithDetailsAllOfAge.md b/docs/Model/DealNonStrictWithDetailsAllOfAge.md new file mode 100644 index 00000000..a399256a --- /dev/null +++ b/docs/Model/DealNonStrictWithDetailsAllOfAge.md @@ -0,0 +1,15 @@ +# # DealNonStrictWithDetailsAllOfAge + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**y** | **int** | Years | [optional] +**m** | **int** | Months | [optional] +**d** | **int** | Days | [optional] +**h** | **int** | Hours | [optional] +**i** | **int** | Minutes | [optional] +**s** | **int** | Seconds | [optional] +**total_seconds** | **int** | The total time in seconds | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.md b/docs/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.md new file mode 100644 index 00000000..01e9a785 --- /dev/null +++ b/docs/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.md @@ -0,0 +1,15 @@ +# # DealNonStrictWithDetailsAllOfAverageTimeToWon + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**y** | **int** | Years | [optional] +**m** | **int** | Months | [optional] +**d** | **int** | Days | [optional] +**h** | **int** | Hours | [optional] +**i** | **int** | Minutes | [optional] +**s** | **int** | Seconds | [optional] +**total_seconds** | **int** | The total time in seconds | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.md b/docs/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.md new file mode 100644 index 00000000..c780caca --- /dev/null +++ b/docs/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.md @@ -0,0 +1,10 @@ +# # DealNonStrictWithDetailsAllOfStayInPipelineStages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**times_in_stages** | **object** | The number of seconds a deal has been in each stage of the pipeline | [optional] +**order_of_stages** | **int[]** | The order of the deal progression through the pipeline stages | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealOrganizationData.md b/docs/Model/DealOrganizationData.md new file mode 100644 index 00000000..17edf92c --- /dev/null +++ b/docs/Model/DealOrganizationData.md @@ -0,0 +1,14 @@ +# # DealOrganizationData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization associated with the deal | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the deal | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the deal | [optional] +**address** | **string** | The address of the organization that is associated with the deal | [optional] +**active_flag** | **bool** | Whether the associated organization is active or not | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealOrganizationDataWithId.md b/docs/Model/DealOrganizationDataWithId.md new file mode 100644 index 00000000..3d7cdb8a --- /dev/null +++ b/docs/Model/DealOrganizationDataWithId.md @@ -0,0 +1,15 @@ +# # DealOrganizationDataWithId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization associated with the deal | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the deal | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the deal | [optional] +**address** | **string** | The address of the organization that is associated with the deal | [optional] +**active_flag** | **bool** | Whether the associated organization is active or not | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the deal | [optional] +**value** | **int** | The ID of the organization associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealOrganizationDataWithIdAllOf.md b/docs/Model/DealOrganizationDataWithIdAllOf.md new file mode 100644 index 00000000..c5bb4a26 --- /dev/null +++ b/docs/Model/DealOrganizationDataWithIdAllOf.md @@ -0,0 +1,9 @@ +# # DealOrganizationDataWithIdAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the organization associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealParticipantCountInfo.md b/docs/Model/DealParticipantCountInfo.md new file mode 100644 index 00000000..d59695a5 --- /dev/null +++ b/docs/Model/DealParticipantCountInfo.md @@ -0,0 +1,10 @@ +# # DealParticipantCountInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**participant_open_deals_count** | **int** | The count of open participant deals related with the item | [optional] +**participant_closed_deals_count** | **int** | The count of closed participant deals related with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealParticipants.md b/docs/Model/DealParticipants.md new file mode 100644 index 00000000..fb3e7386 --- /dev/null +++ b/docs/Model/DealParticipants.md @@ -0,0 +1,12 @@ +# # DealParticipants + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonItem[]**](PersonItem.md) | The array of participants | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetDealsRelatedObjects**](GetDealsRelatedObjects.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/DealPersonData.md b/docs/Model/DealPersonData.md new file mode 100644 index 00000000..5b0a0469 --- /dev/null +++ b/docs/Model/DealPersonData.md @@ -0,0 +1,13 @@ +# # DealPersonData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the associated person is active or not | [optional] +**name** | **string** | The name of the person associated with the deal | [optional] +**email** | [**\Pipedrive\Model\DealPersonDataEmail[]**](DealPersonDataEmail.md) | The emails of the person associated with the deal | [optional] +**phone** | [**\Pipedrive\Model\DealPersonDataPhone[]**](DealPersonDataPhone.md) | The phone numbers of the person associated with the deal | [optional] +**owner_id** | **int** | The ID of the owner of the person that is associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealPersonDataEmail.md b/docs/Model/DealPersonDataEmail.md new file mode 100644 index 00000000..242ead2c --- /dev/null +++ b/docs/Model/DealPersonDataEmail.md @@ -0,0 +1,11 @@ +# # DealPersonDataEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The type of the email | [optional] +**value** | **string** | The email of the associated person | [optional] +**primary** | **bool** | If this is the primary email 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/DealPersonDataPhone.md b/docs/Model/DealPersonDataPhone.md new file mode 100644 index 00000000..5d138eb9 --- /dev/null +++ b/docs/Model/DealPersonDataPhone.md @@ -0,0 +1,11 @@ +# # DealPersonDataPhone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The type of the phone number | [optional] +**value** | **string** | The phone number of the person associated with the deal | [optional] +**primary** | **bool** | If this is the primary phone number 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/DealPersonDataWithId.md b/docs/Model/DealPersonDataWithId.md new file mode 100644 index 00000000..b2611952 --- /dev/null +++ b/docs/Model/DealPersonDataWithId.md @@ -0,0 +1,14 @@ +# # DealPersonDataWithId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the associated person is active or not | [optional] +**name** | **string** | The name of the person associated with the deal | [optional] +**email** | [**\Pipedrive\Model\DealPersonDataEmail[]**](DealPersonDataEmail.md) | The emails of the person associated with the deal | [optional] +**phone** | [**\Pipedrive\Model\DealPersonDataPhone[]**](DealPersonDataPhone.md) | The phone numbers of the person associated with the deal | [optional] +**owner_id** | **int** | The ID of the owner of the person that is associated with the deal | [optional] +**value** | **int** | The ID of the person associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealPersonDataWithIdAllOf.md b/docs/Model/DealPersonDataWithIdAllOf.md new file mode 100644 index 00000000..d5f9fa8e --- /dev/null +++ b/docs/Model/DealPersonDataWithIdAllOf.md @@ -0,0 +1,9 @@ +# # DealPersonDataWithIdAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the person associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealProductUnitDuration.md b/docs/Model/DealProductUnitDuration.md new file mode 100644 index 00000000..899a0e07 --- /dev/null +++ b/docs/Model/DealProductUnitDuration.md @@ -0,0 +1,8 @@ +# # DealProductUnitDuration + +## 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/DealSearchItem.md b/docs/Model/DealSearchItem.md new file mode 100644 index 00000000..ee81c668 --- /dev/null +++ b/docs/Model/DealSearchItem.md @@ -0,0 +1,10 @@ +# # DealSearchItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result_score** | **float** | Search result relevancy | [optional] +**item** | [**\Pipedrive\Model\DealSearchItemItem**](DealSearchItemItem.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/DealSearchItemItem.md b/docs/Model/DealSearchItemItem.md new file mode 100644 index 00000000..c0e1b06b --- /dev/null +++ b/docs/Model/DealSearchItemItem.md @@ -0,0 +1,21 @@ +# # DealSearchItemItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**type** | **string** | The type of the item | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **int** | The value of the deal | [optional] +**currency** | **string** | The currency of the deal | [optional] +**status** | **string** | The status of the deal | [optional] +**visible_to** | **int** | The visibility of the deal | [optional] +**owner** | [**\Pipedrive\Model\DealSearchItemItemOwner**](DealSearchItemItemOwner.md) | | [optional] +**stage** | [**\Pipedrive\Model\DealSearchItemItemStage**](DealSearchItemItemStage.md) | | [optional] +**person** | [**\Pipedrive\Model\DealSearchItemItemPerson**](DealSearchItemItemPerson.md) | | [optional] +**organization** | [**\Pipedrive\Model\DealSearchItemItemOrganization**](DealSearchItemItemOrganization.md) | | [optional] +**custom_fields** | **string[]** | Custom fields | [optional] +**notes** | **string[]** | An array of notes | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSearchItemItemOrganization.md b/docs/Model/DealSearchItemItemOrganization.md new file mode 100644 index 00000000..45c5f7da --- /dev/null +++ b/docs/Model/DealSearchItemItemOrganization.md @@ -0,0 +1,10 @@ +# # DealSearchItemItemOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization the deal is associated with | [optional] +**name** | **string** | The name of the organization the deal is associated with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSearchItemItemOwner.md b/docs/Model/DealSearchItemItemOwner.md new file mode 100644 index 00000000..0a26de8c --- /dev/null +++ b/docs/Model/DealSearchItemItemOwner.md @@ -0,0 +1,9 @@ +# # DealSearchItemItemOwner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the owner of the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSearchItemItemPerson.md b/docs/Model/DealSearchItemItemPerson.md new file mode 100644 index 00000000..aab1ed8f --- /dev/null +++ b/docs/Model/DealSearchItemItemPerson.md @@ -0,0 +1,10 @@ +# # DealSearchItemItemPerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person the deal is associated with | [optional] +**name** | **string** | The name of the person the deal is associated with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSearchItemItemStage.md b/docs/Model/DealSearchItemItemStage.md new file mode 100644 index 00000000..fb2f9fe2 --- /dev/null +++ b/docs/Model/DealSearchItemItemStage.md @@ -0,0 +1,10 @@ +# # DealSearchItemItemStage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the stage of the deal | [optional] +**name** | **string** | The name of the stage of the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSearchResponse.md b/docs/Model/DealSearchResponse.md new file mode 100644 index 00000000..ae6c34fd --- /dev/null +++ b/docs/Model/DealSearchResponse.md @@ -0,0 +1,11 @@ +# # DealSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealSearchResponseAllOfData**](DealSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/DealSearchResponseAllOf.md b/docs/Model/DealSearchResponseAllOf.md new file mode 100644 index 00000000..0014624a --- /dev/null +++ b/docs/Model/DealSearchResponseAllOf.md @@ -0,0 +1,10 @@ +# # DealSearchResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DealSearchResponseAllOfData**](DealSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/DealSearchResponseAllOfData.md b/docs/Model/DealSearchResponseAllOfData.md new file mode 100644 index 00000000..acefc82c --- /dev/null +++ b/docs/Model/DealSearchResponseAllOfData.md @@ -0,0 +1,9 @@ +# # DealSearchResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\DealSearchItem[]**](DealSearchItem.md) | The array of deals | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealStrict.md b/docs/Model/DealStrict.md new file mode 100644 index 00000000..93ae3b13 --- /dev/null +++ b/docs/Model/DealStrict.md @@ -0,0 +1,65 @@ +# # DealStrict + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | **int** | The ID of the deal creator | [optional] +**user_id** | **int** | The ID of the user | [optional] +**person_id** | **int** | The ID of the person associated with the deal | [optional] +**org_id** | **int** | The ID of the organization associated with the deal | [optional] +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal | [optional] +**update_time** | **string** | The last updated date and time of the deal | [optional] +**stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**active** | **bool** | Whether the deal is active or not | [optional] +**deleted** | **bool** | Whether the deal is deleted or not | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status as won | [optional] +**first_won_time** | **string** | The date and time of the first time changing the deal status as won | [optional] +**lost_time** | **string** | The date and time of changing the deal status as lost | [optional] +**products_count** | **int** | The number of products associated with the deal | [optional] +**files_count** | **int** | The number of files associated with the deal | [optional] +**notes_count** | **int** | The number of notes associated with the deal | [optional] +**followers_count** | **int** | The number of followers associated with the deal | [optional] +**email_messages_count** | **int** | The number of emails associated with the deal | [optional] +**activities_count** | **int** | The number of activities associated with the deal | [optional] +**done_activities_count** | **int** | The number of completed activities associated with the deal | [optional] +**undone_activities_count** | **int** | The number of incomplete activities associated with the deal | [optional] +**participants_count** | **int** | The number of participants associated with the deal | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the deal | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] +**stage_order_nr** | **int** | The order number of the deal stage associated with the deal | [optional] +**person_name** | **string** | The name of the person associated with the deal | [optional] +**org_name** | **string** | The name of the organization associated with the deal | [optional] +**next_activity_subject** | **string** | The subject of the next activity associated with the deal | [optional] +**next_activity_type** | **string** | The type of the next activity associated with the deal | [optional] +**next_activity_duration** | **string** | The duration of the next activity associated with the deal | [optional] +**next_activity_note** | **string** | The note of the next activity associated with the deal | [optional] +**formatted_value** | **string** | The deal value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value** | **float** | Probability times deal value. Probability can either be deal probability or if not set, then stage probability. | [optional] +**formatted_weighted_value** | **string** | The weighted_value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value_currency** | **string** | The currency associated with the deal | [optional] +**rotten_time** | **string** | The date and time of changing the deal status as rotten | [optional] +**owner_name** | **string** | The name of the deal owner | [optional] +**cc_email** | **string** | The BCC email of the deal | [optional] +**org_hidden** | **bool** | If the organization that is associated with the deal is hidden or not | [optional] +**person_hidden** | **bool** | If the person that is associated with the deal is hidden 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/DealStrictModeFields.md b/docs/Model/DealStrictModeFields.md new file mode 100644 index 00000000..b4220757 --- /dev/null +++ b/docs/Model/DealStrictModeFields.md @@ -0,0 +1,13 @@ +# # DealStrictModeFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | **int** | The ID of the deal creator | [optional] +**user_id** | **int** | The ID of the user | [optional] +**person_id** | **int** | The ID of the person associated with the deal | [optional] +**org_id** | **int** | The ID of the organization associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealStrictWithMergeId.md b/docs/Model/DealStrictWithMergeId.md new file mode 100644 index 00000000..04691641 --- /dev/null +++ b/docs/Model/DealStrictWithMergeId.md @@ -0,0 +1,66 @@ +# # DealStrictWithMergeId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**creator_user_id** | **int** | The ID of the deal creator | [optional] +**user_id** | **int** | The ID of the user | [optional] +**person_id** | **int** | The ID of the person associated with the deal | [optional] +**org_id** | **int** | The ID of the organization associated with the deal | [optional] +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal | [optional] +**update_time** | **string** | The last updated date and time of the deal | [optional] +**stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**active** | **bool** | Whether the deal is active or not | [optional] +**deleted** | **bool** | Whether the deal is deleted or not | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status as won | [optional] +**first_won_time** | **string** | The date and time of the first time changing the deal status as won | [optional] +**lost_time** | **string** | The date and time of changing the deal status as lost | [optional] +**products_count** | **int** | The number of products associated with the deal | [optional] +**files_count** | **int** | The number of files associated with the deal | [optional] +**notes_count** | **int** | The number of notes associated with the deal | [optional] +**followers_count** | **int** | The number of followers associated with the deal | [optional] +**email_messages_count** | **int** | The number of emails associated with the deal | [optional] +**activities_count** | **int** | The number of activities associated with the deal | [optional] +**done_activities_count** | **int** | The number of completed activities associated with the deal | [optional] +**undone_activities_count** | **int** | The number of incomplete activities associated with the deal | [optional] +**participants_count** | **int** | The number of participants associated with the deal | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the deal | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] +**stage_order_nr** | **int** | The order number of the deal stage associated with the deal | [optional] +**person_name** | **string** | The name of the person associated with the deal | [optional] +**org_name** | **string** | The name of the organization associated with the deal | [optional] +**next_activity_subject** | **string** | The subject of the next activity associated with the deal | [optional] +**next_activity_type** | **string** | The type of the next activity associated with the deal | [optional] +**next_activity_duration** | **string** | The duration of the next activity associated with the deal | [optional] +**next_activity_note** | **string** | The note of the next activity associated with the deal | [optional] +**formatted_value** | **string** | The deal value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value** | **float** | Probability times deal value. Probability can either be deal probability or if not set, then stage probability. | [optional] +**formatted_weighted_value** | **string** | The weighted_value formatted with selected currency. E.g. US$500 | [optional] +**weighted_value_currency** | **string** | The currency associated with the deal | [optional] +**rotten_time** | **string** | The date and time of changing the deal status as rotten | [optional] +**owner_name** | **string** | The name of the deal owner | [optional] +**cc_email** | **string** | The BCC email of the deal | [optional] +**org_hidden** | **bool** | If the organization that is associated with the deal is hidden or not | [optional] +**person_hidden** | **bool** | If the person that is associated with the deal is hidden or not | [optional] +**merge_what_id** | **int** | The deal ID of the deal which the original deal was merged with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealStrictWithMergeIdAllOf.md b/docs/Model/DealStrictWithMergeIdAllOf.md new file mode 100644 index 00000000..aa7e50bb --- /dev/null +++ b/docs/Model/DealStrictWithMergeIdAllOf.md @@ -0,0 +1,9 @@ +# # DealStrictWithMergeIdAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merge_what_id** | **int** | The deal ID of the deal which the original deal was merged with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSummary.md b/docs/Model/DealSummary.md new file mode 100644 index 00000000..9df3678e --- /dev/null +++ b/docs/Model/DealSummary.md @@ -0,0 +1,12 @@ +# # DealSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**per_stages** | [**\Pipedrive\Model\DealSummaryPerStages**](DealSummaryPerStages.md) | | [optional] +**per_currency** | [**\Pipedrive\Model\DealSummaryPerCurrency**](DealSummaryPerCurrency.md) | | [optional] +**total_count** | **int** | Deals count | [optional] +**per_currency_full** | [**\Pipedrive\Model\DealSummaryPerCurrencyFull**](DealSummaryPerCurrencyFull.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/DealSummaryPerCurrency.md b/docs/Model/DealSummaryPerCurrency.md new file mode 100644 index 00000000..8589fb00 --- /dev/null +++ b/docs/Model/DealSummaryPerCurrency.md @@ -0,0 +1,9 @@ +# # DealSummaryPerCurrency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | **int** | Deals count per currency. This parameter is dynamic and changes according to `currency_id` value. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSummaryPerCurrencyFull.md b/docs/Model/DealSummaryPerCurrencyFull.md new file mode 100644 index 00000000..f5d7c54e --- /dev/null +++ b/docs/Model/DealSummaryPerCurrencyFull.md @@ -0,0 +1,9 @@ +# # DealSummaryPerCurrencyFull + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | [**\Pipedrive\Model\DealSummaryPerCurrencyFullCURRENCYID**](DealSummaryPerCurrencyFullCURRENCYID.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/DealSummaryPerCurrencyFullCURRENCYID.md b/docs/Model/DealSummaryPerCurrencyFullCURRENCYID.md new file mode 100644 index 00000000..b3c50c4c --- /dev/null +++ b/docs/Model/DealSummaryPerCurrencyFullCURRENCYID.md @@ -0,0 +1,10 @@ +# # DealSummaryPerCurrencyFullCURRENCYID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | Deals count per currency | [optional] +**value** | **int** | Deals value per currency | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealSummaryPerStages.md b/docs/Model/DealSummaryPerStages.md new file mode 100644 index 00000000..80f6d3f0 --- /dev/null +++ b/docs/Model/DealSummaryPerStages.md @@ -0,0 +1,9 @@ +# # DealSummaryPerStages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stage_id** | [**\Pipedrive\Model\DealSummaryPerStagesSTAGEID**](DealSummaryPerStagesSTAGEID.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/DealSummaryPerStagesSTAGEID.md b/docs/Model/DealSummaryPerStagesSTAGEID.md new file mode 100644 index 00000000..df87151f --- /dev/null +++ b/docs/Model/DealSummaryPerStagesSTAGEID.md @@ -0,0 +1,9 @@ +# # DealSummaryPerStagesSTAGEID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | [**\Pipedrive\Model\DealSummaryPerStagesSTAGEIDCURRENCYID**](DealSummaryPerStagesSTAGEIDCURRENCYID.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/DealSummaryPerStagesSTAGEIDCURRENCYID.md b/docs/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.md new file mode 100644 index 00000000..ec7f0a3e --- /dev/null +++ b/docs/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.md @@ -0,0 +1,13 @@ +# # DealSummaryPerStagesSTAGEIDCURRENCYID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | Deals count per currency | [optional] +**value** | **int** | Deals value per currency | [optional] +**value_formatted** | **string** | Deals value formatted per currency | [optional] +**weighted_value** | **int** | Deals weighted value per currency | [optional] +**weighted_value_formatted** | **string** | Deals weighted value formatted per currency | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealTitleParameter.md b/docs/Model/DealTitleParameter.md new file mode 100644 index 00000000..7ed00b19 --- /dev/null +++ b/docs/Model/DealTitleParameter.md @@ -0,0 +1,9 @@ +# # DealTitleParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealUserData.md b/docs/Model/DealUserData.md new file mode 100644 index 00000000..8d9db426 --- /dev/null +++ b/docs/Model/DealUserData.md @@ -0,0 +1,14 @@ +# # DealUserData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the user | [optional] +**name** | **string** | The name of the user | [optional] +**email** | **string** | The email of the user | [optional] +**has_pic** | **bool** | If the user has a picture or not | [optional] +**pic_hash** | **string** | The user picture hash | [optional] +**active_flag** | **bool** | Whether the user is active 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/DealUserDataWithId.md b/docs/Model/DealUserDataWithId.md new file mode 100644 index 00000000..8eb68039 --- /dev/null +++ b/docs/Model/DealUserDataWithId.md @@ -0,0 +1,15 @@ +# # DealUserDataWithId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the user | [optional] +**name** | **string** | The name of the user | [optional] +**email** | **string** | The email of the user | [optional] +**has_pic** | **bool** | If the user has a picture or not | [optional] +**pic_hash** | **string** | The user picture hash | [optional] +**active_flag** | **bool** | Whether the user is active or not | [optional] +**value** | **int** | The ID of the user | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealUserDataWithIdAllOf.md b/docs/Model/DealUserDataWithIdAllOf.md new file mode 100644 index 00000000..b9ad3fb3 --- /dev/null +++ b/docs/Model/DealUserDataWithIdAllOf.md @@ -0,0 +1,9 @@ +# # DealUserDataWithIdAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the user | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealsCountAndActivityInfo.md b/docs/Model/DealsCountAndActivityInfo.md new file mode 100644 index 00000000..b9831bb8 --- /dev/null +++ b/docs/Model/DealsCountAndActivityInfo.md @@ -0,0 +1,21 @@ +# # DealsCountAndActivityInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealsCountInfo.md b/docs/Model/DealsCountInfo.md new file mode 100644 index 00000000..9d74ae6c --- /dev/null +++ b/docs/Model/DealsCountInfo.md @@ -0,0 +1,16 @@ +# # DealsCountInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealsMovementsInfo.md b/docs/Model/DealsMovementsInfo.md new file mode 100644 index 00000000..c85e8fbd --- /dev/null +++ b/docs/Model/DealsMovementsInfo.md @@ -0,0 +1,12 @@ +# # DealsMovementsInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The count of the deals | [optional] +**deals_ids** | **int[]** | The IDs of the deals that have been moved | [optional] +**values** | [**\Pipedrive\Model\DealsMovementsInfoValues**](DealsMovementsInfoValues.md) | | [optional] +**formatted_values** | [**\Pipedrive\Model\DealsMovementsInfoFormattedValues**](DealsMovementsInfoFormattedValues.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/DealsMovementsInfoFormattedValues.md b/docs/Model/DealsMovementsInfoFormattedValues.md new file mode 100644 index 00000000..86bdafce --- /dev/null +++ b/docs/Model/DealsMovementsInfoFormattedValues.md @@ -0,0 +1,9 @@ +# # DealsMovementsInfoFormattedValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | **string** | The formatted values of the deals | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DealsMovementsInfoValues.md b/docs/Model/DealsMovementsInfoValues.md new file mode 100644 index 00000000..5b5c2179 --- /dev/null +++ b/docs/Model/DealsMovementsInfoValues.md @@ -0,0 +1,9 @@ +# # DealsMovementsInfoValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | **int** | The value of the deals | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteActivitiesResponse200.md b/docs/Model/DeleteActivitiesResponse200.md new file mode 100644 index 00000000..35c6348b --- /dev/null +++ b/docs/Model/DeleteActivitiesResponse200.md @@ -0,0 +1,10 @@ +# # DeleteActivitiesResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\DeleteActivitiesResponse200Data**](DeleteActivitiesResponse200Data.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/DeleteActivitiesResponse200Data.md b/docs/Model/DeleteActivitiesResponse200Data.md new file mode 100644 index 00000000..3a6b3d12 --- /dev/null +++ b/docs/Model/DeleteActivitiesResponse200Data.md @@ -0,0 +1,9 @@ +# # DeleteActivitiesResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | An array of the IDs of activities that were deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteActivityResponse200.md b/docs/Model/DeleteActivityResponse200.md new file mode 100644 index 00000000..0e066e61 --- /dev/null +++ b/docs/Model/DeleteActivityResponse200.md @@ -0,0 +1,10 @@ +# # DeleteActivityResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\DeleteActivityResponse200Data**](DeleteActivityResponse200Data.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/DeleteActivityResponse200Data.md b/docs/Model/DeleteActivityResponse200Data.md new file mode 100644 index 00000000..a03c5724 --- /dev/null +++ b/docs/Model/DeleteActivityResponse200Data.md @@ -0,0 +1,9 @@ +# # DeleteActivityResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the activity that was deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteChannelSuccess.md b/docs/Model/DeleteChannelSuccess.md new file mode 100644 index 00000000..2b2ab27e --- /dev/null +++ b/docs/Model/DeleteChannelSuccess.md @@ -0,0 +1,9 @@ +# # DeleteChannelSuccess + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **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/DeleteComment.md b/docs/Model/DeleteComment.md new file mode 100644 index 00000000..c7cc9e99 --- /dev/null +++ b/docs/Model/DeleteComment.md @@ -0,0 +1,10 @@ +# # DeleteComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | **bool** | If the response is successful 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/DeleteConversationSuccess.md b/docs/Model/DeleteConversationSuccess.md new file mode 100644 index 00000000..06f9f03d --- /dev/null +++ b/docs/Model/DeleteConversationSuccess.md @@ -0,0 +1,9 @@ +# # DeleteConversationSuccess + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **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/DeleteDeal.md b/docs/Model/DeleteDeal.md new file mode 100644 index 00000000..2b7e35cb --- /dev/null +++ b/docs/Model/DeleteDeal.md @@ -0,0 +1,10 @@ +# # DeleteDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteDealData**](DeleteDealData.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/DeleteDealData.md b/docs/Model/DeleteDealData.md new file mode 100644 index 00000000..f1b768f1 --- /dev/null +++ b/docs/Model/DeleteDealData.md @@ -0,0 +1,9 @@ +# # DeleteDealData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal that was deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteDealFollower.md b/docs/Model/DeleteDealFollower.md new file mode 100644 index 00000000..67935e91 --- /dev/null +++ b/docs/Model/DeleteDealFollower.md @@ -0,0 +1,10 @@ +# # DeleteDealFollower + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteDealFollowerData**](DeleteDealFollowerData.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/DeleteDealFollowerData.md b/docs/Model/DeleteDealFollowerData.md new file mode 100644 index 00000000..2d6a00af --- /dev/null +++ b/docs/Model/DeleteDealFollowerData.md @@ -0,0 +1,9 @@ +# # DeleteDealFollowerData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal follower that was deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteDealParticipant.md b/docs/Model/DeleteDealParticipant.md new file mode 100644 index 00000000..f695c3b3 --- /dev/null +++ b/docs/Model/DeleteDealParticipant.md @@ -0,0 +1,10 @@ +# # DeleteDealParticipant + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteDealParticipantData**](DeleteDealParticipantData.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/DeleteDealParticipantData.md b/docs/Model/DeleteDealParticipantData.md new file mode 100644 index 00000000..f367015d --- /dev/null +++ b/docs/Model/DeleteDealParticipantData.md @@ -0,0 +1,9 @@ +# # DeleteDealParticipantData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal participant that was deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteDealProduct.md b/docs/Model/DeleteDealProduct.md new file mode 100644 index 00000000..3a20d48b --- /dev/null +++ b/docs/Model/DeleteDealProduct.md @@ -0,0 +1,10 @@ +# # DeleteDealProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteDealProductData**](DeleteDealProductData.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/DeleteDealProductData.md b/docs/Model/DeleteDealProductData.md new file mode 100644 index 00000000..6ed7e747 --- /dev/null +++ b/docs/Model/DeleteDealProductData.md @@ -0,0 +1,9 @@ +# # DeleteDealProductData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of an attached product that was deleted from the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteFile.md b/docs/Model/DeleteFile.md new file mode 100644 index 00000000..4af6d200 --- /dev/null +++ b/docs/Model/DeleteFile.md @@ -0,0 +1,10 @@ +# # DeleteFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteFileData**](DeleteFileData.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/DeleteFileData.md b/docs/Model/DeleteFileData.md new file mode 100644 index 00000000..935538c3 --- /dev/null +++ b/docs/Model/DeleteFileData.md @@ -0,0 +1,9 @@ +# # DeleteFileData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of 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/DeleteGoalResponse200.md b/docs/Model/DeleteGoalResponse200.md new file mode 100644 index 00000000..f352212a --- /dev/null +++ b/docs/Model/DeleteGoalResponse200.md @@ -0,0 +1,9 @@ +# # DeleteGoalResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful 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/DeleteMultipleDeals.md b/docs/Model/DeleteMultipleDeals.md new file mode 100644 index 00000000..4e6eb455 --- /dev/null +++ b/docs/Model/DeleteMultipleDeals.md @@ -0,0 +1,10 @@ +# # DeleteMultipleDeals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteMultipleDealsData**](DeleteMultipleDealsData.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/DeleteMultipleDealsData.md b/docs/Model/DeleteMultipleDealsData.md new file mode 100644 index 00000000..82621f66 --- /dev/null +++ b/docs/Model/DeleteMultipleDealsData.md @@ -0,0 +1,9 @@ +# # DeleteMultipleDealsData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The list of deleted deals IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteMultipleProductFieldsResponse.md b/docs/Model/DeleteMultipleProductFieldsResponse.md new file mode 100644 index 00000000..0db26505 --- /dev/null +++ b/docs/Model/DeleteMultipleProductFieldsResponse.md @@ -0,0 +1,10 @@ +# # DeleteMultipleProductFieldsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteMultipleProductFieldsResponseData**](DeleteMultipleProductFieldsResponseData.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/DeleteMultipleProductFieldsResponseData.md b/docs/Model/DeleteMultipleProductFieldsResponseData.md new file mode 100644 index 00000000..bb1ecda8 --- /dev/null +++ b/docs/Model/DeleteMultipleProductFieldsResponseData.md @@ -0,0 +1,9 @@ +# # DeleteMultipleProductFieldsResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | Array of all the IDs of the deleted product fields | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteNote.md b/docs/Model/DeleteNote.md new file mode 100644 index 00000000..db5f720d --- /dev/null +++ b/docs/Model/DeleteNote.md @@ -0,0 +1,10 @@ +# # DeleteNote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | **bool** | If the response is successful 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/DeletePersonResponse.md b/docs/Model/DeletePersonResponse.md new file mode 100644 index 00000000..c54632cb --- /dev/null +++ b/docs/Model/DeletePersonResponse.md @@ -0,0 +1,10 @@ +# # DeletePersonResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeletePersonResponseAllOfData**](DeletePersonResponseAllOfData.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/DeletePersonResponseAllOf.md b/docs/Model/DeletePersonResponseAllOf.md new file mode 100644 index 00000000..b0c5fc1a --- /dev/null +++ b/docs/Model/DeletePersonResponseAllOf.md @@ -0,0 +1,9 @@ +# # DeletePersonResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DeletePersonResponseAllOfData**](DeletePersonResponseAllOfData.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/DeletePersonResponseAllOfData.md b/docs/Model/DeletePersonResponseAllOfData.md new file mode 100644 index 00000000..7e031aa3 --- /dev/null +++ b/docs/Model/DeletePersonResponseAllOfData.md @@ -0,0 +1,9 @@ +# # DeletePersonResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deleted person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeletePersonsInBulkResponse.md b/docs/Model/DeletePersonsInBulkResponse.md new file mode 100644 index 00000000..39f25f3b --- /dev/null +++ b/docs/Model/DeletePersonsInBulkResponse.md @@ -0,0 +1,10 @@ +# # DeletePersonsInBulkResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeletePersonsInBulkResponseAllOfData**](DeletePersonsInBulkResponseAllOfData.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/DeletePersonsInBulkResponseAllOf.md b/docs/Model/DeletePersonsInBulkResponseAllOf.md new file mode 100644 index 00000000..f9c78923 --- /dev/null +++ b/docs/Model/DeletePersonsInBulkResponseAllOf.md @@ -0,0 +1,9 @@ +# # DeletePersonsInBulkResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DeletePersonsInBulkResponseAllOfData**](DeletePersonsInBulkResponseAllOfData.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/DeletePersonsInBulkResponseAllOfData.md b/docs/Model/DeletePersonsInBulkResponseAllOfData.md new file mode 100644 index 00000000..8381112b --- /dev/null +++ b/docs/Model/DeletePersonsInBulkResponseAllOfData.md @@ -0,0 +1,9 @@ +# # DeletePersonsInBulkResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The list of deleted persons IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeletePipelineResponse200.md b/docs/Model/DeletePipelineResponse200.md new file mode 100644 index 00000000..0bbca86c --- /dev/null +++ b/docs/Model/DeletePipelineResponse200.md @@ -0,0 +1,10 @@ +# # DeletePipelineResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeletePipelineResponse200Data**](DeletePipelineResponse200Data.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/DeletePipelineResponse200Data.md b/docs/Model/DeletePipelineResponse200Data.md new file mode 100644 index 00000000..78fa6625 --- /dev/null +++ b/docs/Model/DeletePipelineResponse200Data.md @@ -0,0 +1,9 @@ +# # DeletePipelineResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Deleted Pipeline 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/DeleteProductFieldResponse.md b/docs/Model/DeleteProductFieldResponse.md new file mode 100644 index 00000000..362bc2c7 --- /dev/null +++ b/docs/Model/DeleteProductFieldResponse.md @@ -0,0 +1,10 @@ +# # DeleteProductFieldResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteProductFieldResponseData**](DeleteProductFieldResponseData.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/DeleteProductFieldResponseData.md b/docs/Model/DeleteProductFieldResponseData.md new file mode 100644 index 00000000..58091b27 --- /dev/null +++ b/docs/Model/DeleteProductFieldResponseData.md @@ -0,0 +1,9 @@ +# # DeleteProductFieldResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deleted product field | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteProductFollowerResponse.md b/docs/Model/DeleteProductFollowerResponse.md new file mode 100644 index 00000000..d676521a --- /dev/null +++ b/docs/Model/DeleteProductFollowerResponse.md @@ -0,0 +1,10 @@ +# # DeleteProductFollowerResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteProductFollowerResponseData**](DeleteProductFollowerResponseData.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/DeleteProductFollowerResponseData.md b/docs/Model/DeleteProductFollowerResponseData.md new file mode 100644 index 00000000..33b30cd6 --- /dev/null +++ b/docs/Model/DeleteProductFollowerResponseData.md @@ -0,0 +1,9 @@ +# # DeleteProductFollowerResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the removed follower | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteProductResponse.md b/docs/Model/DeleteProductResponse.md new file mode 100644 index 00000000..5364472e --- /dev/null +++ b/docs/Model/DeleteProductResponse.md @@ -0,0 +1,10 @@ +# # DeleteProductResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteProductResponseData**](DeleteProductResponseData.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/DeleteProductResponseData.md b/docs/Model/DeleteProductResponseData.md new file mode 100644 index 00000000..21804ac2 --- /dev/null +++ b/docs/Model/DeleteProductResponseData.md @@ -0,0 +1,9 @@ +# # DeleteProductResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the removed product | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteResponse.md b/docs/Model/DeleteResponse.md new file mode 100644 index 00000000..f5ca4436 --- /dev/null +++ b/docs/Model/DeleteResponse.md @@ -0,0 +1,10 @@ +# # DeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteResponseAllOfData**](DeleteResponseAllOfData.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/DeleteResponseAllOf.md b/docs/Model/DeleteResponseAllOf.md new file mode 100644 index 00000000..c96adfb2 --- /dev/null +++ b/docs/Model/DeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # DeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DeleteResponseAllOfData**](DeleteResponseAllOfData.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/DeleteResponseAllOfData.md b/docs/Model/DeleteResponseAllOfData.md new file mode 100644 index 00000000..ea0fc78f --- /dev/null +++ b/docs/Model/DeleteResponseAllOfData.md @@ -0,0 +1,9 @@ +# # DeleteResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the field that was deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteRole.md b/docs/Model/DeleteRole.md new file mode 100644 index 00000000..e1eae983 --- /dev/null +++ b/docs/Model/DeleteRole.md @@ -0,0 +1,10 @@ +# # DeleteRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteRoleAllOfData**](DeleteRoleAllOfData.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/DeleteRoleAllOf.md b/docs/Model/DeleteRoleAllOf.md new file mode 100644 index 00000000..185c45f0 --- /dev/null +++ b/docs/Model/DeleteRoleAllOf.md @@ -0,0 +1,9 @@ +# # DeleteRoleAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DeleteRoleAllOfData**](DeleteRoleAllOfData.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/DeleteRoleAllOfData.md b/docs/Model/DeleteRoleAllOfData.md new file mode 100644 index 00000000..d0dda5c3 --- /dev/null +++ b/docs/Model/DeleteRoleAllOfData.md @@ -0,0 +1,9 @@ +# # DeleteRoleAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deleted 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/DeleteRoleAssignment.md b/docs/Model/DeleteRoleAssignment.md new file mode 100644 index 00000000..83a2312a --- /dev/null +++ b/docs/Model/DeleteRoleAssignment.md @@ -0,0 +1,10 @@ +# # DeleteRoleAssignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteRoleAssignmentAllOfData**](DeleteRoleAssignmentAllOfData.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/DeleteRoleAssignmentAllOf.md b/docs/Model/DeleteRoleAssignmentAllOf.md new file mode 100644 index 00000000..7b8e3609 --- /dev/null +++ b/docs/Model/DeleteRoleAssignmentAllOf.md @@ -0,0 +1,9 @@ +# # DeleteRoleAssignmentAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DeleteRoleAssignmentAllOfData**](DeleteRoleAssignmentAllOfData.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/DeleteRoleAssignmentAllOfData.md b/docs/Model/DeleteRoleAssignmentAllOfData.md new file mode 100644 index 00000000..841691ee --- /dev/null +++ b/docs/Model/DeleteRoleAssignmentAllOfData.md @@ -0,0 +1,9 @@ +# # DeleteRoleAssignmentAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the role the user was removed from | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteRoleAssignmentRequest.md b/docs/Model/DeleteRoleAssignmentRequest.md new file mode 100644 index 00000000..ff00c432 --- /dev/null +++ b/docs/Model/DeleteRoleAssignmentRequest.md @@ -0,0 +1,9 @@ +# # DeleteRoleAssignmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteStageResponse200.md b/docs/Model/DeleteStageResponse200.md new file mode 100644 index 00000000..d9ec193b --- /dev/null +++ b/docs/Model/DeleteStageResponse200.md @@ -0,0 +1,10 @@ +# # DeleteStageResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteStageResponse200Data**](DeleteStageResponse200Data.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/DeleteStageResponse200Data.md b/docs/Model/DeleteStageResponse200Data.md new file mode 100644 index 00000000..cd41b717 --- /dev/null +++ b/docs/Model/DeleteStageResponse200Data.md @@ -0,0 +1,9 @@ +# # DeleteStageResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Deleted stage 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/DeleteStagesResponse200.md b/docs/Model/DeleteStagesResponse200.md new file mode 100644 index 00000000..3de3d144 --- /dev/null +++ b/docs/Model/DeleteStagesResponse200.md @@ -0,0 +1,10 @@ +# # DeleteStagesResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DeleteStagesResponse200Data**](DeleteStagesResponse200Data.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/DeleteStagesResponse200Data.md b/docs/Model/DeleteStagesResponse200Data.md new file mode 100644 index 00000000..cef4fe9c --- /dev/null +++ b/docs/Model/DeleteStagesResponse200Data.md @@ -0,0 +1,9 @@ +# # DeleteStagesResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The list of deleted stage IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteTeamUserRequest.md b/docs/Model/DeleteTeamUserRequest.md new file mode 100644 index 00000000..4cac2cf6 --- /dev/null +++ b/docs/Model/DeleteTeamUserRequest.md @@ -0,0 +1,9 @@ +# # DeleteTeamUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | **int[]** | The list of user IDs | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Duration.md b/docs/Model/Duration.md new file mode 100644 index 00000000..b931eb4a --- /dev/null +++ b/docs/Model/Duration.md @@ -0,0 +1,10 @@ +# # Duration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **string** | The start date of the goal | [optional] +**end** | **string** | The end date of the goal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EditPipeline.md b/docs/Model/EditPipeline.md new file mode 100644 index 00000000..344ac182 --- /dev/null +++ b/docs/Model/EditPipeline.md @@ -0,0 +1,10 @@ +# # EditPipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**BasePipelineWithSelectedFlag**](BasePipelineWithSelectedFlag.md) | The pipeline object | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EditPipelineAllOf.md b/docs/Model/EditPipelineAllOf.md new file mode 100644 index 00000000..810dd518 --- /dev/null +++ b/docs/Model/EditPipelineAllOf.md @@ -0,0 +1,9 @@ +# # EditPipelineAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**BasePipelineWithSelectedFlag**](BasePipelineWithSelectedFlag.md) | The pipeline object | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmailInfo.md b/docs/Model/EmailInfo.md new file mode 100644 index 00000000..14c421b8 --- /dev/null +++ b/docs/Model/EmailInfo.md @@ -0,0 +1,10 @@ +# # EmailInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExpectedOutcome.md b/docs/Model/ExpectedOutcome.md new file mode 100644 index 00000000..27ae004c --- /dev/null +++ b/docs/Model/ExpectedOutcome.md @@ -0,0 +1,10 @@ +# # ExpectedOutcome + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target** | **int** | The numeric target of the goal | [optional] +**tracking_metric** | **string** | The tracking metric of the goal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FailResponse.md b/docs/Model/FailResponse.md new file mode 100644 index 00000000..bbd407ea --- /dev/null +++ b/docs/Model/FailResponse.md @@ -0,0 +1,10 @@ +# # FailResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**error** | **string** | The error message | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Field.md b/docs/Model/Field.md new file mode 100644 index 00000000..288781e0 --- /dev/null +++ b/docs/Model/Field.md @@ -0,0 +1,31 @@ +# # Field + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the field. Value is `null` in case of subfields. | [optional] +**key** | **string** | The key of the field. For custom fields this is generated upon creation. | [optional] +**name** | **string** | The name of the field | [optional] +**order_nr** | **int** | The order number of the field | [optional] +**field_type** | [**FieldTypeAsString**](FieldTypeAsString.md) | | [optional] +**add_time** | **string** | The creation time of the field | [optional] +**update_time** | **string** | The update time of the field | [optional] +**last_updated_by_user_id** | **int** | The ID of the user who created or most recently updated the field, only applicable for custom fields | [optional] +**active_flag** | **bool** | The active flag of the field | [optional] +**edit_flag** | **bool** | The edit flag of the field | [optional] +**index_visible_flag** | **bool** | Not used | [optional] +**details_visible_flag** | **bool** | Not used | [optional] +**add_visible_flag** | **bool** | Not used | [optional] +**important_flag** | **bool** | Not used | [optional] +**bulk_edit_allowed** | **bool** | Whether or not the field of an item can be edited in bulk | [optional] +**searchable_flag** | **bool** | Whether or not items can be searched by this field | [optional] +**filtering_allowed** | **bool** | Whether or not items can be filtered by this field | [optional] +**sortable_flag** | **bool** | Whether or not items can be sorted by this field | [optional] +**mandatory_flag** | **bool** | Whether or not the field is mandatory | [optional] +**options** | **object[]** | The options of the field. When there are no options, `null` is returned. | [optional] +**options_deleted** | **object[]** | The deleted options of the field. Only present when there is at least 1 deleted option. | [optional] +**is_subfield** | **bool** | Whether or not the field is a subfield of another field. Only present if field is subfield. | [optional] +**subfields** | **object[]** | The subfields of the field. Only present when the field has subfields. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FieldCreateRequest.md b/docs/Model/FieldCreateRequest.md new file mode 100644 index 00000000..140ee1a1 --- /dev/null +++ b/docs/Model/FieldCreateRequest.md @@ -0,0 +1,12 @@ +# # FieldCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the field | +**options** | **string** | When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{\"label\":\"New Item\"}]` | [optional] +**add_visible_flag** | **bool** | Whether the field is available in the 'add new' modal or not (both in the web and mobile app) | [optional] [default to true] +**field_type** | [**\Pipedrive\Model\FieldTypeAsString**](FieldTypeAsString.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FieldCreateRequestAllOf.md b/docs/Model/FieldCreateRequestAllOf.md new file mode 100644 index 00000000..200e9be0 --- /dev/null +++ b/docs/Model/FieldCreateRequestAllOf.md @@ -0,0 +1,11 @@ +# # FieldCreateRequestAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the field | +**options** | **string** | When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{\"label\":\"New Item\"}]` | [optional] +**add_visible_flag** | **bool** | Whether the field is available in the 'add new' modal or not (both in the web and mobile app) | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FieldResponse.md b/docs/Model/FieldResponse.md new file mode 100644 index 00000000..43b42a60 --- /dev/null +++ b/docs/Model/FieldResponse.md @@ -0,0 +1,10 @@ +# # FieldResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\Field**](Field.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/FieldResponseAllOf.md b/docs/Model/FieldResponseAllOf.md new file mode 100644 index 00000000..0ac6c60a --- /dev/null +++ b/docs/Model/FieldResponseAllOf.md @@ -0,0 +1,9 @@ +# # FieldResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\Field**](Field.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/FieldType.md b/docs/Model/FieldType.md new file mode 100644 index 00000000..62a04fe8 --- /dev/null +++ b/docs/Model/FieldType.md @@ -0,0 +1,9 @@ +# # FieldType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_type** | [**\Pipedrive\Model\FieldTypeAsString**](FieldTypeAsString.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FieldTypeAsString.md b/docs/Model/FieldTypeAsString.md new file mode 100644 index 00000000..43f7767e --- /dev/null +++ b/docs/Model/FieldTypeAsString.md @@ -0,0 +1,8 @@ +# # FieldTypeAsString + +## 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/FieldUpdateRequest.md b/docs/Model/FieldUpdateRequest.md new file mode 100644 index 00000000..02032e9e --- /dev/null +++ b/docs/Model/FieldUpdateRequest.md @@ -0,0 +1,11 @@ +# # FieldUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the field | [optional] +**options** | **string** | When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: `[{\"id\":123,\"label\":\"Existing Item\"},{\"label\":\"New Item\"}]` | [optional] +**add_visible_flag** | **bool** | Whether the field is available in 'add new' modal or not (both in web and mobile app) | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FieldsResponse.md b/docs/Model/FieldsResponse.md new file mode 100644 index 00000000..fe7127ae --- /dev/null +++ b/docs/Model/FieldsResponse.md @@ -0,0 +1,11 @@ +# # FieldsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\Field[]**](Field.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/FieldsResponseAllOf.md b/docs/Model/FieldsResponseAllOf.md new file mode 100644 index 00000000..b0230938 --- /dev/null +++ b/docs/Model/FieldsResponseAllOf.md @@ -0,0 +1,10 @@ +# # FieldsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\Field[]**](Field.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/FileData.md b/docs/Model/FileData.md new file mode 100644 index 00000000..b9ea8339 --- /dev/null +++ b/docs/Model/FileData.md @@ -0,0 +1,36 @@ +# # FileData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the file | [optional] +**user_id** | **int** | The ID of the user to associate the file with | [optional] +**deal_id** | **int** | The ID of the deal to associate the file with | [optional] +**person_id** | **int** | The ID of the person to associate the file with | [optional] +**org_id** | **int** | The ID of the organization to associate the file with | [optional] +**product_id** | **int** | The ID of the product to associate the file with | [optional] +**activity_id** | **int** | The ID of the activity to associate the file with | [optional] +**lead_id** | **string** | The ID of the lead to associate the file with | [optional] +**add_time** | **string** | The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS | [optional] +**file_name** | **string** | The original name of the file | [optional] +**file_size** | **int** | The size of the file | [optional] +**active_flag** | **bool** | Whether the user is active or not. false = Not activated, true = Activated | [optional] +**inline_flag** | **bool** | Whether the file was uploaded as inline or not | [optional] +**remote_location** | **string** | The location type to send the file to. Only googledrive is supported at the moment. | [optional] +**remote_id** | **string** | The ID of the remote item | [optional] +**cid** | **string** | The ID of the inline attachment | [optional] +**s3_bucket** | **string** | The location of the cloud storage | [optional] +**mail_message_id** | **string** | The ID of the mail message to associate the file with | [optional] +**mail_template_id** | **string** | The ID of the mail template to associate the file with | [optional] +**deal_name** | **string** | The name of the deal associated with the file | [optional] +**person_name** | **string** | The name of the person associated with the file | [optional] +**org_name** | **string** | The name of the organization associated with the file | [optional] +**product_name** | **string** | The name of the product associated with the file | [optional] +**lead_name** | **string** | The name of the lead associated with the file | [optional] +**url** | **string** | The URL of the download file | [optional] +**name** | **string** | The visible name of the file | [optional] +**description** | **string** | The description of 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/FileItem.md b/docs/Model/FileItem.md new file mode 100644 index 00000000..9189b50f --- /dev/null +++ b/docs/Model/FileItem.md @@ -0,0 +1,36 @@ +# # FileItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the file | [optional] +**user_id** | **int** | The ID of the user to associate the file with | [optional] +**deal_id** | **int** | The ID of the deal to associate the file with | [optional] +**person_id** | **int** | The ID of the person to associate the file with | [optional] +**org_id** | **int** | The ID of the organization to associate the file with | [optional] +**product_id** | **int** | The ID of the product to associate the file with | [optional] +**activity_id** | **int** | The ID of the activity to associate the file with | [optional] +**lead_id** | **string** | The ID of the lead to associate the file with | [optional] +**add_time** | **string** | The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS | [optional] +**file_name** | **string** | The original name of the file | [optional] +**file_size** | **int** | The size of the file | [optional] +**active_flag** | **bool** | Whether the user is active or not. false = Not activated, true = Activated | [optional] +**inline_flag** | **bool** | Whether the file was uploaded as inline or not | [optional] +**remote_location** | **string** | The location type to send the file to. Only googledrive is supported at the moment. | [optional] +**remote_id** | **string** | The ID of the remote item | [optional] +**cid** | **string** | The ID of the inline attachment | [optional] +**s3_bucket** | **string** | The location of the cloud storage | [optional] +**mail_message_id** | **string** | The ID of the mail message to associate the file with | [optional] +**mail_template_id** | **string** | The ID of the mail template to associate the file with | [optional] +**deal_name** | **string** | The name of the deal associated with the dile | [optional] +**person_name** | **string** | The name of the person associated with the file | [optional] +**org_name** | **string** | The name of the organization associated with the file | [optional] +**product_name** | **string** | The name of the product associated with the file | [optional] +**lead_name** | **string** | The name of the lead associated with the file | [optional] +**url** | **string** | The URL of the download file | [optional] +**name** | **string** | The visible name of the file | [optional] +**description** | **string** | The description of 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/FilterGetItem.md b/docs/Model/FilterGetItem.md new file mode 100644 index 00000000..ee91824e --- /dev/null +++ b/docs/Model/FilterGetItem.md @@ -0,0 +1,17 @@ +# # FilterGetItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the filter | [optional] +**name** | **string** | The name of the filter | [optional] +**active_flag** | **bool** | The active flag of the filter | [optional] +**type** | **string** | The type of the item | [optional] +**user_id** | **int** | The owner of the filter | [optional] +**add_time** | **string** | The date and time when the filter was added | [optional] +**update_time** | **string** | The date and time when the filter was updated | [optional] +**visible_to** | **int** | The visibility group ID of who can see then filter | [optional] +**custom_view_id** | **int** | Used by Pipedrive webapp | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilterType.md b/docs/Model/FilterType.md new file mode 100644 index 00000000..77b79c52 --- /dev/null +++ b/docs/Model/FilterType.md @@ -0,0 +1,8 @@ +# # FilterType + +## 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/FiltersBulkDeleteResponse.md b/docs/Model/FiltersBulkDeleteResponse.md new file mode 100644 index 00000000..6fb09fd5 --- /dev/null +++ b/docs/Model/FiltersBulkDeleteResponse.md @@ -0,0 +1,10 @@ +# # FiltersBulkDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FiltersBulkDeleteResponseAllOfData**](FiltersBulkDeleteResponseAllOfData.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/FiltersBulkDeleteResponseAllOf.md b/docs/Model/FiltersBulkDeleteResponseAllOf.md new file mode 100644 index 00000000..5a2c717a --- /dev/null +++ b/docs/Model/FiltersBulkDeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # FiltersBulkDeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FiltersBulkDeleteResponseAllOfData**](FiltersBulkDeleteResponseAllOfData.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/FiltersBulkDeleteResponseAllOfData.md b/docs/Model/FiltersBulkDeleteResponseAllOfData.md new file mode 100644 index 00000000..97eaeccb --- /dev/null +++ b/docs/Model/FiltersBulkDeleteResponseAllOfData.md @@ -0,0 +1,9 @@ +# # FiltersBulkDeleteResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The array of the IDs of the deleted filter | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FiltersBulkGetResponse.md b/docs/Model/FiltersBulkGetResponse.md new file mode 100644 index 00000000..831b6dd0 --- /dev/null +++ b/docs/Model/FiltersBulkGetResponse.md @@ -0,0 +1,10 @@ +# # FiltersBulkGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FilterGetItem[]**](FilterGetItem.md) | The array of filters | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FiltersBulkGetResponseAllOf.md b/docs/Model/FiltersBulkGetResponseAllOf.md new file mode 100644 index 00000000..1ea1fa0a --- /dev/null +++ b/docs/Model/FiltersBulkGetResponseAllOf.md @@ -0,0 +1,9 @@ +# # FiltersBulkGetResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FilterGetItem[]**](FilterGetItem.md) | The array of filters | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FiltersDeleteResponse.md b/docs/Model/FiltersDeleteResponse.md new file mode 100644 index 00000000..1d0dbcca --- /dev/null +++ b/docs/Model/FiltersDeleteResponse.md @@ -0,0 +1,10 @@ +# # FiltersDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FiltersDeleteResponseAllOfData**](FiltersDeleteResponseAllOfData.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/FiltersDeleteResponseAllOf.md b/docs/Model/FiltersDeleteResponseAllOf.md new file mode 100644 index 00000000..a0407f92 --- /dev/null +++ b/docs/Model/FiltersDeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # FiltersDeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FiltersDeleteResponseAllOfData**](FiltersDeleteResponseAllOfData.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/FiltersDeleteResponseAllOfData.md b/docs/Model/FiltersDeleteResponseAllOfData.md new file mode 100644 index 00000000..7bb4bf09 --- /dev/null +++ b/docs/Model/FiltersDeleteResponseAllOfData.md @@ -0,0 +1,9 @@ +# # FiltersDeleteResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deleted filter | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FiltersGetResponse.md b/docs/Model/FiltersGetResponse.md new file mode 100644 index 00000000..0df2dd50 --- /dev/null +++ b/docs/Model/FiltersGetResponse.md @@ -0,0 +1,10 @@ +# # FiltersGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FilterGetItem**](FilterGetItem.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/FiltersGetResponseAllOf.md b/docs/Model/FiltersGetResponseAllOf.md new file mode 100644 index 00000000..7f017d85 --- /dev/null +++ b/docs/Model/FiltersGetResponseAllOf.md @@ -0,0 +1,9 @@ +# # FiltersGetResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FilterGetItem**](FilterGetItem.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/FiltersPostResponse.md b/docs/Model/FiltersPostResponse.md new file mode 100644 index 00000000..a6cb6e7e --- /dev/null +++ b/docs/Model/FiltersPostResponse.md @@ -0,0 +1,10 @@ +# # FiltersPostResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FiltersPostResponseAllOfData**](FiltersPostResponseAllOfData.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/FiltersPostResponseAllOf.md b/docs/Model/FiltersPostResponseAllOf.md new file mode 100644 index 00000000..041ce167 --- /dev/null +++ b/docs/Model/FiltersPostResponseAllOf.md @@ -0,0 +1,9 @@ +# # FiltersPostResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FiltersPostResponseAllOfData**](FiltersPostResponseAllOfData.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/FiltersPostResponseAllOfData.md b/docs/Model/FiltersPostResponseAllOfData.md new file mode 100644 index 00000000..02b6f90e --- /dev/null +++ b/docs/Model/FiltersPostResponseAllOfData.md @@ -0,0 +1,19 @@ +# # FiltersPostResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the created filter | [optional] +**name** | **string** | The name of the created filter | [optional] +**active_flag** | **bool** | The activity flag of the created filter | [optional] +**type** | [**\Pipedrive\Model\FilterType**](FilterType.md) | | [optional] +**temporary_flag** | **bool** | If the created filter is temporary or not | [optional] +**user_id** | **int** | The user ID of the created filter | [optional] +**add_time** | **string** | The add time of the created filter | [optional] +**update_time** | **string** | The update time of the created filter | [optional] +**visible_to** | **int** | The visibility group ID of the created filter | [optional] +**custom_view_id** | **int** | The custom view ID of the created filter | [optional] +**conditions** | **object** | The created filter conditions object | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FindGoalResponse.md b/docs/Model/FindGoalResponse.md new file mode 100644 index 00000000..0e89ea5d --- /dev/null +++ b/docs/Model/FindGoalResponse.md @@ -0,0 +1,9 @@ +# # FindGoalResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**goals** | [**\Pipedrive\Model\GoalsResponseComponent[]**](GoalsResponseComponent.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/FollowerData.md b/docs/Model/FollowerData.md new file mode 100644 index 00000000..e333dc88 --- /dev/null +++ b/docs/Model/FollowerData.md @@ -0,0 +1,12 @@ +# # FollowerData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the follower | [optional] +**email** | **string** | The email of the follower | [optional] +**user_id** | **int** | The user ID of the follower | [optional] +**pic_hash** | **string** | The follower picture hash | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FollowerDataWithID.md b/docs/Model/FollowerDataWithID.md new file mode 100644 index 00000000..20303569 --- /dev/null +++ b/docs/Model/FollowerDataWithID.md @@ -0,0 +1,13 @@ +# # FollowerDataWithID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the follower associated with the item | [optional] +**name** | **string** | The name of the follower | [optional] +**email** | **string** | The email of the follower | [optional] +**user_id** | **int** | The user ID of the follower | [optional] +**pic_hash** | **string** | The follower picture hash | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FollowerDataWithIDAllOf.md b/docs/Model/FollowerDataWithIDAllOf.md new file mode 100644 index 00000000..795dec05 --- /dev/null +++ b/docs/Model/FollowerDataWithIDAllOf.md @@ -0,0 +1,9 @@ +# # FollowerDataWithIDAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the follower associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullRole.md b/docs/Model/FullRole.md new file mode 100644 index 00000000..ee88b2d1 --- /dev/null +++ b/docs/Model/FullRole.md @@ -0,0 +1,15 @@ +# # FullRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_role_id** | **int** | The ID of the parent role | [optional] +**name** | **string** | The name of the role | [optional] +**id** | **int** | The ID of the role | [optional] +**active_flag** | **bool** | Whether the role is active or not | [optional] +**assignment_count** | **string** | The number of users assigned to this role | [optional] +**sub_role_count** | **string** | The number of sub-roles | [optional] +**level** | **int** | The level of role in the role hierarchy | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullRoleAllOf.md b/docs/Model/FullRoleAllOf.md new file mode 100644 index 00000000..e975f017 --- /dev/null +++ b/docs/Model/FullRoleAllOf.md @@ -0,0 +1,9 @@ +# # FullRoleAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**level** | **int** | The level of role in the role hierarchy | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetActivitiesCollectionResponse200.md b/docs/Model/GetActivitiesCollectionResponse200.md new file mode 100644 index 00000000..bc26069b --- /dev/null +++ b/docs/Model/GetActivitiesCollectionResponse200.md @@ -0,0 +1,11 @@ +# # GetActivitiesCollectionResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\ActivityCollectionResponseObject[]**](ActivityCollectionResponseObject.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithCursorPagination**](AdditionalDataWithCursorPagination.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/GetActivitiesResponse200.md b/docs/Model/GetActivitiesResponse200.md new file mode 100644 index 00000000..29752254 --- /dev/null +++ b/docs/Model/GetActivitiesResponse200.md @@ -0,0 +1,12 @@ +# # GetActivitiesResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject[]**](ActivityResponseObject.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetActivitiesResponse200RelatedObjects**](GetActivitiesResponse200RelatedObjects.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/GetActivitiesResponse200RelatedObjects.md b/docs/Model/GetActivitiesResponse200RelatedObjects.md new file mode 100644 index 00000000..b3ce5f6d --- /dev/null +++ b/docs/Model/GetActivitiesResponse200RelatedObjects.md @@ -0,0 +1,12 @@ +# # GetActivitiesResponse200RelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.md) | | [optional] +**deal** | [**\Pipedrive\Model\RelatedDealData**](RelatedDealData.md) | | [optional] +**person** | [**\Pipedrive\Model\RelatedPersonData**](RelatedPersonData.md) | | [optional] +**organization** | [**\Pipedrive\Model\RelatedOrganizationData**](RelatedOrganizationData.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/GetActivityResponse200.md b/docs/Model/GetActivityResponse200.md new file mode 100644 index 00000000..38232e65 --- /dev/null +++ b/docs/Model/GetActivityResponse200.md @@ -0,0 +1,11 @@ +# # GetActivityResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject**](ActivityResponseObject.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetActivitiesResponse200RelatedObjects**](GetActivitiesResponse200RelatedObjects.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/GetAddProductAttachementDetails.md b/docs/Model/GetAddProductAttachementDetails.md new file mode 100644 index 00000000..15fde94c --- /dev/null +++ b/docs/Model/GetAddProductAttachementDetails.md @@ -0,0 +1,10 @@ +# # GetAddProductAttachementDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**AddProductAttachmentDetails**](AddProductAttachmentDetails.md) | The added product object attached to the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAddUpdateStage.md b/docs/Model/GetAddUpdateStage.md new file mode 100644 index 00000000..52e1d4fb --- /dev/null +++ b/docs/Model/GetAddUpdateStage.md @@ -0,0 +1,10 @@ +# # GetAddUpdateStage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseStage**](.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/GetAddedDeal.md b/docs/Model/GetAddedDeal.md new file mode 100644 index 00000000..afdeff83 --- /dev/null +++ b/docs/Model/GetAddedDeal.md @@ -0,0 +1,11 @@ +# # GetAddedDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealNonStrict**](DealNonStrict.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetDealsRelatedObjects**](GetDealsRelatedObjects.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/GetAllFiles.md b/docs/Model/GetAllFiles.md new file mode 100644 index 00000000..ca388baa --- /dev/null +++ b/docs/Model/GetAllFiles.md @@ -0,0 +1,11 @@ +# # GetAllFiles + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FileData[]**](FileData.md) | The array of all uploaded files | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithPaginationDetails**](AdditionalDataWithPaginationDetails.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/GetAllPersonsResponse.md b/docs/Model/GetAllPersonsResponse.md new file mode 100644 index 00000000..4ebf4d79 --- /dev/null +++ b/docs/Model/GetAllPersonsResponse.md @@ -0,0 +1,12 @@ +# # GetAllPersonsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonItem[]**](PersonItem.md) | The array of persons | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/GetAllPersonsResponseAllOf.md b/docs/Model/GetAllPersonsResponseAllOf.md new file mode 100644 index 00000000..a173be04 --- /dev/null +++ b/docs/Model/GetAllPersonsResponseAllOf.md @@ -0,0 +1,11 @@ +# # GetAllPersonsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PersonItem[]**](PersonItem.md) | The array of persons | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/GetAllPipelines.md b/docs/Model/GetAllPipelines.md new file mode 100644 index 00000000..372563e6 --- /dev/null +++ b/docs/Model/GetAllPipelines.md @@ -0,0 +1,10 @@ +# # GetAllPipelines + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BasePipelineWithSelectedFlag[]**](BasePipelineWithSelectedFlag.md) | Pipelines 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/GetAllPipelinesAllOf.md b/docs/Model/GetAllPipelinesAllOf.md new file mode 100644 index 00000000..96bb042e --- /dev/null +++ b/docs/Model/GetAllPipelinesAllOf.md @@ -0,0 +1,9 @@ +# # GetAllPipelinesAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BasePipelineWithSelectedFlag[]**](BasePipelineWithSelectedFlag.md) | Pipelines 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/GetAllProductFieldsResponse.md b/docs/Model/GetAllProductFieldsResponse.md new file mode 100644 index 00000000..e86557ca --- /dev/null +++ b/docs/Model/GetAllProductFieldsResponse.md @@ -0,0 +1,11 @@ +# # GetAllProductFieldsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ProductField[]**](ProductField.md) | Array containing data for all product fields | [optional] +**additional_data** | **object** | Additional data for the product field, such as pagination | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetComments.md b/docs/Model/GetComments.md new file mode 100644 index 00000000..a9fb6369 --- /dev/null +++ b/docs/Model/GetComments.md @@ -0,0 +1,11 @@ +# # GetComments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseComment[]**](BaseComment.md) | The array of comments | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithOffsetPagination**](AdditionalDataWithOffsetPagination.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/GetDeal.md b/docs/Model/GetDeal.md new file mode 100644 index 00000000..7dec71dd --- /dev/null +++ b/docs/Model/GetDeal.md @@ -0,0 +1,12 @@ +# # GetDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealNonStrictWithDetails**](DealNonStrictWithDetails.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\GetDealAdditionalData**](GetDealAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetDealsRelatedObjects**](GetDealsRelatedObjects.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/GetDealAdditionalData.md b/docs/Model/GetDealAdditionalData.md new file mode 100644 index 00000000..80ce8b13 --- /dev/null +++ b/docs/Model/GetDealAdditionalData.md @@ -0,0 +1,9 @@ +# # GetDealAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dropbox_email** | **string** | The BCC email of the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDeals.md b/docs/Model/GetDeals.md new file mode 100644 index 00000000..d2a9e939 --- /dev/null +++ b/docs/Model/GetDeals.md @@ -0,0 +1,12 @@ +# # GetDeals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealNonStrict[]**](DealNonStrict.md) | The array of deals | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetDealsRelatedObjects**](GetDealsRelatedObjects.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/GetDealsCollection.md b/docs/Model/GetDealsCollection.md new file mode 100644 index 00000000..027b601e --- /dev/null +++ b/docs/Model/GetDealsCollection.md @@ -0,0 +1,11 @@ +# # GetDealsCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealCollectionResponseObject[]**](DealCollectionResponseObject.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithCursorPagination**](AdditionalDataWithCursorPagination.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/GetDealsConversionRatesInPipeline.md b/docs/Model/GetDealsConversionRatesInPipeline.md new file mode 100644 index 00000000..5923dc6a --- /dev/null +++ b/docs/Model/GetDealsConversionRatesInPipeline.md @@ -0,0 +1,10 @@ +# # GetDealsConversionRatesInPipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData**](GetDealsConversionRatesInPipelineAllOfData.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/GetDealsConversionRatesInPipelineAllOf.md b/docs/Model/GetDealsConversionRatesInPipelineAllOf.md new file mode 100644 index 00000000..6e20ba00 --- /dev/null +++ b/docs/Model/GetDealsConversionRatesInPipelineAllOf.md @@ -0,0 +1,9 @@ +# # GetDealsConversionRatesInPipelineAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData**](GetDealsConversionRatesInPipelineAllOfData.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/GetDealsConversionRatesInPipelineAllOfData.md b/docs/Model/GetDealsConversionRatesInPipelineAllOfData.md new file mode 100644 index 00000000..1d6a98af --- /dev/null +++ b/docs/Model/GetDealsConversionRatesInPipelineAllOfData.md @@ -0,0 +1,11 @@ +# # GetDealsConversionRatesInPipelineAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stage_conversions** | [**\Pipedrive\Model\StageConversions[]**](StageConversions.md) | The stage conversions | [optional] +**won_conversion** | **int** | The won conversion | [optional] +**lost_conversion** | **int** | The lost conversion | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsMovementsInPipeline.md b/docs/Model/GetDealsMovementsInPipeline.md new file mode 100644 index 00000000..d3c7e92c --- /dev/null +++ b/docs/Model/GetDealsMovementsInPipeline.md @@ -0,0 +1,10 @@ +# # GetDealsMovementsInPipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\GetDealsMovementsInPipelineAllOfData**](GetDealsMovementsInPipelineAllOfData.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/GetDealsMovementsInPipelineAllOf.md b/docs/Model/GetDealsMovementsInPipelineAllOf.md new file mode 100644 index 00000000..6d6effc2 --- /dev/null +++ b/docs/Model/GetDealsMovementsInPipelineAllOf.md @@ -0,0 +1,9 @@ +# # GetDealsMovementsInPipelineAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\GetDealsMovementsInPipelineAllOfData**](GetDealsMovementsInPipelineAllOfData.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/GetDealsMovementsInPipelineAllOfData.md b/docs/Model/GetDealsMovementsInPipelineAllOfData.md new file mode 100644 index 00000000..ab1e1ccd --- /dev/null +++ b/docs/Model/GetDealsMovementsInPipelineAllOfData.md @@ -0,0 +1,14 @@ +# # GetDealsMovementsInPipelineAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**movements_between_stages** | [**\Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages**](GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md) | | [optional] +**new_deals** | [**\Pipedrive\Model\DealsMovementsInfo**](DealsMovementsInfo.md) | | [optional] +**deals_left_open** | [**\Pipedrive\Model\DealsMovementsInfo**](DealsMovementsInfo.md) | | [optional] +**won_deals** | [**\Pipedrive\Model\DealsMovementsInfo**](DealsMovementsInfo.md) | | [optional] +**lost_deals** | [**\Pipedrive\Model\DealsMovementsInfo**](DealsMovementsInfo.md) | | [optional] +**average_age_in_days** | [**\Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDays**](GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.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/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.md b/docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.md new file mode 100644 index 00000000..4a108177 --- /dev/null +++ b/docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.md @@ -0,0 +1,10 @@ +# # GetDealsMovementsInPipelineAllOfDataAverageAgeInDays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**across_all_stages** | **int** | The moved deals average age across all stages | [optional] +**by_stages** | [**\Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages[]**](GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md) | The moved deals average age by stages | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md b/docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md new file mode 100644 index 00000000..f6452ffb --- /dev/null +++ b/docs/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.md @@ -0,0 +1,10 @@ +# # GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stage_id** | **int** | The stage ID | [optional] +**value** | **int** | The average deals age in specific stage | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md b/docs/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md new file mode 100644 index 00000000..57dc2d0f --- /dev/null +++ b/docs/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.md @@ -0,0 +1,9 @@ +# # GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The count of the deals that have been moved between stages | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsRelatedObjects.md b/docs/Model/GetDealsRelatedObjects.md new file mode 100644 index 00000000..57704f72 --- /dev/null +++ b/docs/Model/GetDealsRelatedObjects.md @@ -0,0 +1,11 @@ +# # GetDealsRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**\Pipedrive\Model\DealUserData**](DealUserData.md) | | [optional] +**organization** | [**\Pipedrive\Model\DealOrganizationData**](DealOrganizationData.md) | | [optional] +**person** | [**\Pipedrive\Model\DealPersonData**](DealPersonData.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/GetDealsSummary.md b/docs/Model/GetDealsSummary.md new file mode 100644 index 00000000..0005a846 --- /dev/null +++ b/docs/Model/GetDealsSummary.md @@ -0,0 +1,10 @@ +# # GetDealsSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\GetDealsSummaryData**](GetDealsSummaryData.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/GetDealsSummaryData.md b/docs/Model/GetDealsSummaryData.md new file mode 100644 index 00000000..9fb99d7d --- /dev/null +++ b/docs/Model/GetDealsSummaryData.md @@ -0,0 +1,15 @@ +# # GetDealsSummaryData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values_total** | [**\Pipedrive\Model\GetDealsSummaryDataValuesTotal**](GetDealsSummaryDataValuesTotal.md) | | [optional] +**weighted_values_total** | [**\Pipedrive\Model\GetDealsSummaryDataWeightedValuesTotal**](GetDealsSummaryDataWeightedValuesTotal.md) | | [optional] +**total_count** | **int** | The total number of deals | [optional] +**total_currency_converted_value** | **float** | The total value of deals converted into the company default currency | [optional] +**total_weighted_currency_converted_value** | **float** | The total weighted value of deals converted into the company default currency | [optional] +**total_currency_converted_value_formatted** | **string** | The total converted value of deals formatted with the company default currency. E.g. US$5,100.96 | [optional] +**total_weighted_currency_converted_value_formatted** | **string** | The total weighted value of deals formatted with the company default currency. E.g. US$5,100.96 | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsSummaryDataValuesTotal.md b/docs/Model/GetDealsSummaryDataValuesTotal.md new file mode 100644 index 00000000..98217f1d --- /dev/null +++ b/docs/Model/GetDealsSummaryDataValuesTotal.md @@ -0,0 +1,13 @@ +# # GetDealsSummaryDataValuesTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | The total value of deals in the deal currency group | [optional] +**count** | **int** | The number of deals in the deal currency group | [optional] +**value_converted** | **float** | The total value of deals converted into the company default currency | [optional] +**value_formatted** | **string** | The total value of deals formatted with deal currency. E.g. €50 | [optional] +**value_converted_formatted** | **string** | The value_converted formatted with deal currency. E.g. US$50.10 | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsSummaryDataWeightedValuesTotal.md b/docs/Model/GetDealsSummaryDataWeightedValuesTotal.md new file mode 100644 index 00000000..7fa7d947 --- /dev/null +++ b/docs/Model/GetDealsSummaryDataWeightedValuesTotal.md @@ -0,0 +1,11 @@ +# # GetDealsSummaryDataWeightedValuesTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | The total weighted value of the deals in the deal currency group | [optional] +**count** | **int** | The number of deals in the deal currency group | [optional] +**value_formatted** | **string** | The total weighted value of the deals formatted with deal currency. E.g. €50 | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDealsTimeline.md b/docs/Model/GetDealsTimeline.md new file mode 100644 index 00000000..2225fc71 --- /dev/null +++ b/docs/Model/GetDealsTimeline.md @@ -0,0 +1,10 @@ +# # GetDealsTimeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\GetDealsTimelineData**](GetDealsTimelineData.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/GetDealsTimelineData.md b/docs/Model/GetDealsTimelineData.md new file mode 100644 index 00000000..7952e3da --- /dev/null +++ b/docs/Model/GetDealsTimelineData.md @@ -0,0 +1,12 @@ +# # GetDealsTimelineData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period_start** | **string** | The start date and time of the period | [optional] +**period_end** | **string** | The end date and time of the period | [optional] +**deals** | [**\Pipedrive\Model\DealStrict[]**](DealStrict.md) | | [optional] +**totals** | [**\Pipedrive\Model\GetDealsTimelineDataTotals**](GetDealsTimelineDataTotals.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/GetDealsTimelineDataTotals.md b/docs/Model/GetDealsTimelineDataTotals.md new file mode 100644 index 00000000..ed34e2a7 --- /dev/null +++ b/docs/Model/GetDealsTimelineDataTotals.md @@ -0,0 +1,16 @@ +# # GetDealsTimelineDataTotals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | The number of deals for the given period | [optional] +**values** | **object** | The total values of deals grouped by deal currency | [optional] +**weighted_values** | **object** | The total weighted values of deals for the given period grouped by deal currency. The weighted value of a deal is calculated as probability times deal value. | [optional] +**open_count** | **int** | The number of open deals for the given period | [optional] +**open_values** | **object** | The total values of open deals for the given period grouped by deal currency | [optional] +**weighted_open_values** | **object** | The total weighted values of open deals for the given period grouped by deal currency. The weighted value of a deal is calculated as probability times deal value. | [optional] +**won_count** | **int** | The number of won deals for the given period | [optional] +**won_values** | **object** | The total values of won deals for the given period grouped by deal currency | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetDuplicatedDeal.md b/docs/Model/GetDuplicatedDeal.md new file mode 100644 index 00000000..c86e6997 --- /dev/null +++ b/docs/Model/GetDuplicatedDeal.md @@ -0,0 +1,10 @@ +# # GetDuplicatedDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealStrict**](DealStrict.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/GetGoalResultResponse200.md b/docs/Model/GetGoalResultResponse200.md new file mode 100644 index 00000000..92bf3fa4 --- /dev/null +++ b/docs/Model/GetGoalResultResponse200.md @@ -0,0 +1,10 @@ +# # GetGoalResultResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\GoalResults**](GoalResults.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/GetGoalsResponse200.md b/docs/Model/GetGoalsResponse200.md new file mode 100644 index 00000000..b5a2f6f8 --- /dev/null +++ b/docs/Model/GetGoalsResponse200.md @@ -0,0 +1,10 @@ +# # GetGoalsResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FindGoalResponse**](FindGoalResponse.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/GetLeadLabelsResponse200.md b/docs/Model/GetLeadLabelsResponse200.md new file mode 100644 index 00000000..3c85a839 --- /dev/null +++ b/docs/Model/GetLeadLabelsResponse200.md @@ -0,0 +1,10 @@ +# # GetLeadLabelsResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\LeadLabelResponse[]**](LeadLabelResponse.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/GetLeadSourcesResponse200.md b/docs/Model/GetLeadSourcesResponse200.md new file mode 100644 index 00000000..8008cefe --- /dev/null +++ b/docs/Model/GetLeadSourcesResponse200.md @@ -0,0 +1,10 @@ +# # GetLeadSourcesResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\GetLeadSourcesResponse200Data[]**](GetLeadSourcesResponse200Data.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/GetLeadSourcesResponse200Data.md b/docs/Model/GetLeadSourcesResponse200Data.md new file mode 100644 index 00000000..9fbc77ff --- /dev/null +++ b/docs/Model/GetLeadSourcesResponse200Data.md @@ -0,0 +1,9 @@ +# # GetLeadSourcesResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The unique name of a lead source | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetLeadsResponse200.md b/docs/Model/GetLeadsResponse200.md new file mode 100644 index 00000000..27afbed9 --- /dev/null +++ b/docs/Model/GetLeadsResponse200.md @@ -0,0 +1,11 @@ +# # GetLeadsResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\LeadResponse[]**](LeadResponse.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/GetMergedDeal.md b/docs/Model/GetMergedDeal.md new file mode 100644 index 00000000..a9d9543a --- /dev/null +++ b/docs/Model/GetMergedDeal.md @@ -0,0 +1,10 @@ +# # GetMergedDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealStrictWithMergeId**](DealStrictWithMergeId.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/GetNotes.md b/docs/Model/GetNotes.md new file mode 100644 index 00000000..bca55e00 --- /dev/null +++ b/docs/Model/GetNotes.md @@ -0,0 +1,11 @@ +# # GetNotes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseNote[]**](BaseNote.md) | The array of notes | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalDataWithOffsetPagination**](AdditionalDataWithOffsetPagination.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/GetOneFile.md b/docs/Model/GetOneFile.md new file mode 100644 index 00000000..da2831c7 --- /dev/null +++ b/docs/Model/GetOneFile.md @@ -0,0 +1,10 @@ +# # GetOneFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FileData**](FileData.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/GetOnePipeline.md b/docs/Model/GetOnePipeline.md new file mode 100644 index 00000000..8e0da788 --- /dev/null +++ b/docs/Model/GetOnePipeline.md @@ -0,0 +1,10 @@ +# # GetOnePipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PipelineDetails**](PipelineDetails.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/GetOnePipelineAllOf.md b/docs/Model/GetOnePipelineAllOf.md new file mode 100644 index 00000000..5d03ff2c --- /dev/null +++ b/docs/Model/GetOnePipelineAllOf.md @@ -0,0 +1,9 @@ +# # GetOnePipelineAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PipelineDetails**](PipelineDetails.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/GetOneStage.md b/docs/Model/GetOneStage.md new file mode 100644 index 00000000..305aca02 --- /dev/null +++ b/docs/Model/GetOneStage.md @@ -0,0 +1,10 @@ +# # GetOneStage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\StageDetails**](StageDetails.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/GetPersonDetailsResponse.md b/docs/Model/GetPersonDetailsResponse.md new file mode 100644 index 00000000..5c2e0fe5 --- /dev/null +++ b/docs/Model/GetPersonDetailsResponse.md @@ -0,0 +1,12 @@ +# # GetPersonDetailsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonItem**](PersonItem.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData**](GetPersonDetailsResponseAllOfAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/GetPersonDetailsResponseAllOf.md b/docs/Model/GetPersonDetailsResponseAllOf.md new file mode 100644 index 00000000..179e76d4 --- /dev/null +++ b/docs/Model/GetPersonDetailsResponseAllOf.md @@ -0,0 +1,11 @@ +# # GetPersonDetailsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PersonItem**](PersonItem.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData**](GetPersonDetailsResponseAllOfAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/GetPersonDetailsResponseAllOfAdditionalData.md b/docs/Model/GetPersonDetailsResponseAllOfAdditionalData.md new file mode 100644 index 00000000..7c671882 --- /dev/null +++ b/docs/Model/GetPersonDetailsResponseAllOfAdditionalData.md @@ -0,0 +1,9 @@ +# # GetPersonDetailsResponseAllOfAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dropbox_email** | **string** | Dropbox email for the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetProductAttachementDetails.md b/docs/Model/GetProductAttachementDetails.md new file mode 100644 index 00000000..a3d7525e --- /dev/null +++ b/docs/Model/GetProductAttachementDetails.md @@ -0,0 +1,10 @@ +# # GetProductAttachementDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**ProductAttachmentDetails**](ProductAttachmentDetails.md) | The updated product object attached to the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetProductFieldResponse.md b/docs/Model/GetProductFieldResponse.md new file mode 100644 index 00000000..68d5ddc3 --- /dev/null +++ b/docs/Model/GetProductFieldResponse.md @@ -0,0 +1,10 @@ +# # GetProductFieldResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**ProductField**](ProductField.md) | All data for the product field | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetRecents.md b/docs/Model/GetRecents.md new file mode 100644 index 00000000..03d31225 --- /dev/null +++ b/docs/Model/GetRecents.md @@ -0,0 +1,11 @@ +# # GetRecents + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**AnyOfRecents[]**](AnyOfRecentsActivityRecentsActivityTypeRecentsDealRecentsFileRecentsFilterRecentsNoteRecentsPersonRecentsOrganizationRecentsPipelineRecentsProductRecentsStageRecentsUser.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\GetRecentsAdditionalData**](GetRecentsAdditionalData.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/GetRecentsAdditionalData.md b/docs/Model/GetRecentsAdditionalData.md new file mode 100644 index 00000000..c976f254 --- /dev/null +++ b/docs/Model/GetRecentsAdditionalData.md @@ -0,0 +1,11 @@ +# # GetRecentsAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**since_timestamp** | **string** | The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS | [optional] +**last_timestamp_on_page** | **string** | The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS | [optional] +**pagination** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/GetRole.md b/docs/Model/GetRole.md new file mode 100644 index 00000000..1b978f25 --- /dev/null +++ b/docs/Model/GetRole.md @@ -0,0 +1,11 @@ +# # GetRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\SubRole**](SubRole.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\GetRoleAllOfAdditionalData**](GetRoleAllOfAdditionalData.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/GetRoleAllOf.md b/docs/Model/GetRoleAllOf.md new file mode 100644 index 00000000..7d1c9d19 --- /dev/null +++ b/docs/Model/GetRoleAllOf.md @@ -0,0 +1,10 @@ +# # GetRoleAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\SubRole**](SubRole.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\GetRoleAllOfAdditionalData**](GetRoleAllOfAdditionalData.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/GetRoleAllOfAdditionalData.md b/docs/Model/GetRoleAllOfAdditionalData.md new file mode 100644 index 00000000..c4995404 --- /dev/null +++ b/docs/Model/GetRoleAllOfAdditionalData.md @@ -0,0 +1,9 @@ +# # GetRoleAllOfAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**settings** | [**\Pipedrive\Model\RoleSettings**](RoleSettings.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/GetRoleAssignments.md b/docs/Model/GetRoleAssignments.md new file mode 100644 index 00000000..041ad10c --- /dev/null +++ b/docs/Model/GetRoleAssignments.md @@ -0,0 +1,11 @@ +# # GetRoleAssignments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\RoleAssignment[]**](RoleAssignment.md) | The role assignments | [optional] +**additional_data** | [**\Pipedrive\Model\RolesAdditionalData**](RolesAdditionalData.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/GetRoleAssignmentsAllOf.md b/docs/Model/GetRoleAssignmentsAllOf.md new file mode 100644 index 00000000..b68073e0 --- /dev/null +++ b/docs/Model/GetRoleAssignmentsAllOf.md @@ -0,0 +1,10 @@ +# # GetRoleAssignmentsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\RoleAssignment[]**](RoleAssignment.md) | The role assignments | [optional] +**additional_data** | [**\Pipedrive\Model\RolesAdditionalData**](RolesAdditionalData.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/GetRolePipelines.md b/docs/Model/GetRolePipelines.md new file mode 100644 index 00000000..98435110 --- /dev/null +++ b/docs/Model/GetRolePipelines.md @@ -0,0 +1,10 @@ +# # GetRolePipelines + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\GetRolePipelinesAllOfData**](GetRolePipelinesAllOfData.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/GetRolePipelinesAllOf.md b/docs/Model/GetRolePipelinesAllOf.md new file mode 100644 index 00000000..6381b0a1 --- /dev/null +++ b/docs/Model/GetRolePipelinesAllOf.md @@ -0,0 +1,9 @@ +# # GetRolePipelinesAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\GetRolePipelinesAllOfData**](GetRolePipelinesAllOfData.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/GetRolePipelinesAllOfData.md b/docs/Model/GetRolePipelinesAllOfData.md new file mode 100644 index 00000000..18bbd50f --- /dev/null +++ b/docs/Model/GetRolePipelinesAllOfData.md @@ -0,0 +1,10 @@ +# # GetRolePipelinesAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pipeline_ids** | **float[]** | Either visible or hidden pipeline ids | [optional] +**visible** | **bool** | Whether visible or hidden pipeline ids were returned | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetRoleSettings.md b/docs/Model/GetRoleSettings.md new file mode 100644 index 00000000..182e44e4 --- /dev/null +++ b/docs/Model/GetRoleSettings.md @@ -0,0 +1,10 @@ +# # GetRoleSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\RoleSettings**](RoleSettings.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/GetRoleSettingsAllOf.md b/docs/Model/GetRoleSettingsAllOf.md new file mode 100644 index 00000000..035f3a8d --- /dev/null +++ b/docs/Model/GetRoleSettingsAllOf.md @@ -0,0 +1,9 @@ +# # GetRoleSettingsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\RoleSettings**](RoleSettings.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/GetRoles.md b/docs/Model/GetRoles.md new file mode 100644 index 00000000..676aaaa6 --- /dev/null +++ b/docs/Model/GetRoles.md @@ -0,0 +1,11 @@ +# # GetRoles + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FullRole[]**](FullRole.md) | The array of roles | [optional] +**additional_data** | [**\Pipedrive\Model\RolesAdditionalData**](RolesAdditionalData.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/GetRolesAllOf.md b/docs/Model/GetRolesAllOf.md new file mode 100644 index 00000000..13619eff --- /dev/null +++ b/docs/Model/GetRolesAllOf.md @@ -0,0 +1,10 @@ +# # GetRolesAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FullRole[]**](FullRole.md) | The array of roles | [optional] +**additional_data** | [**\Pipedrive\Model\RolesAdditionalData**](RolesAdditionalData.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/GetStageDeals.md b/docs/Model/GetStageDeals.md new file mode 100644 index 00000000..140dab35 --- /dev/null +++ b/docs/Model/GetStageDeals.md @@ -0,0 +1,11 @@ +# # GetStageDeals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\DealStrict[]**](DealStrict.md) | The array of deals | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/GetStages.md b/docs/Model/GetStages.md new file mode 100644 index 00000000..58471f52 --- /dev/null +++ b/docs/Model/GetStages.md @@ -0,0 +1,10 @@ +# # GetStages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\StageWithPipelineInfo[]**](StageWithPipelineInfo.md) | The array of stages | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GoalResults.md b/docs/Model/GoalResults.md new file mode 100644 index 00000000..1dbfad48 --- /dev/null +++ b/docs/Model/GoalResults.md @@ -0,0 +1,10 @@ +# # GoalResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**progress** | **int** | The numeric progress of the goal | [optional] +**goal** | [**\Pipedrive\Model\GoalsResponseComponent**](GoalsResponseComponent.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/GoalType.md b/docs/Model/GoalType.md new file mode 100644 index 00000000..a8d710bc --- /dev/null +++ b/docs/Model/GoalType.md @@ -0,0 +1,10 @@ +# # GoalType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the goal type | [optional] +**params** | [**\Pipedrive\Model\Params**](Params.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/GoalsResponseComponent.md b/docs/Model/GoalsResponseComponent.md new file mode 100644 index 00000000..88ac4bae --- /dev/null +++ b/docs/Model/GoalsResponseComponent.md @@ -0,0 +1,18 @@ +# # GoalsResponseComponent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of the goal | [optional] +**owner_id** | **int** | The ID of the creator of the goal | [optional] +**title** | **string** | The title of the goal | [optional] +**type** | [**\Pipedrive\Model\GoalType**](GoalType.md) | | [optional] +**assignee** | [**\Pipedrive\Model\Assignee**](Assignee.md) | | [optional] +**interval** | **string** | The interval of the goal | [optional] +**duration** | [**\Pipedrive\Model\Duration**](Duration.md) | | [optional] +**expected_outcome** | [**\Pipedrive\Model\ExpectedOutcome**](ExpectedOutcome.md) | | [optional] +**is_active** | **bool** | Whether the goal is currently active or not | [optional] +**report_ids** | **string[]** | The IDs of the reports that belong to the goal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/IconKey.md b/docs/Model/IconKey.md new file mode 100644 index 00000000..36e22f34 --- /dev/null +++ b/docs/Model/IconKey.md @@ -0,0 +1,8 @@ +# # IconKey + +## 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/InlineResponse200.md b/docs/Model/InlineResponse200.md new file mode 100644 index 00000000..6c26246a --- /dev/null +++ b/docs/Model/InlineResponse200.md @@ -0,0 +1,10 @@ +# # InlineResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\MessageObject**](MessageObject.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/InlineResponse400.md b/docs/Model/InlineResponse400.md new file mode 100644 index 00000000..22bbc3b1 --- /dev/null +++ b/docs/Model/InlineResponse400.md @@ -0,0 +1,12 @@ +# # InlineResponse400 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The error description | [optional] +**error_info** | **string** | | [optional] +**additional_data** | [**\Pipedrive\Model\InlineResponse400AdditionalData**](InlineResponse400AdditionalData.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/InlineResponse4001.md b/docs/Model/InlineResponse4001.md new file mode 100644 index 00000000..41496d26 --- /dev/null +++ b/docs/Model/InlineResponse4001.md @@ -0,0 +1,12 @@ +# # InlineResponse4001 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The error description | [optional] +**error_info** | **string** | | [optional] +**additional_data** | [**\Pipedrive\Model\InlineResponse4001AdditionalData**](InlineResponse4001AdditionalData.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/InlineResponse4001AdditionalData.md b/docs/Model/InlineResponse4001AdditionalData.md new file mode 100644 index 00000000..8edf965b --- /dev/null +++ b/docs/Model/InlineResponse4001AdditionalData.md @@ -0,0 +1,9 @@ +# # InlineResponse4001AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | An error code sent by the API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse400AdditionalData.md b/docs/Model/InlineResponse400AdditionalData.md new file mode 100644 index 00000000..64699188 --- /dev/null +++ b/docs/Model/InlineResponse400AdditionalData.md @@ -0,0 +1,9 @@ +# # InlineResponse400AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | An error code sent by the API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse403.md b/docs/Model/InlineResponse403.md new file mode 100644 index 00000000..af96a5e5 --- /dev/null +++ b/docs/Model/InlineResponse403.md @@ -0,0 +1,12 @@ +# # InlineResponse403 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The error description | [optional] +**error_info** | **string** | | [optional] +**additional_data** | [**\Pipedrive\Model\InlineResponse403AdditionalData**](InlineResponse403AdditionalData.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/InlineResponse4031.md b/docs/Model/InlineResponse4031.md new file mode 100644 index 00000000..8db32b4e --- /dev/null +++ b/docs/Model/InlineResponse4031.md @@ -0,0 +1,12 @@ +# # InlineResponse4031 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The error description | [optional] +**error_info** | **string** | | [optional] +**additional_data** | [**\Pipedrive\Model\InlineResponse4031AdditionalData**](InlineResponse4031AdditionalData.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/InlineResponse4031AdditionalData.md b/docs/Model/InlineResponse4031AdditionalData.md new file mode 100644 index 00000000..c55c3f3b --- /dev/null +++ b/docs/Model/InlineResponse4031AdditionalData.md @@ -0,0 +1,9 @@ +# # InlineResponse4031AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | An error code sent by the API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse403AdditionalData.md b/docs/Model/InlineResponse403AdditionalData.md new file mode 100644 index 00000000..810a299f --- /dev/null +++ b/docs/Model/InlineResponse403AdditionalData.md @@ -0,0 +1,9 @@ +# # InlineResponse403AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | An error code sent by the API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InlineResponse404.md b/docs/Model/InlineResponse404.md new file mode 100644 index 00000000..a15cd13f --- /dev/null +++ b/docs/Model/InlineResponse404.md @@ -0,0 +1,12 @@ +# # InlineResponse404 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The error description | [optional] +**error_info** | **string** | | [optional] +**additional_data** | [**\Pipedrive\Model\InlineResponse404AdditionalData**](InlineResponse404AdditionalData.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/InlineResponse404AdditionalData.md b/docs/Model/InlineResponse404AdditionalData.md new file mode 100644 index 00000000..ffa15e4a --- /dev/null +++ b/docs/Model/InlineResponse404AdditionalData.md @@ -0,0 +1,9 @@ +# # InlineResponse404AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | An error code sent by the API | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ItemSearchAdditionalData.md b/docs/Model/ItemSearchAdditionalData.md new file mode 100644 index 00000000..d96bdb98 --- /dev/null +++ b/docs/Model/ItemSearchAdditionalData.md @@ -0,0 +1,9 @@ +# # ItemSearchAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**\Pipedrive\Model\ItemSearchAdditionalDataPagination**](ItemSearchAdditionalDataPagination.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/ItemSearchAdditionalDataPagination.md b/docs/Model/ItemSearchAdditionalDataPagination.md new file mode 100644 index 00000000..2655c2cb --- /dev/null +++ b/docs/Model/ItemSearchAdditionalDataPagination.md @@ -0,0 +1,12 @@ +# # ItemSearchAdditionalDataPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **int** | Pagination start | [optional] +**limit** | **int** | Items shown per page | [optional] +**more_items_in_collection** | **bool** | Whether there are more list items in the collection than displayed | [optional] +**next_start** | **int** | Next pagination start | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ItemSearchFieldResponse.md b/docs/Model/ItemSearchFieldResponse.md new file mode 100644 index 00000000..9e95f82b --- /dev/null +++ b/docs/Model/ItemSearchFieldResponse.md @@ -0,0 +1,11 @@ +# # ItemSearchFieldResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ItemSearchFieldResponseAllOfData[]**](ItemSearchFieldResponseAllOfData.md) | The array of results | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ItemSearchFieldResponseAllOf.md b/docs/Model/ItemSearchFieldResponseAllOf.md new file mode 100644 index 00000000..c4640653 --- /dev/null +++ b/docs/Model/ItemSearchFieldResponseAllOf.md @@ -0,0 +1,10 @@ +# # ItemSearchFieldResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ItemSearchFieldResponseAllOfData[]**](ItemSearchFieldResponseAllOfData.md) | The array of results | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ItemSearchFieldResponseAllOfData.md b/docs/Model/ItemSearchFieldResponseAllOfData.md new file mode 100644 index 00000000..595f0247 --- /dev/null +++ b/docs/Model/ItemSearchFieldResponseAllOfData.md @@ -0,0 +1,10 @@ +# # ItemSearchFieldResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the item | [optional] +**field_key** | **mixed** | The value of the searched `field_key` | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ItemSearchItem.md b/docs/Model/ItemSearchItem.md new file mode 100644 index 00000000..e8f967a7 --- /dev/null +++ b/docs/Model/ItemSearchItem.md @@ -0,0 +1,10 @@ +# # ItemSearchItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result_score** | **float** | Search result relevancy | [optional] +**item** | **object** | Item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ItemSearchResponse.md b/docs/Model/ItemSearchResponse.md new file mode 100644 index 00000000..5255d88f --- /dev/null +++ b/docs/Model/ItemSearchResponse.md @@ -0,0 +1,11 @@ +# # ItemSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ItemSearchResponseAllOfData**](ItemSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ItemSearchResponseAllOf.md b/docs/Model/ItemSearchResponseAllOf.md new file mode 100644 index 00000000..62649a0e --- /dev/null +++ b/docs/Model/ItemSearchResponseAllOf.md @@ -0,0 +1,10 @@ +# # ItemSearchResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ItemSearchResponseAllOfData**](ItemSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ItemSearchResponseAllOfData.md b/docs/Model/ItemSearchResponseAllOfData.md new file mode 100644 index 00000000..6f8d2900 --- /dev/null +++ b/docs/Model/ItemSearchResponseAllOfData.md @@ -0,0 +1,10 @@ +# # ItemSearchResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\ItemSearchItem[]**](ItemSearchItem.md) | The array of found items | [optional] +**related_items** | [**\Pipedrive\Model\ItemSearchItem[]**](ItemSearchItem.md) | The array of related items if `search_for_related_items` was enabled | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadIdResponse200.md b/docs/Model/LeadIdResponse200.md new file mode 100644 index 00000000..f97809d5 --- /dev/null +++ b/docs/Model/LeadIdResponse200.md @@ -0,0 +1,10 @@ +# # LeadIdResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\LeadIdResponse200Data**](LeadIdResponse200Data.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/LeadIdResponse200Data.md b/docs/Model/LeadIdResponse200Data.md new file mode 100644 index 00000000..97df91c5 --- /dev/null +++ b/docs/Model/LeadIdResponse200Data.md @@ -0,0 +1,9 @@ +# # LeadIdResponse200Data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **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/LeadLabelColor.md b/docs/Model/LeadLabelColor.md new file mode 100644 index 00000000..a7c82eb9 --- /dev/null +++ b/docs/Model/LeadLabelColor.md @@ -0,0 +1,8 @@ +# # LeadLabelColor + +## 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/LeadLabelResponse.md b/docs/Model/LeadLabelResponse.md new file mode 100644 index 00000000..53133c1b --- /dev/null +++ b/docs/Model/LeadLabelResponse.md @@ -0,0 +1,13 @@ +# # LeadLabelResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique ID of the lead label | [optional] +**name** | **string** | The name of the lead label | [optional] +**color** | [**\Pipedrive\Model\LeadLabelColor**](LeadLabelColor.md) | | [optional] +**add_time** | **\DateTime** | The date and time of when the lead label was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. | [optional] +**update_time** | **\DateTime** | The date and time of when the lead label was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadResponse.md b/docs/Model/LeadResponse.md new file mode 100644 index 00000000..c1f25a2e --- /dev/null +++ b/docs/Model/LeadResponse.md @@ -0,0 +1,25 @@ +# # LeadResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique ID of the lead in the UUID format | [optional] +**title** | **string** | The title of the lead | [optional] +**owner_id** | **int** | The ID of the user who owns the lead | [optional] +**creator_id** | **int** | The ID of the user who created the lead | [optional] +**label_ids** | **string[]** | The IDs of the lead labels which are associated with the lead | [optional] +**person_id** | **int** | The ID of a person which this lead is linked to | [optional] +**organization_id** | **int** | The ID of an organization which this lead is linked to | [optional] +**source_name** | **string** | Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. | [optional] +**is_archived** | **bool** | A flag indicating whether the lead is archived or not | [optional] +**was_seen** | **bool** | A flag indicating whether the lead was seen by someone in the Pipedrive UI | [optional] +**value** | [**\Pipedrive\Model\LeadValue**](LeadValue.md) | | [optional] +**expected_close_date** | **\DateTime** | The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD. | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the lead | [optional] +**add_time** | **\DateTime** | The date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. | [optional] +**update_time** | **\DateTime** | The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> | [optional] +**cc_email** | **string** | The BCC email of the lead | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadResponse404.md b/docs/Model/LeadResponse404.md new file mode 100644 index 00000000..8f42e82c --- /dev/null +++ b/docs/Model/LeadResponse404.md @@ -0,0 +1,13 @@ +# # LeadResponse404 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **string** | The description of the error | [optional] +**error_info** | **string** | A message describing how to solve the problem | [optional] +**data** | **object** | | [optional] +**additional_data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadSearchItem.md b/docs/Model/LeadSearchItem.md new file mode 100644 index 00000000..b23bc5bf --- /dev/null +++ b/docs/Model/LeadSearchItem.md @@ -0,0 +1,10 @@ +# # LeadSearchItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result_score** | **float** | Search result relevancy | [optional] +**item** | [**\Pipedrive\Model\LeadSearchItemItem**](LeadSearchItemItem.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/LeadSearchItemItem.md b/docs/Model/LeadSearchItemItem.md new file mode 100644 index 00000000..d0dad680 --- /dev/null +++ b/docs/Model/LeadSearchItemItem.md @@ -0,0 +1,22 @@ +# # LeadSearchItemItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of the lead | [optional] +**type** | **string** | The type of the item | [optional] +**title** | **string** | The title of the lead | [optional] +**owner** | [**\Pipedrive\Model\LeadSearchItemItemOwner**](LeadSearchItemItemOwner.md) | | [optional] +**person** | [**\Pipedrive\Model\LeadSearchItemItemPerson**](LeadSearchItemItemPerson.md) | | [optional] +**organization** | [**\Pipedrive\Model\LeadSearchItemItemOrganization**](LeadSearchItemItemOrganization.md) | | [optional] +**phones** | **string[]** | | [optional] +**emails** | **string[]** | | [optional] +**custom_fields** | **string[]** | Custom fields | [optional] +**notes** | **string[]** | An array of notes | [optional] +**value** | **int** | The value of the lead | [optional] +**currency** | **string** | The currency of the lead | [optional] +**visible_to** | **int** | The visibility of the lead | [optional] +**is_archived** | **bool** | A flag indicating whether the lead is archived 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/LeadSearchItemItemOrganization.md b/docs/Model/LeadSearchItemItemOrganization.md new file mode 100644 index 00000000..69a85b71 --- /dev/null +++ b/docs/Model/LeadSearchItemItemOrganization.md @@ -0,0 +1,10 @@ +# # LeadSearchItemItemOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization the lead is associated with | [optional] +**name** | **string** | The name of the organization the lead is associated with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadSearchItemItemOwner.md b/docs/Model/LeadSearchItemItemOwner.md new file mode 100644 index 00000000..5163afbf --- /dev/null +++ b/docs/Model/LeadSearchItemItemOwner.md @@ -0,0 +1,9 @@ +# # LeadSearchItemItemOwner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the owner of the lead | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadSearchItemItemPerson.md b/docs/Model/LeadSearchItemItemPerson.md new file mode 100644 index 00000000..d89beeef --- /dev/null +++ b/docs/Model/LeadSearchItemItemPerson.md @@ -0,0 +1,10 @@ +# # LeadSearchItemItemPerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person the lead is associated with | [optional] +**name** | **string** | The name of the person the lead is associated with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadSearchResponse.md b/docs/Model/LeadSearchResponse.md new file mode 100644 index 00000000..95947da9 --- /dev/null +++ b/docs/Model/LeadSearchResponse.md @@ -0,0 +1,11 @@ +# # LeadSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\LeadSearchResponseAllOfData**](LeadSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/LeadSearchResponseAllOf.md b/docs/Model/LeadSearchResponseAllOf.md new file mode 100644 index 00000000..c3f35c92 --- /dev/null +++ b/docs/Model/LeadSearchResponseAllOf.md @@ -0,0 +1,10 @@ +# # LeadSearchResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\LeadSearchResponseAllOfData**](LeadSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/LeadSearchResponseAllOfData.md b/docs/Model/LeadSearchResponseAllOfData.md new file mode 100644 index 00000000..83772f92 --- /dev/null +++ b/docs/Model/LeadSearchResponseAllOfData.md @@ -0,0 +1,9 @@ +# # LeadSearchResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\LeadSearchItem[]**](LeadSearchItem.md) | The array of leads | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LeadValue.md b/docs/Model/LeadValue.md new file mode 100644 index 00000000..420fe549 --- /dev/null +++ b/docs/Model/LeadValue.md @@ -0,0 +1,10 @@ +# # LeadValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | +**currency** | **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/LinkRemoteFileToItem.md b/docs/Model/LinkRemoteFileToItem.md new file mode 100644 index 00000000..3e7ee78a --- /dev/null +++ b/docs/Model/LinkRemoteFileToItem.md @@ -0,0 +1,10 @@ +# # LinkRemoteFileToItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FileData**](FileData.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/ListActivitiesResponse.md b/docs/Model/ListActivitiesResponse.md new file mode 100644 index 00000000..38e507c5 --- /dev/null +++ b/docs/Model/ListActivitiesResponse.md @@ -0,0 +1,11 @@ +# # ListActivitiesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject[]**](ActivityResponseObject.md) | The array of activities | [optional] +**additional_data** | [**\Pipedrive\Model\ActivityDistributionDataWithAdditionalData**](ActivityDistributionDataWithAdditionalData.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/ListActivitiesResponseAllOf.md b/docs/Model/ListActivitiesResponseAllOf.md new file mode 100644 index 00000000..763dd708 --- /dev/null +++ b/docs/Model/ListActivitiesResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListActivitiesResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ActivityResponseObject[]**](ActivityResponseObject.md) | The array of activities | [optional] +**additional_data** | [**\Pipedrive\Model\ActivityDistributionDataWithAdditionalData**](ActivityDistributionDataWithAdditionalData.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/ListDealsResponse.md b/docs/Model/ListDealsResponse.md new file mode 100644 index 00000000..77d2d3be --- /dev/null +++ b/docs/Model/ListDealsResponse.md @@ -0,0 +1,12 @@ +# # ListDealsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\DealNonStrict[]**](DealNonStrict.md) | The array of deals | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListDealsResponseAllOfRelatedObjects**](ListDealsResponseAllOfRelatedObjects.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/ListDealsResponseAllOf.md b/docs/Model/ListDealsResponseAllOf.md new file mode 100644 index 00000000..594f5dc4 --- /dev/null +++ b/docs/Model/ListDealsResponseAllOf.md @@ -0,0 +1,11 @@ +# # ListDealsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\DealNonStrict[]**](DealNonStrict.md) | The array of deals | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListDealsResponseAllOfRelatedObjects**](ListDealsResponseAllOfRelatedObjects.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/ListDealsResponseAllOfRelatedObjects.md b/docs/Model/ListDealsResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..905bb062 --- /dev/null +++ b/docs/Model/ListDealsResponseAllOfRelatedObjects.md @@ -0,0 +1,13 @@ +# # ListDealsResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag**](RelatedOrganizationDataWithActiveFlag.md) | | [optional] +**person** | [**\Pipedrive\Model\RelatedPersonDataWithActiveFlag**](RelatedPersonDataWithActiveFlag.md) | | [optional] +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.md) | | [optional] +**stage** | [**\Pipedrive\Model\BaseStage**](BaseStage.md) | | [optional] +**pipeline** | [**\Pipedrive\Model\BasePipeline**](BasePipeline.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/ListFilesResponse.md b/docs/Model/ListFilesResponse.md new file mode 100644 index 00000000..146eaae5 --- /dev/null +++ b/docs/Model/ListFilesResponse.md @@ -0,0 +1,11 @@ +# # ListFilesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\FileItem[]**](FileItem.md) | The array of files | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListFilesResponseAllOf.md b/docs/Model/ListFilesResponseAllOf.md new file mode 100644 index 00000000..4b8112e8 --- /dev/null +++ b/docs/Model/ListFilesResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListFilesResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\FileItem[]**](FileItem.md) | The array of files | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListFollowersResponse.md b/docs/Model/ListFollowersResponse.md new file mode 100644 index 00000000..65b85be2 --- /dev/null +++ b/docs/Model/ListFollowersResponse.md @@ -0,0 +1,11 @@ +# # ListFollowersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ListFollowersResponseAllOfData[]**](ListFollowersResponseAllOfData.md) | The list of followers | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListFollowersResponseAllOf.md b/docs/Model/ListFollowersResponseAllOf.md new file mode 100644 index 00000000..87f79a2f --- /dev/null +++ b/docs/Model/ListFollowersResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListFollowersResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ListFollowersResponseAllOfData[]**](ListFollowersResponseAllOfData.md) | The list of followers | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListFollowersResponseAllOfData.md b/docs/Model/ListFollowersResponseAllOfData.md new file mode 100644 index 00000000..da70498a --- /dev/null +++ b/docs/Model/ListFollowersResponseAllOfData.md @@ -0,0 +1,12 @@ +# # ListFollowersResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | [optional] +**id** | **int** | The ID of the user follower | [optional] +**deal_id** | **int** | The ID of the deal which the follower was added to | [optional] +**add_time** | **string** | The date and time when the follower was added to the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListMailMessagesResponse.md b/docs/Model/ListMailMessagesResponse.md new file mode 100644 index 00000000..9fa33246 --- /dev/null +++ b/docs/Model/ListMailMessagesResponse.md @@ -0,0 +1,11 @@ +# # ListMailMessagesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ListMailMessagesResponseAllOfData[]**](ListMailMessagesResponseAllOfData.md) | The array of mail messages | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListMailMessagesResponseAllOf.md b/docs/Model/ListMailMessagesResponseAllOf.md new file mode 100644 index 00000000..be014592 --- /dev/null +++ b/docs/Model/ListMailMessagesResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListMailMessagesResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ListMailMessagesResponseAllOfData[]**](ListMailMessagesResponseAllOfData.md) | The array of mail messages | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListMailMessagesResponseAllOfData.md b/docs/Model/ListMailMessagesResponseAllOfData.md new file mode 100644 index 00000000..327f56ba --- /dev/null +++ b/docs/Model/ListMailMessagesResponseAllOfData.md @@ -0,0 +1,11 @@ +# # ListMailMessagesResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | The type of the data item | [optional] +**timestamp** | **string** | The date and time when the item was created | [optional] +**data** | [**\Pipedrive\Model\MailMessageItemForList**](MailMessageItemForList.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/ListPermittedUsersResponse.md b/docs/Model/ListPermittedUsersResponse.md new file mode 100644 index 00000000..3e6f4939 --- /dev/null +++ b/docs/Model/ListPermittedUsersResponse.md @@ -0,0 +1,10 @@ +# # ListPermittedUsersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ListPermittedUsersResponseAllOfData**](ListPermittedUsersResponseAllOfData.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/ListPermittedUsersResponse1.md b/docs/Model/ListPermittedUsersResponse1.md new file mode 100644 index 00000000..67bfd13a --- /dev/null +++ b/docs/Model/ListPermittedUsersResponse1.md @@ -0,0 +1,10 @@ +# # ListPermittedUsersResponse1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | **float[]** | The list of permitted user IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListPermittedUsersResponse1AllOf.md b/docs/Model/ListPermittedUsersResponse1AllOf.md new file mode 100644 index 00000000..ee886ff1 --- /dev/null +++ b/docs/Model/ListPermittedUsersResponse1AllOf.md @@ -0,0 +1,9 @@ +# # ListPermittedUsersResponse1AllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **float[]** | The list of permitted user IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListPermittedUsersResponseAllOf.md b/docs/Model/ListPermittedUsersResponseAllOf.md new file mode 100644 index 00000000..fc310976 --- /dev/null +++ b/docs/Model/ListPermittedUsersResponseAllOf.md @@ -0,0 +1,9 @@ +# # ListPermittedUsersResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ListPermittedUsersResponseAllOfData**](ListPermittedUsersResponseAllOfData.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/ListPermittedUsersResponseAllOfData.md b/docs/Model/ListPermittedUsersResponseAllOfData.md new file mode 100644 index 00000000..0c3c03ea --- /dev/null +++ b/docs/Model/ListPermittedUsersResponseAllOfData.md @@ -0,0 +1,9 @@ +# # ListPermittedUsersResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int[]** | The list of permitted users IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListPersonProductsResponse.md b/docs/Model/ListPersonProductsResponse.md new file mode 100644 index 00000000..d7a27ee0 --- /dev/null +++ b/docs/Model/ListPersonProductsResponse.md @@ -0,0 +1,11 @@ +# # ListPersonProductsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ListPersonProductsResponseAllOfData[]**](ListPersonProductsResponseAllOfData.md) | The array of deal products | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ListPersonProductsResponseAllOf.md b/docs/Model/ListPersonProductsResponseAllOf.md new file mode 100644 index 00000000..49db050f --- /dev/null +++ b/docs/Model/ListPersonProductsResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListPersonProductsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ListPersonProductsResponseAllOfData[]**](ListPersonProductsResponseAllOfData.md) | The array of deal products | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ListPersonProductsResponseAllOfDEALID.md b/docs/Model/ListPersonProductsResponseAllOfDEALID.md new file mode 100644 index 00000000..cf8582fb --- /dev/null +++ b/docs/Model/ListPersonProductsResponseAllOfDEALID.md @@ -0,0 +1,10 @@ +# # ListPersonProductsResponseAllOfDEALID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal** | [**\Pipedrive\Model\ProductBaseDeal**](ProductBaseDeal.md) | | [optional] +**product** | [**\Pipedrive\Model\PersonListProduct**](PersonListProduct.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/ListPersonProductsResponseAllOfData.md b/docs/Model/ListPersonProductsResponseAllOfData.md new file mode 100644 index 00000000..545ca0e9 --- /dev/null +++ b/docs/Model/ListPersonProductsResponseAllOfData.md @@ -0,0 +1,9 @@ +# # ListPersonProductsResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal_id** | [**\Pipedrive\Model\ListPersonProductsResponseAllOfDEALID**](ListPersonProductsResponseAllOfDEALID.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/ListPersonsResponse.md b/docs/Model/ListPersonsResponse.md new file mode 100644 index 00000000..9e23abd3 --- /dev/null +++ b/docs/Model/ListPersonsResponse.md @@ -0,0 +1,12 @@ +# # ListPersonsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonItem[]**](PersonItem.md) | The array of persons | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects**](ListPersonsResponseAllOfRelatedObjects.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/ListPersonsResponseAllOf.md b/docs/Model/ListPersonsResponseAllOf.md new file mode 100644 index 00000000..3039aa74 --- /dev/null +++ b/docs/Model/ListPersonsResponseAllOf.md @@ -0,0 +1,11 @@ +# # ListPersonsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PersonItem[]**](PersonItem.md) | The array of persons | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects**](ListPersonsResponseAllOfRelatedObjects.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/ListPersonsResponseAllOfRelatedObjects.md b/docs/Model/ListPersonsResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..7eccc603 --- /dev/null +++ b/docs/Model/ListPersonsResponseAllOfRelatedObjects.md @@ -0,0 +1,10 @@ +# # ListPersonsResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag**](RelatedOrganizationDataWithActiveFlag.md) | | [optional] +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.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/ListProductAdditionalData.md b/docs/Model/ListProductAdditionalData.md new file mode 100644 index 00000000..613a67b9 --- /dev/null +++ b/docs/Model/ListProductAdditionalData.md @@ -0,0 +1,13 @@ +# # ListProductAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**products_quantity_total** | **int** | The total quantity of the products | [optional] +**products_sum_total** | **int** | The total sum of the products | [optional] +**products_quantity_total_formatted** | **string** | The total formatted quantity of the products | [optional] +**products_sum_total_formatted** | **string** | The total formatted sum of the products | [optional] +**pagination** | [**\Pipedrive\Model\ItemSearchAdditionalDataPagination**](ItemSearchAdditionalDataPagination.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/ListProductAdditionalDataAllOf.md b/docs/Model/ListProductAdditionalDataAllOf.md new file mode 100644 index 00000000..5c4e48f0 --- /dev/null +++ b/docs/Model/ListProductAdditionalDataAllOf.md @@ -0,0 +1,12 @@ +# # ListProductAdditionalDataAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**products_quantity_total** | **int** | The total quantity of the products | [optional] +**products_sum_total** | **int** | The total sum of the products | [optional] +**products_quantity_total_formatted** | **string** | The total formatted quantity of the products | [optional] +**products_sum_total_formatted** | **string** | The total formatted sum of the products | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListProductFilesResponse.md b/docs/Model/ListProductFilesResponse.md new file mode 100644 index 00000000..55c1741f --- /dev/null +++ b/docs/Model/ListProductFilesResponse.md @@ -0,0 +1,11 @@ +# # ListProductFilesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ProductFileItem[]**](ProductFileItem.md) | The array of files | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListProductFilesResponseAllOf.md b/docs/Model/ListProductFilesResponseAllOf.md new file mode 100644 index 00000000..352d739f --- /dev/null +++ b/docs/Model/ListProductFilesResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListProductFilesResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ProductFileItem[]**](ProductFileItem.md) | The array of files | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListProductFollowersResponse.md b/docs/Model/ListProductFollowersResponse.md new file mode 100644 index 00000000..5aa23bf5 --- /dev/null +++ b/docs/Model/ListProductFollowersResponse.md @@ -0,0 +1,11 @@ +# # ListProductFollowersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ListProductFollowersResponseAllOfData[]**](ListProductFollowersResponseAllOfData.md) | The list of followers | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListProductFollowersResponseAllOf.md b/docs/Model/ListProductFollowersResponseAllOf.md new file mode 100644 index 00000000..191d0ba0 --- /dev/null +++ b/docs/Model/ListProductFollowersResponseAllOf.md @@ -0,0 +1,10 @@ +# # ListProductFollowersResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ListProductFollowersResponseAllOfData[]**](ListProductFollowersResponseAllOfData.md) | The list of followers | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/ListProductFollowersResponseAllOfData.md b/docs/Model/ListProductFollowersResponseAllOfData.md new file mode 100644 index 00000000..6ce26dc8 --- /dev/null +++ b/docs/Model/ListProductFollowersResponseAllOfData.md @@ -0,0 +1,12 @@ +# # ListProductFollowersResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user | [optional] +**id** | **int** | The ID of the user follower | [optional] +**product_id** | **int** | The ID of the product | [optional] +**add_time** | **string** | The date and time when the follower was added to the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListProductsResponse.md b/docs/Model/ListProductsResponse.md new file mode 100644 index 00000000..dc6c0e3c --- /dev/null +++ b/docs/Model/ListProductsResponse.md @@ -0,0 +1,12 @@ +# # ListProductsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ListProductsResponseAllOfData**](ListProductsResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ListProductAdditionalData**](ListProductAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects**](ListProductsResponseAllOfRelatedObjects.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/ListProductsResponseAllOf.md b/docs/Model/ListProductsResponseAllOf.md new file mode 100644 index 00000000..55a17fda --- /dev/null +++ b/docs/Model/ListProductsResponseAllOf.md @@ -0,0 +1,11 @@ +# # ListProductsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ListProductsResponseAllOfData**](ListProductsResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ListProductAdditionalData**](ListProductAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects**](ListProductsResponseAllOfRelatedObjects.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/ListProductsResponseAllOfData.md b/docs/Model/ListProductsResponseAllOfData.md new file mode 100644 index 00000000..298b7917 --- /dev/null +++ b/docs/Model/ListProductsResponseAllOfData.md @@ -0,0 +1,9 @@ +# # ListProductsResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\ProductListItem[]**](ProductListItem.md) | The array of products | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListProductsResponseAllOfRelatedObjects.md b/docs/Model/ListProductsResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..1ae267de --- /dev/null +++ b/docs/Model/ListProductsResponseAllOfRelatedObjects.md @@ -0,0 +1,9 @@ +# # ListProductsResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.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/MailMessage.md b/docs/Model/MailMessage.md new file mode 100644 index 00000000..5590185f --- /dev/null +++ b/docs/Model/MailMessage.md @@ -0,0 +1,13 @@ +# # MailMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**status_code** | **int** | The email service specific status code and it is returned through the response body. | [optional] +**status_text** | **string** | The status text of the response. | [optional] +**service** | **string** | The service name of the response. | [optional] +**data** | [**\Pipedrive\Model\MailMessageData**](MailMessageData.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/MailMessageAllOf.md b/docs/Model/MailMessageAllOf.md new file mode 100644 index 00000000..6d45729d --- /dev/null +++ b/docs/Model/MailMessageAllOf.md @@ -0,0 +1,9 @@ +# # MailMessageAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\MailMessageData**](MailMessageData.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/MailMessageData.md b/docs/Model/MailMessageData.md new file mode 100644 index 00000000..f401c646 --- /dev/null +++ b/docs/Model/MailMessageData.md @@ -0,0 +1,36 @@ +# # MailMessageData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail message. | [optional] +**from** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message sender (object) | [optional] +**to** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message receiver (object) | [optional] +**cc** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message copies (object) | [optional] +**bcc** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message blind copies (object) | [optional] +**body_url** | **string** | The mail message body URL | [optional] +**account_id** | **string** | The connection account ID | [optional] +**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] +**mail_thread_id** | **int** | ID of the mail message thread | [optional] +**subject** | **string** | The subject of mail message | [optional] +**snippet** | **string** | The snippet of mail message. Snippet length is up to 225 characters. | [optional] +**mail_tracking_status** | **string** | The status of tracking mail message. Value is `null` if tracking is not enabled. | [optional] +**mail_link_tracking_enabled_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the link tracking in mail message body is enabled. | [optional] +**read_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is read or not by the user | [optional] +**draft** | **string** | If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. | [optional] +**draft_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is a draft or not | [optional] +**synced_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is synced with the provider or not | [optional] +**deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is deleted or not | [optional] +**has_body_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has a body or not | [optional] +**sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has been sent or not | [optional] +**sent_from_pipedrive_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has been sent from Pipedrive app or not | [optional] +**smart_bcc_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has been created by Smart Email BCC feature or not | [optional] +**message_time** | **\DateTime** | Creation or receival time of the mail message | [optional] +**add_time** | **\DateTime** | The insertion into the database time of the mail message | [optional] +**update_time** | **\DateTime** | The updating time in the database of the mail message | [optional] +**has_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has an attachment or not | [optional] +**has_inline_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has an inline attachment or not | [optional] +**has_real_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has an attachment (which is not inline) 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/MailMessageItemForList.md b/docs/Model/MailMessageItemForList.md new file mode 100644 index 00000000..a5b7c69c --- /dev/null +++ b/docs/Model/MailMessageItemForList.md @@ -0,0 +1,45 @@ +# # MailMessageItemForList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail message. | [optional] +**from** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message sender (object) | [optional] +**to** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message receiver (object) | [optional] +**cc** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message copies (object) | [optional] +**bcc** | [**\Pipedrive\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message blind copies (object) | [optional] +**body_url** | **string** | The mail message body URL | [optional] +**account_id** | **string** | The connection account ID | [optional] +**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional] +**mail_thread_id** | **int** | ID of the mail message thread | [optional] +**subject** | **string** | The subject of mail message | [optional] +**snippet** | **string** | The snippet of mail message. Snippet length is up to 225 characters. | [optional] +**mail_tracking_status** | **string** | The status of tracking mail message. Value is `null` if tracking is not enabled. | [optional] +**mail_link_tracking_enabled_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the link tracking in mail message body is enabled. | [optional] +**read_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is read or not by the user | [optional] +**draft** | **string** | If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. | [optional] +**draft_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is a draft or not | [optional] +**synced_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is synced with the provider or not | [optional] +**deleted_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message is deleted or not | [optional] +**has_body_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has a body or not | [optional] +**sent_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has been sent or not | [optional] +**sent_from_pipedrive_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has been sent from Pipedrive app or not | [optional] +**smart_bcc_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has been created by Smart Email BCC feature or not | [optional] +**message_time** | **\DateTime** | Creation or receival time of the mail message | [optional] +**add_time** | **\DateTime** | The insertion into the database time of the mail message | [optional] +**update_time** | **\DateTime** | The updating time in the database of the mail message | [optional] +**has_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has an attachment or not | [optional] +**has_inline_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has an inline attachment or not | [optional] +**has_real_attachments_flag** | [**NumberBooleanDefault0**](NumberBooleanDefault0.md) | Whether the mail message has an attachment (which is not inline) or not | [optional] +**nylas_id** | **string** | The Mail Message ID assigned by the sync provider | [optional] +**s3_bucket** | **string** | The name of the S3 bucket | [optional] +**s3_bucket_path** | **string** | The path of the S3 bucket | [optional] +**external_deleted_flag** | **bool** | If the Mail Message has been deleted on the provider side or not | [optional] +**mua_message_id** | **string** | The Mail Message ID assigned by the mail user agent | [optional] +**template_id** | **int** | The ID of the mail template | [optional] +**timestamp** | **string** | The add date and time of the Mail Message | [optional] +**item_type** | **string** | The type of the data item | [optional] +**company_id** | **int** | The ID of the company | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailMessageItemForListAllOf.md b/docs/Model/MailMessageItemForListAllOf.md new file mode 100644 index 00000000..a725a5e5 --- /dev/null +++ b/docs/Model/MailMessageItemForListAllOf.md @@ -0,0 +1,17 @@ +# # MailMessageItemForListAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nylas_id** | **string** | The Mail Message ID assigned by the sync provider | [optional] +**s3_bucket** | **string** | The name of the S3 bucket | [optional] +**s3_bucket_path** | **string** | The path of the S3 bucket | [optional] +**external_deleted_flag** | **bool** | If the Mail Message has been deleted on the provider side or not | [optional] +**mua_message_id** | **string** | The Mail Message ID assigned by the mail user agent | [optional] +**template_id** | **int** | The ID of the mail template | [optional] +**timestamp** | **string** | The add date and time of the Mail Message | [optional] +**item_type** | **string** | The type of the data item | [optional] +**company_id** | **int** | The ID of the company | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailParticipant.md b/docs/Model/MailParticipant.md new file mode 100644 index 00000000..f372469a --- /dev/null +++ b/docs/Model/MailParticipant.md @@ -0,0 +1,14 @@ +# # MailParticipant + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail participant | [optional] +**email_address** | **string** | Mail address of the mail participant | [optional] +**name** | **string** | Name of the mail participant | [optional] +**linked_person_id** | **int** | ID of the linked person to the mail message | [optional] +**linked_person_name** | **string** | Name of the linked person to the mail message | [optional] +**mail_message_party_id** | **int** | ID of the mail message participant | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailServiceBaseResponse.md b/docs/Model/MailServiceBaseResponse.md new file mode 100644 index 00000000..1d8f8033 --- /dev/null +++ b/docs/Model/MailServiceBaseResponse.md @@ -0,0 +1,12 @@ +# # MailServiceBaseResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**status_code** | **int** | The email service specific status code and it is returned through the response body. | [optional] +**status_text** | **string** | The status text of the response. | [optional] +**service** | **string** | The service name of the response. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThread.md b/docs/Model/MailThread.md new file mode 100644 index 00000000..3a52d5a0 --- /dev/null +++ b/docs/Model/MailThread.md @@ -0,0 +1,10 @@ +# # MailThread + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseMailThread[]**](BaseMailThread.md) | The array of mail threads | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadAllOf.md b/docs/Model/MailThreadAllOf.md new file mode 100644 index 00000000..354a2241 --- /dev/null +++ b/docs/Model/MailThreadAllOf.md @@ -0,0 +1,9 @@ +# # MailThreadAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseMailThread[]**](BaseMailThread.md) | The array of mail threads | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadDelete.md b/docs/Model/MailThreadDelete.md new file mode 100644 index 00000000..6c1e7e1b --- /dev/null +++ b/docs/Model/MailThreadDelete.md @@ -0,0 +1,10 @@ +# # MailThreadDelete + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\MailThreadDeleteAllOfData**](MailThreadDeleteAllOfData.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/MailThreadDeleteAllOf.md b/docs/Model/MailThreadDeleteAllOf.md new file mode 100644 index 00000000..01b0a58e --- /dev/null +++ b/docs/Model/MailThreadDeleteAllOf.md @@ -0,0 +1,9 @@ +# # MailThreadDeleteAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\MailThreadDeleteAllOfData**](MailThreadDeleteAllOfData.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/MailThreadDeleteAllOfData.md b/docs/Model/MailThreadDeleteAllOfData.md new file mode 100644 index 00000000..9c65fb2c --- /dev/null +++ b/docs/Model/MailThreadDeleteAllOfData.md @@ -0,0 +1,9 @@ +# # MailThreadDeleteAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deleted mail thread | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadMessages.md b/docs/Model/MailThreadMessages.md new file mode 100644 index 00000000..9468edd8 --- /dev/null +++ b/docs/Model/MailThreadMessages.md @@ -0,0 +1,10 @@ +# # MailThreadMessages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseMailThreadMessages[]**](BaseMailThreadMessages.md) | The array of the mail messages of the mail thread | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadMessagesAllOf.md b/docs/Model/MailThreadMessagesAllOf.md new file mode 100644 index 00000000..f2a9d27e --- /dev/null +++ b/docs/Model/MailThreadMessagesAllOf.md @@ -0,0 +1,9 @@ +# # MailThreadMessagesAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseMailThreadMessages[]**](BaseMailThreadMessages.md) | The array of the mail messages of the mail thread | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadOne.md b/docs/Model/MailThreadOne.md new file mode 100644 index 00000000..73550d2e --- /dev/null +++ b/docs/Model/MailThreadOne.md @@ -0,0 +1,10 @@ +# # MailThreadOne + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**BaseMailThread**](BaseMailThread.md) | The mail thread object | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadOneAllOf.md b/docs/Model/MailThreadOneAllOf.md new file mode 100644 index 00000000..837b93f2 --- /dev/null +++ b/docs/Model/MailThreadOneAllOf.md @@ -0,0 +1,9 @@ +# # MailThreadOneAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**BaseMailThread**](BaseMailThread.md) | The mail thread object | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailThreadParticipant.md b/docs/Model/MailThreadParticipant.md new file mode 100644 index 00000000..cfb580eb --- /dev/null +++ b/docs/Model/MailThreadParticipant.md @@ -0,0 +1,17 @@ +# # MailThreadParticipant + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the mail thread participant | [optional] +**name** | **string** | Name of the mail thread participant | [optional] +**latest_sent** | **bool** | Whether the mail thread participant was last to send an email | [optional] +**email_address** | **string** | Email address of the mail thread participant | [optional] +**message_time** | **float** | Message time | [optional] +**linked_person_id** | **int** | ID of the linked person | [optional] +**linked_person_name** | **string** | Email of the linked person | [optional] +**mail_message_party_id** | **int** | ID of the mail message party | [optional] +**linked_organization_id** | **int** | Linked Organization 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/MailThreadPut.md b/docs/Model/MailThreadPut.md new file mode 100644 index 00000000..f9406fcf --- /dev/null +++ b/docs/Model/MailThreadPut.md @@ -0,0 +1,10 @@ +# # MailThreadPut + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseMailThread**](BaseMailThread.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/MailThreadPutAllOf.md b/docs/Model/MailThreadPutAllOf.md new file mode 100644 index 00000000..80599071 --- /dev/null +++ b/docs/Model/MailThreadPutAllOf.md @@ -0,0 +1,9 @@ +# # MailThreadPutAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseMailThread**](BaseMailThread.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/MarketingStatus.md b/docs/Model/MarketingStatus.md new file mode 100644 index 00000000..a5fc8abe --- /dev/null +++ b/docs/Model/MarketingStatus.md @@ -0,0 +1,8 @@ +# # MarketingStatus + +## 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/MergeDealsRequest.md b/docs/Model/MergeDealsRequest.md new file mode 100644 index 00000000..c62bf7c5 --- /dev/null +++ b/docs/Model/MergeDealsRequest.md @@ -0,0 +1,9 @@ +# # MergeDealsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merge_with_id** | **int** | The ID of the deal that the deal will be merged with | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MergeOrganizationsRequest.md b/docs/Model/MergeOrganizationsRequest.md new file mode 100644 index 00000000..1d677ac3 --- /dev/null +++ b/docs/Model/MergeOrganizationsRequest.md @@ -0,0 +1,9 @@ +# # MergeOrganizationsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merge_with_id** | **int** | The ID of the organization that the organization will be merged with | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MergePersonDealRelatedInfo.md b/docs/Model/MergePersonDealRelatedInfo.md new file mode 100644 index 00000000..e0b7de51 --- /dev/null +++ b/docs/Model/MergePersonDealRelatedInfo.md @@ -0,0 +1,23 @@ +# # MergePersonDealRelatedInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**participant_open_deals_count** | **int** | The count of open participant deals related with the item | [optional] +**participant_closed_deals_count** | **int** | The count of closed participant deals related with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MergePersonItem.md b/docs/Model/MergePersonItem.md new file mode 100644 index 00000000..814c30f9 --- /dev/null +++ b/docs/Model/MergePersonItem.md @@ -0,0 +1,52 @@ +# # MergePersonItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person | [optional] +**company_id** | **int** | The ID of the company related to the person | [optional] +**active_flag** | **bool** | Whether the person is active or not | [optional] +**phone** | [**\Pipedrive\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**email** | [**\Pipedrive\Model\BasePersonItemEmail[]**](BasePersonItemEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required. | [optional] +**first_char** | **string** | The first letter of the name of the person | [optional] +**add_time** | **string** | The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS | [optional] +**visible_to** | **string** | The visibility group ID of who can see the person | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithID**](PictureDataWithID.md) | | [optional] +**label** | **int** | The label assigned to the person | [optional] +**org_name** | **string** | The name of the organization associated with the person | [optional] +**owner_name** | **string** | The name of the owner associated with the person | [optional] +**cc_email** | **string** | The BCC email associated with the person | [optional] +**owner_id** | **int** | The ID of the owner related to the person | [optional] +**org_id** | **int** | The ID of the organization related to the person | [optional] +**merge_what_id** | **int** | The ID of the person with what the main person was merged | [optional] +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**participant_open_deals_count** | **int** | The count of open participant deals related with the item | [optional] +**participant_closed_deals_count** | **int** | The count of closed participant deals related with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MergePersonsRequest.md b/docs/Model/MergePersonsRequest.md new file mode 100644 index 00000000..610c710a --- /dev/null +++ b/docs/Model/MergePersonsRequest.md @@ -0,0 +1,9 @@ +# # MergePersonsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merge_with_id** | **int** | The ID of the person that will not be overwritten. This person’s data will be prioritized in case of conflict with the other person. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MergePersonsResponse.md b/docs/Model/MergePersonsResponse.md new file mode 100644 index 00000000..10ebe8df --- /dev/null +++ b/docs/Model/MergePersonsResponse.md @@ -0,0 +1,10 @@ +# # MergePersonsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\MergePersonItem**](MergePersonItem.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/MergePersonsResponseAllOf.md b/docs/Model/MergePersonsResponseAllOf.md new file mode 100644 index 00000000..e63da79b --- /dev/null +++ b/docs/Model/MergePersonsResponseAllOf.md @@ -0,0 +1,9 @@ +# # MergePersonsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\MergePersonItem**](MergePersonItem.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/MessageObject.md b/docs/Model/MessageObject.md new file mode 100644 index 00000000..d7da81e8 --- /dev/null +++ b/docs/Model/MessageObject.md @@ -0,0 +1,18 @@ +# # MessageObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of the message | +**channel_id** | **string** | The channel ID as in the provider | +**sender_id** | **string** | The ID of the provider's user that sent the message | +**conversation_id** | **string** | The ID of the conversation | +**message** | **string** | The body of the message | +**status** | **string** | The status of the message | +**created_at** | **\DateTime** | The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM | +**reply_by** | **\DateTime** | The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM | [optional] +**conversation_link** | **string** | A URL that can open the conversation in the provider's side | [optional] +**attachments** | [**\Pipedrive\Model\MessageObjectAttachments[]**](MessageObjectAttachments.md) | The list of attachments available in the message | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MessageObjectAttachments.md b/docs/Model/MessageObjectAttachments.md new file mode 100644 index 00000000..8e859242 --- /dev/null +++ b/docs/Model/MessageObjectAttachments.md @@ -0,0 +1,15 @@ +# # MessageObjectAttachments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of the attachment | +**type** | **string** | The mime-type of the attachment | +**name** | **string** | The name of the attachment | [optional] +**size** | **float** | The size of the attachment | [optional] +**url** | **string** | A URL to the file | +**preview_url** | **string** | A URL to a preview picture of the file | [optional] +**link_expires** | **bool** | If true, it will use the getMessageById endpoint for fetching updated attachment's urls. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension) | [optional] [default to false] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewDeal.md b/docs/Model/NewDeal.md new file mode 100644 index 00000000..19a422b4 --- /dev/null +++ b/docs/Model/NewDeal.md @@ -0,0 +1,22 @@ +# # NewDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the deal | +**value** | **string** | The value of the deal. If omitted, value will be set to 0. | [optional] +**currency** | **string** | The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. | [optional] +**user_id** | **int** | The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. | [optional] +**person_id** | **int** | The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. | [optional] +**org_id** | **int** | The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. | [optional] +**pipeline_id** | **int** | The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. | [optional] +**stage_id** | **int** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. | [optional] +**status** | **string** | open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional] +**probability** | **float** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional] +**lost_reason** | **string** | The optional message about why the deal was lost (to be used when status = lost) | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**add_time** | **string** | The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewDealAllOf.md b/docs/Model/NewDealAllOf.md new file mode 100644 index 00000000..a5fc4bb9 --- /dev/null +++ b/docs/Model/NewDealAllOf.md @@ -0,0 +1,9 @@ +# # NewDealAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add_time** | **string** | The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewDealProduct.md b/docs/Model/NewDealProduct.md new file mode 100644 index 00000000..695f9dea --- /dev/null +++ b/docs/Model/NewDealProduct.md @@ -0,0 +1,18 @@ +# # NewDealProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | The ID of the product to use | +**item_price** | **float** | The price at which this product will be added to the deal | +**quantity** | **int** | Quantity – e.g. how many items of this product will be added to the deal | +**discount_percentage** | **float** | The discount %. If omitted, will be set to 0. | [optional] [default to 0] +**duration** | **float** | The duration of the product. If omitted, will be set to 1. | [optional] [default to 1] +**duration_unit** | [**DealProductUnitDuration**](DealProductUnitDuration.md) | The unit duration of the product | [optional] +**product_variation_id** | **int** | The ID of the product variation to use. When omitted, no variation will be used. | [optional] +**comments** | **string** | A textual comment associated with this product-deal attachment | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**enabled_flag** | **bool** | Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewFollowerResponse.md b/docs/Model/NewFollowerResponse.md new file mode 100644 index 00000000..c005e25f --- /dev/null +++ b/docs/Model/NewFollowerResponse.md @@ -0,0 +1,10 @@ +# # NewFollowerResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\NewFollowerResponseData**](NewFollowerResponseData.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/NewFollowerResponseData.md b/docs/Model/NewFollowerResponseData.md new file mode 100644 index 00000000..37d2d3a3 --- /dev/null +++ b/docs/Model/NewFollowerResponseData.md @@ -0,0 +1,12 @@ +# # NewFollowerResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user that was added as follower | [optional] +**id** | **int** | The ID of the follower | [optional] +**product_id** | **int** | The ID of the product | [optional] +**add_time** | **string** | The follower creation time. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewGoal.md b/docs/Model/NewGoal.md new file mode 100644 index 00000000..66824408 --- /dev/null +++ b/docs/Model/NewGoal.md @@ -0,0 +1,14 @@ +# # NewGoal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the goal | [optional] +**assignee** | **object** | Who this goal is assigned to. It requires the following JSON structure: `{ \"id\": \"1\", \"type\": \"person\" }`. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. | +**type** | **object** | The type of the goal. It requires the following JSON structure: `{ \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }`. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.” | +**expected_outcome** | **object** | The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: `{ \"target\": \"50\", \"tracking_metric\": \"quantity\" }` or `{ \"target\": \"50\", \"tracking_metric\": \"sum\", \"currency_id\": 1 }`. `currency_id` should only be added to `sum` type of goals. | +**duration** | **object** | The date when the goal starts and ends. It requires the following JSON structure: `{ \"start\": \"2019-01-01\", \"end\": \"2022-12-31\" }`. Date in format of YYYY-MM-DD. \"end\" can be set to `null` for an infinite, open-ended goal. | +**interval** | **string** | The interval of the goal | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewOrganization.md b/docs/Model/NewOrganization.md new file mode 100644 index 00000000..a15f2196 --- /dev/null +++ b/docs/Model/NewOrganization.md @@ -0,0 +1,12 @@ +# # NewOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization | +**add_time** | **string** | The optional creation date & time of the organization in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></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/NewOrganizationAllOf.md b/docs/Model/NewOrganizationAllOf.md new file mode 100644 index 00000000..31fd0fc4 --- /dev/null +++ b/docs/Model/NewOrganizationAllOf.md @@ -0,0 +1,10 @@ +# # NewOrganizationAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization | +**add_time** | **string** | The optional creation date & time of the organization in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewPerson.md b/docs/Model/NewPerson.md new file mode 100644 index 00000000..9b6663aa --- /dev/null +++ b/docs/Model/NewPerson.md @@ -0,0 +1,16 @@ +# # NewPerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | +**owner_id** | **int** | The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. | [optional] +**org_id** | **int** | The ID of the organization this person will belong to | [optional] +**email** | [**\Pipedrive\Model\BasicPersonEmail[]**](BasicPersonEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. | [optional] +**phone** | [**\Pipedrive\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**marketing_status** | [**MarketingStatus**](MarketingStatus.md) | If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> | [optional] +**add_time** | **string** | The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewPersonAllOf.md b/docs/Model/NewPersonAllOf.md new file mode 100644 index 00000000..27a0dd17 --- /dev/null +++ b/docs/Model/NewPersonAllOf.md @@ -0,0 +1,9 @@ +# # NewPersonAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NewProductField.md b/docs/Model/NewProductField.md new file mode 100644 index 00000000..9bf786ea --- /dev/null +++ b/docs/Model/NewProductField.md @@ -0,0 +1,11 @@ +# # NewProductField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the field | +**options** | **object[]** | When `field_type` is either `set` or `enum`, possible options must be supplied as a JSON-encoded sequential array, for example:</br>`[{\"label\":\"red\"}, {\"label\":\"blue\"}, {\"label\":\"lilac\"}]` | [optional] +**field_type** | **string** | The type of the field<table><tr><th>Value</th><th>Description</th></tr><tr><td>`varchar`</td><td>Text (up to 255 characters)</td><tr><td>`varchar_auto`</td><td>Autocomplete text (up to 255 characters)</td><tr><td>`text`</td><td>Long text (up to 65k characters)</td><tr><td>`double`</td><td>Numeric value</td><tr><td>`monetary`</td><td>Monetary field (has a numeric value and a currency value)</td><tr><td>`date`</td><td>Date (format YYYY-MM-DD)</td><tr><td>`set`</td><td>Options field with a possibility of having multiple chosen options</td><tr><td>`enum`</td><td>Options field with a single possible chosen option</td><tr><td>`user`</td><td>User field (contains a user ID of another Pipedrive user)</td><tr><td>`org`</td><td>Organization field (contains an organization ID which is stored on the same account)</td><tr><td>`people`</td><td>Person field (contains a product ID which is stored on the same account)</td><tr><td>`phone`</td><td>Phone field (up to 255 numbers and/or characters)</td><tr><td>`time`</td><td>Time field (format HH:MM:SS)</td><tr><td>`timerange`</td><td>Time-range field (has a start time and end time value, both HH:MM:SS)</td><tr><td>`daterange`</td><td>Date-range field (has a start date and end date value, both YYYY-MM-DD)</td><tr><td>`address`</td><td>Address field (autocompleted by Google Maps)</dd></table> | + +[[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 00000000..a6e36431 --- /dev/null +++ b/docs/Model/Note.md @@ -0,0 +1,19 @@ +# # Note + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | [optional] +**lead_id** | **string** | The ID of the lead the note will be attached to | [optional] +**deal_id** | **int** | The ID of the deal the note will be attached to | [optional] +**person_id** | **int** | The ID of the person the note will be attached to | [optional] +**org_id** | **int** | The ID of the organization the note will be attached to | [optional] +**user_id** | **int** | The ID of the user who will be marked as the author of the note. Only an admin can change the author. | [optional] +**add_time** | **string** | The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] +**pinned_to_lead_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to lead pinning state (`lead_id` is also required) | [optional] +**pinned_to_deal_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to deal pinning state (`deal_id` is also required) | [optional] +**pinned_to_organization_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to organization pinning state (`org_id` is also required) | [optional] +**pinned_to_person_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to person pinning state (`person_id` is also required) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NoteAllOf.md b/docs/Model/NoteAllOf.md new file mode 100644 index 00000000..e6d179bd --- /dev/null +++ b/docs/Model/NoteAllOf.md @@ -0,0 +1,9 @@ +# # NoteAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | **string** | The content of the note in HTML format. Subject to sanitization on the back-end. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NoteConnectToParams.md b/docs/Model/NoteConnectToParams.md new file mode 100644 index 00000000..3cb06b32 --- /dev/null +++ b/docs/Model/NoteConnectToParams.md @@ -0,0 +1,12 @@ +# # NoteConnectToParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lead_id** | **string** | The ID of the lead the note will be attached to | [optional] +**deal_id** | **int** | The ID of the deal the note will be attached to | [optional] +**person_id** | **int** | The ID of the person the note will be attached to | [optional] +**org_id** | **int** | The ID of the organization the note will be attached 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/NoteCreatorUser.md b/docs/Model/NoteCreatorUser.md new file mode 100644 index 00000000..b1025582 --- /dev/null +++ b/docs/Model/NoteCreatorUser.md @@ -0,0 +1,12 @@ +# # NoteCreatorUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | The email of the note creator | [optional] +**icon_url** | **string** | The URL of the note creator avatar picture | [optional] +**is_you** | **bool** | Whether the note is created by you or not | [optional] +**name** | **string** | The name of the note creator | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NoteField.md b/docs/Model/NoteField.md new file mode 100644 index 00000000..0f342d52 --- /dev/null +++ b/docs/Model/NoteField.md @@ -0,0 +1,17 @@ +# # NoteField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the field | [optional] +**key** | **string** | The key of the field | [optional] +**name** | **string** | The name of the field | [optional] +**field_type** | [**\Pipedrive\Model\FieldTypeAsString**](FieldTypeAsString.md) | | [optional] +**active_flag** | **bool** | The active flag of the field | [optional] +**edit_flag** | **bool** | The edit flag of the field | [optional] +**bulk_edit_allowed** | **bool** | Not used | [optional] +**mandatory_flag** | **bool** | Whether or not the field is mandatory | [optional] +**options** | [**\Pipedrive\Model\NoteFieldOptions[]**](NoteFieldOptions.md) | The options of the field. When there are no options, `null` is returned. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NoteFieldOptions.md b/docs/Model/NoteFieldOptions.md new file mode 100644 index 00000000..e82cc8a8 --- /dev/null +++ b/docs/Model/NoteFieldOptions.md @@ -0,0 +1,10 @@ +# # NoteFieldOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**label** | **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/NoteFieldsResponse.md b/docs/Model/NoteFieldsResponse.md new file mode 100644 index 00000000..e2a096c3 --- /dev/null +++ b/docs/Model/NoteFieldsResponse.md @@ -0,0 +1,11 @@ +# # NoteFieldsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\NoteField[]**](NoteField.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/NoteFieldsResponseAllOf.md b/docs/Model/NoteFieldsResponseAllOf.md new file mode 100644 index 00000000..97d47799 --- /dev/null +++ b/docs/Model/NoteFieldsResponseAllOf.md @@ -0,0 +1,10 @@ +# # NoteFieldsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\NoteField[]**](NoteField.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.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/NoteParams.md b/docs/Model/NoteParams.md new file mode 100644 index 00000000..affdfb2d --- /dev/null +++ b/docs/Model/NoteParams.md @@ -0,0 +1,14 @@ +# # NoteParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user who will be marked as the author of the note. Only an admin can change the author. | [optional] +**add_time** | **string** | The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] +**pinned_to_lead_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to lead pinning state (`lead_id` is also required) | [optional] +**pinned_to_deal_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to deal pinning state (`deal_id` is also required) | [optional] +**pinned_to_organization_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to organization pinning state (`org_id` is also required) | [optional] +**pinned_to_person_flag** | [**NumberBoolean**](NumberBoolean.md) | If set, the results are filtered by note to person pinning state (`person_id` is also required) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/NumberBoolean.md b/docs/Model/NumberBoolean.md new file mode 100644 index 00000000..acd0023c --- /dev/null +++ b/docs/Model/NumberBoolean.md @@ -0,0 +1,8 @@ +# # NumberBoolean + +## 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/NumberBooleanDefault0.md b/docs/Model/NumberBooleanDefault0.md new file mode 100644 index 00000000..f87d582e --- /dev/null +++ b/docs/Model/NumberBooleanDefault0.md @@ -0,0 +1,8 @@ +# # NumberBooleanDefault0 + +## 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/NumberBooleanDefault1.md b/docs/Model/NumberBooleanDefault1.md new file mode 100644 index 00000000..da446a38 --- /dev/null +++ b/docs/Model/NumberBooleanDefault1.md @@ -0,0 +1,8 @@ +# # NumberBooleanDefault1 + +## 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/ObjectPrices.md b/docs/Model/ObjectPrices.md new file mode 100644 index 00000000..0148d40f --- /dev/null +++ b/docs/Model/ObjectPrices.md @@ -0,0 +1,9 @@ +# # ObjectPrices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prices** | **object** | Object of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OneLeadResponse200.md b/docs/Model/OneLeadResponse200.md new file mode 100644 index 00000000..0982b42a --- /dev/null +++ b/docs/Model/OneLeadResponse200.md @@ -0,0 +1,10 @@ +# # OneLeadResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\LeadResponse**](LeadResponse.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/OptionalNameObject.md b/docs/Model/OptionalNameObject.md new file mode 100644 index 00000000..909aded4 --- /dev/null +++ b/docs/Model/OptionalNameObject.md @@ -0,0 +1,9 @@ +# # OptionalNameObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the product | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrgAndOwnerId.md b/docs/Model/OrgAndOwnerId.md new file mode 100644 index 00000000..0ac8b9c0 --- /dev/null +++ b/docs/Model/OrgAndOwnerId.md @@ -0,0 +1,10 @@ +# # OrgAndOwnerId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag**](RelationshipOrganizationInfoItemWithActiveFlag.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/OrganizationAddressInfo.md b/docs/Model/OrganizationAddressInfo.md new file mode 100644 index 00000000..b9d08ed9 --- /dev/null +++ b/docs/Model/OrganizationAddressInfo.md @@ -0,0 +1,19 @@ +# # OrganizationAddressInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **string** | The full address of the organization | [optional] +**address_subpremise** | **string** | The sub-premise of the organization location | [optional] +**address_street_number** | **string** | The street number of the organization location | [optional] +**address_route** | **string** | The route of the organization location | [optional] +**address_sublocality** | **string** | The sub-locality of the organization location | [optional] +**address_locality** | **string** | The locality of the organization location | [optional] +**address_admin_area_level_1** | **string** | The level 1 admin area of the organization location | [optional] +**address_admin_area_level_2** | **string** | The level 2 admin area of the organization location | [optional] +**address_country** | **string** | The country of the organization location | [optional] +**address_postal_code** | **string** | The postal code of the organization location | [optional] +**address_formatted_address** | **string** | The formatted organization location | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationCountAndAddressInfo.md b/docs/Model/OrganizationCountAndAddressInfo.md new file mode 100644 index 00000000..a18fc734 --- /dev/null +++ b/docs/Model/OrganizationCountAndAddressInfo.md @@ -0,0 +1,27 @@ +# # OrganizationCountAndAddressInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_messages_count** | **int** | The count of email messages related to the organization | [optional] +**people_count** | **int** | The count of persons related to the organization | [optional] +**activities_count** | **int** | The count of activities related to the organization | [optional] +**done_activities_count** | **int** | The count of done activities related to the organization | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the organization | [optional] +**files_count** | **int** | The count of files related to the organization | [optional] +**notes_count** | **int** | The count of notes related to the organization | [optional] +**followers_count** | **int** | The count of followers related to the organization | [optional] +**address** | **string** | The full address of the organization | [optional] +**address_subpremise** | **string** | The sub-premise of the organization location | [optional] +**address_street_number** | **string** | The street number of the organization location | [optional] +**address_route** | **string** | The route of the organization location | [optional] +**address_sublocality** | **string** | The sub-locality of the organization location | [optional] +**address_locality** | **string** | The locality of the organization location | [optional] +**address_admin_area_level_1** | **string** | The level 1 admin area of the organization location | [optional] +**address_admin_area_level_2** | **string** | The level 2 admin area of the organization location | [optional] +**address_country** | **string** | The country of the organization location | [optional] +**address_postal_code** | **string** | The postal code of the organization location | [optional] +**address_formatted_address** | **string** | The formatted organization location | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationCountInfo.md b/docs/Model/OrganizationCountInfo.md new file mode 100644 index 00000000..638d69cd --- /dev/null +++ b/docs/Model/OrganizationCountInfo.md @@ -0,0 +1,16 @@ +# # OrganizationCountInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_messages_count** | **int** | The count of email messages related to the organization | [optional] +**people_count** | **int** | The count of persons related to the organization | [optional] +**activities_count** | **int** | The count of activities related to the organization | [optional] +**done_activities_count** | **int** | The count of done activities related to the organization | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the organization | [optional] +**files_count** | **int** | The count of files related to the organization | [optional] +**notes_count** | **int** | The count of notes related to the organization | [optional] +**followers_count** | **int** | The count of followers related to the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationData.md b/docs/Model/OrganizationData.md new file mode 100644 index 00000000..36306b36 --- /dev/null +++ b/docs/Model/OrganizationData.md @@ -0,0 +1,13 @@ +# # OrganizationData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization associated with the item | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the item | [optional] +**address** | **string** | The address of the organization | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationDataWithId.md b/docs/Model/OrganizationDataWithId.md new file mode 100644 index 00000000..b1145264 --- /dev/null +++ b/docs/Model/OrganizationDataWithId.md @@ -0,0 +1,14 @@ +# # OrganizationDataWithId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization associated with the item | [optional] +**name** | **string** | The name of the organization associated with the item | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the item | [optional] +**address** | **string** | The address of the organization | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationDataWithIdAllOf.md b/docs/Model/OrganizationDataWithIdAllOf.md new file mode 100644 index 00000000..f6c3d63c --- /dev/null +++ b/docs/Model/OrganizationDataWithIdAllOf.md @@ -0,0 +1,9 @@ +# # OrganizationDataWithIdAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationDataWithIdAndActiveFlag.md b/docs/Model/OrganizationDataWithIdAndActiveFlag.md new file mode 100644 index 00000000..99153356 --- /dev/null +++ b/docs/Model/OrganizationDataWithIdAndActiveFlag.md @@ -0,0 +1,15 @@ +# # OrganizationDataWithIdAndActiveFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the associated organization is active or not | [optional] +**id** | **int** | The ID of the organization associated with the item | [optional] +**name** | **string** | The name of the organization associated with the item | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the item | [optional] +**address** | **string** | The address of the organization | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationDataWithIdAndActiveFlagAllOf.md b/docs/Model/OrganizationDataWithIdAndActiveFlagAllOf.md new file mode 100644 index 00000000..f7adba83 --- /dev/null +++ b/docs/Model/OrganizationDataWithIdAndActiveFlagAllOf.md @@ -0,0 +1,9 @@ +# # OrganizationDataWithIdAndActiveFlagAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the associated organization is active 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/OrganizationDeleteResponse.md b/docs/Model/OrganizationDeleteResponse.md new file mode 100644 index 00000000..0fb1aba9 --- /dev/null +++ b/docs/Model/OrganizationDeleteResponse.md @@ -0,0 +1,10 @@ +# # OrganizationDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationDeleteResponseData**](OrganizationDeleteResponseData.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/OrganizationDeleteResponseData.md b/docs/Model/OrganizationDeleteResponseData.md new file mode 100644 index 00000000..0a9a2984 --- /dev/null +++ b/docs/Model/OrganizationDeleteResponseData.md @@ -0,0 +1,9 @@ +# # OrganizationDeleteResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization that was deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationDetailsGetResponse.md b/docs/Model/OrganizationDetailsGetResponse.md new file mode 100644 index 00000000..56214680 --- /dev/null +++ b/docs/Model/OrganizationDetailsGetResponse.md @@ -0,0 +1,12 @@ +# # OrganizationDetailsGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationItem**](OrganizationItem.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData**](OrganizationDetailsGetResponseAllOfAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/OrganizationDetailsGetResponseAllOf.md b/docs/Model/OrganizationDetailsGetResponseAllOf.md new file mode 100644 index 00000000..f075f653 --- /dev/null +++ b/docs/Model/OrganizationDetailsGetResponseAllOf.md @@ -0,0 +1,11 @@ +# # OrganizationDetailsGetResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\OrganizationItem**](OrganizationItem.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData**](OrganizationDetailsGetResponseAllOfAdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/OrganizationDetailsGetResponseAllOfAdditionalData.md b/docs/Model/OrganizationDetailsGetResponseAllOfAdditionalData.md new file mode 100644 index 00000000..3eb9d0a3 --- /dev/null +++ b/docs/Model/OrganizationDetailsGetResponseAllOfAdditionalData.md @@ -0,0 +1,10 @@ +# # OrganizationDetailsGetResponseAllOfAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**followers** | [**\Pipedrive\Model\RelatedFollowerData**](RelatedFollowerData.md) | | [optional] +**dropbox_email** | **string** | Dropbox email for the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationFlowResponse.md b/docs/Model/OrganizationFlowResponse.md new file mode 100644 index 00000000..23c820f3 --- /dev/null +++ b/docs/Model/OrganizationFlowResponse.md @@ -0,0 +1,12 @@ +# # OrganizationFlowResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationFlowResponseAllOfData[]**](OrganizationFlowResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects**](OrganizationFlowResponseAllOfRelatedObjects.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/OrganizationFlowResponseAllOf.md b/docs/Model/OrganizationFlowResponseAllOf.md new file mode 100644 index 00000000..752626fd --- /dev/null +++ b/docs/Model/OrganizationFlowResponseAllOf.md @@ -0,0 +1,11 @@ +# # OrganizationFlowResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\OrganizationFlowResponseAllOfData[]**](OrganizationFlowResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects**](OrganizationFlowResponseAllOfRelatedObjects.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/OrganizationFlowResponseAllOfData.md b/docs/Model/OrganizationFlowResponseAllOfData.md new file mode 100644 index 00000000..478bfcec --- /dev/null +++ b/docs/Model/OrganizationFlowResponseAllOfData.md @@ -0,0 +1,11 @@ +# # OrganizationFlowResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | The type of the person update. (Possible object types - organizationChange, dealChange, file, activity) | [optional] +**timestamp** | **string** | The creation date and time of the update | [optional] +**data** | **object** | The data related to the update | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationFlowResponseAllOfRelatedObjects.md b/docs/Model/OrganizationFlowResponseAllOfRelatedObjects.md new file mode 100644 index 00000000..72aa95ad --- /dev/null +++ b/docs/Model/OrganizationFlowResponseAllOfRelatedObjects.md @@ -0,0 +1,10 @@ +# # OrganizationFlowResponseAllOfRelatedObjects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | [**\Pipedrive\Model\RelatedOrganizationData**](RelatedOrganizationData.md) | | [optional] +**user** | [**\Pipedrive\Model\RelatedUserData**](RelatedUserData.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/OrganizationFollowerDeleteResponse.md b/docs/Model/OrganizationFollowerDeleteResponse.md new file mode 100644 index 00000000..faf9b84c --- /dev/null +++ b/docs/Model/OrganizationFollowerDeleteResponse.md @@ -0,0 +1,10 @@ +# # OrganizationFollowerDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationFollowerDeleteResponseData**](OrganizationFollowerDeleteResponseData.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/OrganizationFollowerDeleteResponseData.md b/docs/Model/OrganizationFollowerDeleteResponseData.md new file mode 100644 index 00000000..4080aa2a --- /dev/null +++ b/docs/Model/OrganizationFollowerDeleteResponseData.md @@ -0,0 +1,9 @@ +# # OrganizationFollowerDeleteResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the follower that was deleted from the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationFollowerItem.md b/docs/Model/OrganizationFollowerItem.md new file mode 100644 index 00000000..12ef7166 --- /dev/null +++ b/docs/Model/OrganizationFollowerItem.md @@ -0,0 +1,12 @@ +# # OrganizationFollowerItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **int** | The ID of the organization | [optional] +**user_id** | **int** | The user ID of the follower related to the item | [optional] +**id** | **int** | The ID of the follower | [optional] +**add_time** | **\DateTime** | The date and time of adding the follower to the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationFollowerItemAllOf.md b/docs/Model/OrganizationFollowerItemAllOf.md new file mode 100644 index 00000000..cd0252e3 --- /dev/null +++ b/docs/Model/OrganizationFollowerItemAllOf.md @@ -0,0 +1,9 @@ +# # OrganizationFollowerItemAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **int** | The ID of the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationFollowerPostResponse.md b/docs/Model/OrganizationFollowerPostResponse.md new file mode 100644 index 00000000..87c36a22 --- /dev/null +++ b/docs/Model/OrganizationFollowerPostResponse.md @@ -0,0 +1,10 @@ +# # OrganizationFollowerPostResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationFollowerItem**](OrganizationFollowerItem.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/OrganizationFollowersListResponse.md b/docs/Model/OrganizationFollowersListResponse.md new file mode 100644 index 00000000..f018ec0b --- /dev/null +++ b/docs/Model/OrganizationFollowersListResponse.md @@ -0,0 +1,11 @@ +# # OrganizationFollowersListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationFollowerItem[]**](OrganizationFollowerItem.md) | The array of followers | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/OrganizationItem.md b/docs/Model/OrganizationItem.md new file mode 100644 index 00000000..1760736c --- /dev/null +++ b/docs/Model/OrganizationItem.md @@ -0,0 +1,57 @@ +# # OrganizationItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization | [optional] +**company_id** | **int** | The ID of the company related to the organization | [optional] +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**name** | **string** | The name of the organization | [optional] +**active_flag** | **bool** | Whether the organization is active or not | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithValue**](PictureDataWithValue.md) | | [optional] +**country_code** | **string** | The country code of the organization | [optional] +**first_char** | **string** | The first character of the organization name | [optional] +**add_time** | **string** | The creation date and time of the organization | [optional] +**update_time** | **string** | The last updated date and time of the organization | [optional] +**visible_to** | **string** | The visibility group ID of who can see the organization | [optional] +**label** | **int** | The ID of the label | [optional] +**owner_name** | **string** | The name of the organization owner | [optional] +**cc_email** | **string** | The BCC email of the organization | [optional] +**email_messages_count** | **int** | The count of email messages related to the organization | [optional] +**people_count** | **int** | The count of persons related to the organization | [optional] +**activities_count** | **int** | The count of activities related to the organization | [optional] +**done_activities_count** | **int** | The count of done activities related to the organization | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the organization | [optional] +**files_count** | **int** | The count of files related to the organization | [optional] +**notes_count** | **int** | The count of notes related to the organization | [optional] +**followers_count** | **int** | The count of followers related to the organization | [optional] +**address** | **string** | The full address of the organization | [optional] +**address_subpremise** | **string** | The sub-premise of the organization location | [optional] +**address_street_number** | **string** | The street number of the organization location | [optional] +**address_route** | **string** | The route of the organization location | [optional] +**address_sublocality** | **string** | The sub-locality of the organization location | [optional] +**address_locality** | **string** | The locality of the organization location | [optional] +**address_admin_area_level_1** | **string** | The level 1 admin area of the organization location | [optional] +**address_admin_area_level_2** | **string** | The level 2 admin area of the organization location | [optional] +**address_country** | **string** | The country of the organization location | [optional] +**address_postal_code** | **string** | The postal code of the organization location | [optional] +**address_formatted_address** | **string** | The formatted organization location | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**edit_name** | **bool** | If the company ID of the organization and company ID of the request is same or not | [optional] +**last_activity** | **object** | Please refer to response schema of <a href=\"https://developers.pipedrive.com/docs/api/v1/Activities#getActivity\">Activity</a> | [optional] +**next_activity** | **object** | Please refer to response schema of <a href=\"https://developers.pipedrive.com/docs/api/v1/Activities#getActivity\">Activity</a> | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationItemAllOf.md b/docs/Model/OrganizationItemAllOf.md new file mode 100644 index 00000000..e66b15b4 --- /dev/null +++ b/docs/Model/OrganizationItemAllOf.md @@ -0,0 +1,10 @@ +# # OrganizationItemAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_activity** | **object** | Please refer to response schema of <a href=\"https://developers.pipedrive.com/docs/api/v1/Activities#getActivity\">Activity</a> | [optional] +**next_activity** | **object** | Please refer to response schema of <a href=\"https://developers.pipedrive.com/docs/api/v1/Activities#getActivity\">Activity</a> | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationPostResponse.md b/docs/Model/OrganizationPostResponse.md new file mode 100644 index 00000000..78b4d10d --- /dev/null +++ b/docs/Model/OrganizationPostResponse.md @@ -0,0 +1,11 @@ +# # OrganizationPostResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseOrganizationItemWithEditNameFlag**](BaseOrganizationItemWithEditNameFlag.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/OrganizationPostResponseAllOf.md b/docs/Model/OrganizationPostResponseAllOf.md new file mode 100644 index 00000000..e126590f --- /dev/null +++ b/docs/Model/OrganizationPostResponseAllOf.md @@ -0,0 +1,10 @@ +# # OrganizationPostResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseOrganizationItemWithEditNameFlag**](BaseOrganizationItemWithEditNameFlag.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/OrganizationRelationship.md b/docs/Model/OrganizationRelationship.md new file mode 100644 index 00000000..09464ec9 --- /dev/null +++ b/docs/Model/OrganizationRelationship.md @@ -0,0 +1,12 @@ +# # OrganizationRelationship + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_id** | **int** | The ID of the base organization for the returned calculated values | [optional] +**type** | **string** | The type of organization relationship | [optional] +**rel_owner_org_id** | **int** | The owner of this relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter. | [optional] +**rel_linked_org_id** | **int** | The linked organization in this relationship. If type is `parent`, then the linked organization is the daughter. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationRelationshipDeleteResponse.md b/docs/Model/OrganizationRelationshipDeleteResponse.md new file mode 100644 index 00000000..39318286 --- /dev/null +++ b/docs/Model/OrganizationRelationshipDeleteResponse.md @@ -0,0 +1,10 @@ +# # OrganizationRelationshipDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData**](OrganizationRelationshipDeleteResponseAllOfData.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/OrganizationRelationshipDeleteResponseAllOf.md b/docs/Model/OrganizationRelationshipDeleteResponseAllOf.md new file mode 100644 index 00000000..ac0005aa --- /dev/null +++ b/docs/Model/OrganizationRelationshipDeleteResponseAllOf.md @@ -0,0 +1,9 @@ +# # OrganizationRelationshipDeleteResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData**](OrganizationRelationshipDeleteResponseAllOfData.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/OrganizationRelationshipDeleteResponseAllOfData.md b/docs/Model/OrganizationRelationshipDeleteResponseAllOfData.md new file mode 100644 index 00000000..5260f07b --- /dev/null +++ b/docs/Model/OrganizationRelationshipDeleteResponseAllOfData.md @@ -0,0 +1,9 @@ +# # OrganizationRelationshipDeleteResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deleted organization relationship | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationRelationshipDetails.md b/docs/Model/OrganizationRelationshipDetails.md new file mode 100644 index 00000000..65049dc1 --- /dev/null +++ b/docs/Model/OrganizationRelationshipDetails.md @@ -0,0 +1,18 @@ +# # OrganizationRelationshipDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization relationship | [optional] +**type** | **string** | The type of the relationship | [optional] +**rel_owner_org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItem**](RelationshipOrganizationInfoItem.md) | | [optional] +**rel_linked_org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItem**](RelationshipOrganizationInfoItem.md) | | [optional] +**add_time** | **string** | The creation date and time of the relationship | [optional] +**update_time** | **string** | The last updated date and time of the relationship | [optional] +**active_flag** | **string** | Whether the relationship is active or not | [optional] +**calculated_type** | **string** | The calculated type of the relationship with the linked organization | [optional] +**calculated_related_org_id** | **int** | The ID of the linked organization | [optional] +**related_organization_name** | **string** | The name of the linked organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationRelationshipGetResponse.md b/docs/Model/OrganizationRelationshipGetResponse.md new file mode 100644 index 00000000..f95aab2c --- /dev/null +++ b/docs/Model/OrganizationRelationshipGetResponse.md @@ -0,0 +1,11 @@ +# # OrganizationRelationshipGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationRelationshipWithCalculatedFields**](OrganizationRelationshipWithCalculatedFields.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/OrganizationRelationshipGetResponseAllOf.md b/docs/Model/OrganizationRelationshipGetResponseAllOf.md new file mode 100644 index 00000000..f55aac47 --- /dev/null +++ b/docs/Model/OrganizationRelationshipGetResponseAllOf.md @@ -0,0 +1,10 @@ +# # OrganizationRelationshipGetResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\OrganizationRelationshipWithCalculatedFields**](OrganizationRelationshipWithCalculatedFields.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/OrganizationRelationshipPostResponse.md b/docs/Model/OrganizationRelationshipPostResponse.md new file mode 100644 index 00000000..d27c2764 --- /dev/null +++ b/docs/Model/OrganizationRelationshipPostResponse.md @@ -0,0 +1,11 @@ +# # OrganizationRelationshipPostResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseOrganizationRelationshipItem**](BaseOrganizationRelationshipItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/OrganizationRelationshipPostResponseAllOf.md b/docs/Model/OrganizationRelationshipPostResponseAllOf.md new file mode 100644 index 00000000..aabe74bb --- /dev/null +++ b/docs/Model/OrganizationRelationshipPostResponseAllOf.md @@ -0,0 +1,10 @@ +# # OrganizationRelationshipPostResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseOrganizationRelationshipItem**](BaseOrganizationRelationshipItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/OrganizationRelationshipUpdateResponse.md b/docs/Model/OrganizationRelationshipUpdateResponse.md new file mode 100644 index 00000000..d8fa2d14 --- /dev/null +++ b/docs/Model/OrganizationRelationshipUpdateResponse.md @@ -0,0 +1,11 @@ +# # OrganizationRelationshipUpdateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseOrganizationRelationshipItem**](BaseOrganizationRelationshipItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects**](AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.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/OrganizationRelationshipWithCalculatedFields.md b/docs/Model/OrganizationRelationshipWithCalculatedFields.md new file mode 100644 index 00000000..26478117 --- /dev/null +++ b/docs/Model/OrganizationRelationshipWithCalculatedFields.md @@ -0,0 +1,17 @@ +# # OrganizationRelationshipWithCalculatedFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization relationship | [optional] +**type** | **string** | The type of the relationship | [optional] +**rel_owner_org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItem**](RelationshipOrganizationInfoItem.md) | | [optional] +**rel_linked_org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItem**](RelationshipOrganizationInfoItem.md) | | [optional] +**add_time** | **string** | The creation date and time of the relationship | [optional] +**update_time** | **string** | The last updated date and time of the relationship | [optional] +**active_flag** | **string** | Whether the relationship is active or not | [optional] +**calculated_type** | **string** | The calculated type of the relationship with the linked organization | [optional] +**calculated_related_org_id** | **int** | The ID of the linked organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationSearchItem.md b/docs/Model/OrganizationSearchItem.md new file mode 100644 index 00000000..84152cbd --- /dev/null +++ b/docs/Model/OrganizationSearchItem.md @@ -0,0 +1,10 @@ +# # OrganizationSearchItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result_score** | **float** | Search result relevancy | [optional] +**item** | [**\Pipedrive\Model\OrganizationSearchItemItem**](OrganizationSearchItemItem.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/OrganizationSearchItemItem.md b/docs/Model/OrganizationSearchItemItem.md new file mode 100644 index 00000000..a6c71e32 --- /dev/null +++ b/docs/Model/OrganizationSearchItemItem.md @@ -0,0 +1,16 @@ +# # OrganizationSearchItemItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization | [optional] +**type** | **string** | The type of the item | [optional] +**name** | **string** | The name of the organization | [optional] +**address** | **string** | The address of the organization | [optional] +**visible_to** | **int** | The visibility of the organization | [optional] +**owner** | [**\Pipedrive\Model\DealSearchItemItemOwner**](DealSearchItemItemOwner.md) | | [optional] +**custom_fields** | **string[]** | Custom fields | [optional] +**notes** | **string[]** | An array of notes | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationSearchResponse.md b/docs/Model/OrganizationSearchResponse.md new file mode 100644 index 00000000..132706e5 --- /dev/null +++ b/docs/Model/OrganizationSearchResponse.md @@ -0,0 +1,11 @@ +# # OrganizationSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationSearchResponseAllOfData**](OrganizationSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/OrganizationSearchResponseAllOf.md b/docs/Model/OrganizationSearchResponseAllOf.md new file mode 100644 index 00000000..8747f525 --- /dev/null +++ b/docs/Model/OrganizationSearchResponseAllOf.md @@ -0,0 +1,10 @@ +# # OrganizationSearchResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\OrganizationSearchResponseAllOfData**](OrganizationSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/OrganizationSearchResponseAllOfData.md b/docs/Model/OrganizationSearchResponseAllOfData.md new file mode 100644 index 00000000..d776a1de --- /dev/null +++ b/docs/Model/OrganizationSearchResponseAllOfData.md @@ -0,0 +1,9 @@ +# # OrganizationSearchResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\OrganizationSearchItem[]**](OrganizationSearchItem.md) | The array of found items | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationUpdateResponse.md b/docs/Model/OrganizationUpdateResponse.md new file mode 100644 index 00000000..d497fe4b --- /dev/null +++ b/docs/Model/OrganizationUpdateResponse.md @@ -0,0 +1,11 @@ +# # OrganizationUpdateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseOrganizationItem**](BaseOrganizationItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/OrganizationUpdateResponseAllOf.md b/docs/Model/OrganizationUpdateResponseAllOf.md new file mode 100644 index 00000000..157c7dad --- /dev/null +++ b/docs/Model/OrganizationUpdateResponseAllOf.md @@ -0,0 +1,10 @@ +# # OrganizationUpdateResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseOrganizationItem**](BaseOrganizationItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects**](AllOrganizationsGetResponseAllOfRelatedObjects.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/OrganizationsDeleteResponse.md b/docs/Model/OrganizationsDeleteResponse.md new file mode 100644 index 00000000..86642b17 --- /dev/null +++ b/docs/Model/OrganizationsDeleteResponse.md @@ -0,0 +1,10 @@ +# # OrganizationsDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationsDeleteResponseData**](OrganizationsDeleteResponseData.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/OrganizationsDeleteResponseData.md b/docs/Model/OrganizationsDeleteResponseData.md new file mode 100644 index 00000000..76e1839d --- /dev/null +++ b/docs/Model/OrganizationsDeleteResponseData.md @@ -0,0 +1,9 @@ +# # OrganizationsDeleteResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **float[]** | The IDs of the organizations that were deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationsMergeResponse.md b/docs/Model/OrganizationsMergeResponse.md new file mode 100644 index 00000000..eb73f707 --- /dev/null +++ b/docs/Model/OrganizationsMergeResponse.md @@ -0,0 +1,10 @@ +# # OrganizationsMergeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\OrganizationsMergeResponseData**](OrganizationsMergeResponseData.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/OrganizationsMergeResponseData.md b/docs/Model/OrganizationsMergeResponseData.md new file mode 100644 index 00000000..e5a14dbb --- /dev/null +++ b/docs/Model/OrganizationsMergeResponseData.md @@ -0,0 +1,9 @@ +# # OrganizationsMergeResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the merged organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Owner.md b/docs/Model/Owner.md new file mode 100644 index 00000000..34ae5057 --- /dev/null +++ b/docs/Model/Owner.md @@ -0,0 +1,15 @@ +# # Owner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the user | [optional] +**name** | **string** | The name of the user | [optional] +**email** | **string** | The email of the user | [optional] +**has_pic** | **int** | Whether the user has picture or not. 0 = No picture, 1 = Has picture. | [optional] +**pic_hash** | **string** | The user picture hash | [optional] +**active_flag** | **bool** | Whether the user is active or not | [optional] +**value** | **int** | The ID of the owner | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OwnerAllOf.md b/docs/Model/OwnerAllOf.md new file mode 100644 index 00000000..c07858e7 --- /dev/null +++ b/docs/Model/OwnerAllOf.md @@ -0,0 +1,9 @@ +# # OwnerAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the owner | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaginationDetails.md b/docs/Model/PaginationDetails.md new file mode 100644 index 00000000..529b6513 --- /dev/null +++ b/docs/Model/PaginationDetails.md @@ -0,0 +1,12 @@ +# # PaginationDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **int** | Pagination start | [optional] +**limit** | **int** | Items shown per page | [optional] +**more_items_in_collection** | **bool** | If there are more list items in the collection than displayed or not | [optional] +**next_start** | **int** | Next pagination start | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaginationDetailsAllOf.md b/docs/Model/PaginationDetailsAllOf.md new file mode 100644 index 00000000..c051b4a1 --- /dev/null +++ b/docs/Model/PaginationDetailsAllOf.md @@ -0,0 +1,9 @@ +# # PaginationDetailsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_start** | **int** | Next pagination start | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Params.md b/docs/Model/Params.md new file mode 100644 index 00000000..e12909ff --- /dev/null +++ b/docs/Model/Params.md @@ -0,0 +1,10 @@ +# # Params + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pipeline_id** | **int[]** | The IDs of pipelines of the goal | [optional] +**activity_type_id** | **int[]** | The IDs of activity types of the goal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentItem.md b/docs/Model/PaymentItem.md new file mode 100644 index 00000000..a2872bc9 --- /dev/null +++ b/docs/Model/PaymentItem.md @@ -0,0 +1,21 @@ +# # PaymentItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the payment | [optional] +**subscription_id** | **int** | The ID of the subscription this payment is associated with | [optional] +**deal_id** | **int** | The ID of the deal this payment is associated with | [optional] +**is_active** | **bool** | The payment status | [optional] +**amount** | **double** | The payment amount | [optional] +**currency** | **string** | The currency of the payment | [optional] +**change_amount** | **double** | The difference between the amount of the current payment and the previous payment. The value can be either positive or negative. | [optional] +**due_at** | **\DateTime** | The date when payment occurs | [optional] +**revenue_movement_type** | **string** | Represents the movement of revenue in comparison with the previous payment. Possible values are: `New` - first payment of the subscription. `Recurring` - no movement. `Expansion` - current payment amount > previous payment amount. `Contraction` - current payment amount < previous payment amount. `Churn` - last payment of the subscription. | [optional] +**payment_type** | **string** | The type of the payment. Possible values are: `Recurring` - payments occur over fixed intervals of time, `Additional` - extra payment not the recurring payment of the recurring subscription, `Installment` - payment of the installment subscription. | [optional] +**description** | **string** | The description of the payment | [optional] +**add_time** | **string** | The creation time of the payment | [optional] +**update_time** | **string** | The update time of the payment | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentsResponse.md b/docs/Model/PaymentsResponse.md new file mode 100644 index 00000000..f71d53b3 --- /dev/null +++ b/docs/Model/PaymentsResponse.md @@ -0,0 +1,10 @@ +# # PaymentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PaymentItem[]**](PaymentItem.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/PaymentsResponseAllOf.md b/docs/Model/PaymentsResponseAllOf.md new file mode 100644 index 00000000..d4af6bd6 --- /dev/null +++ b/docs/Model/PaymentsResponseAllOf.md @@ -0,0 +1,9 @@ +# # PaymentsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PaymentItem[]**](PaymentItem.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/PermissionSets.md b/docs/Model/PermissionSets.md new file mode 100644 index 00000000..916c0edc --- /dev/null +++ b/docs/Model/PermissionSets.md @@ -0,0 +1,10 @@ +# # PermissionSets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PermissionSetsItem[]**](PermissionSetsItem.md) | The array of permission 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/PermissionSetsAllOf.md b/docs/Model/PermissionSetsAllOf.md new file mode 100644 index 00000000..46453a4b --- /dev/null +++ b/docs/Model/PermissionSetsAllOf.md @@ -0,0 +1,9 @@ +# # PermissionSetsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PermissionSetsItem[]**](PermissionSetsItem.md) | The array of permission 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/PermissionSetsItem.md b/docs/Model/PermissionSetsItem.md new file mode 100644 index 00000000..4722216c --- /dev/null +++ b/docs/Model/PermissionSetsItem.md @@ -0,0 +1,14 @@ +# # PermissionSetsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of user permission set | [optional] +**name** | **string** | The name of the permission set | [optional] +**description** | **string** | The description of the permission set | [optional] +**app** | **string** | The app that permission set belongs to | [optional] +**type** | **string** | The type of permission set | [optional] +**assignment_count** | **int** | The number of users assigned to this permission 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/PersonCountAndEmailInfo.md b/docs/Model/PersonCountAndEmailInfo.md new file mode 100644 index 00000000..fc003260 --- /dev/null +++ b/docs/Model/PersonCountAndEmailInfo.md @@ -0,0 +1,17 @@ +# # PersonCountAndEmailInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonCountEmailDealAndActivityInfo.md b/docs/Model/PersonCountEmailDealAndActivityInfo.md new file mode 100644 index 00000000..f3cabacd --- /dev/null +++ b/docs/Model/PersonCountEmailDealAndActivityInfo.md @@ -0,0 +1,30 @@ +# # PersonCountEmailDealAndActivityInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonCountInfo.md b/docs/Model/PersonCountInfo.md new file mode 100644 index 00000000..560a95ef --- /dev/null +++ b/docs/Model/PersonCountInfo.md @@ -0,0 +1,15 @@ +# # PersonCountInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonData.md b/docs/Model/PersonData.md new file mode 100644 index 00000000..b88576ce --- /dev/null +++ b/docs/Model/PersonData.md @@ -0,0 +1,13 @@ +# # PersonData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person associated with the item | [optional] +**name** | **string** | The name of the person associated with the item | [optional] +**email** | [**\Pipedrive\Model\PersonDataEmail[]**](PersonDataEmail.md) | The emails of the person associated with the item | [optional] +**phone** | [**\Pipedrive\Model\PersonDataPhone[]**](PersonDataPhone.md) | The phone numbers of the person associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the person that is associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonDataEmail.md b/docs/Model/PersonDataEmail.md new file mode 100644 index 00000000..9666b416 --- /dev/null +++ b/docs/Model/PersonDataEmail.md @@ -0,0 +1,11 @@ +# # PersonDataEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The type of the email | [optional] +**value** | **string** | The email of the associated person | [optional] +**primary** | **bool** | Whether this is the primary email 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/PersonDataPhone.md b/docs/Model/PersonDataPhone.md new file mode 100644 index 00000000..82c72711 --- /dev/null +++ b/docs/Model/PersonDataPhone.md @@ -0,0 +1,11 @@ +# # PersonDataPhone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **string** | The type of the phone number | [optional] +**value** | **string** | The phone number of the person associated with the item | [optional] +**primary** | **bool** | Whether this is the primary phone number 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/PersonDataWithActiveFlag.md b/docs/Model/PersonDataWithActiveFlag.md new file mode 100644 index 00000000..fe254f05 --- /dev/null +++ b/docs/Model/PersonDataWithActiveFlag.md @@ -0,0 +1,14 @@ +# # PersonDataWithActiveFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the associated person is active or not | [optional] +**id** | **int** | The ID of the person associated with the item | [optional] +**name** | **string** | The name of the person associated with the item | [optional] +**email** | [**\Pipedrive\Model\PersonDataEmail[]**](PersonDataEmail.md) | The emails of the person associated with the item | [optional] +**phone** | [**\Pipedrive\Model\PersonDataPhone[]**](PersonDataPhone.md) | The phone numbers of the person associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the person that is associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonDataWithActiveFlagAllOf.md b/docs/Model/PersonDataWithActiveFlagAllOf.md new file mode 100644 index 00000000..20267d16 --- /dev/null +++ b/docs/Model/PersonDataWithActiveFlagAllOf.md @@ -0,0 +1,9 @@ +# # PersonDataWithActiveFlagAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the associated person is active 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/PersonFlowResponse.md b/docs/Model/PersonFlowResponse.md new file mode 100644 index 00000000..1d45b8f2 --- /dev/null +++ b/docs/Model/PersonFlowResponse.md @@ -0,0 +1,12 @@ +# # PersonFlowResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonFlowResponseAllOfData[]**](PersonFlowResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects**](DealFlowResponseAllOfRelatedObjects.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/PersonFlowResponseAllOf.md b/docs/Model/PersonFlowResponseAllOf.md new file mode 100644 index 00000000..6cccb767 --- /dev/null +++ b/docs/Model/PersonFlowResponseAllOf.md @@ -0,0 +1,11 @@ +# # PersonFlowResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PersonFlowResponseAllOfData[]**](PersonFlowResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](AdditionalData.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects**](DealFlowResponseAllOfRelatedObjects.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/PersonFlowResponseAllOfData.md b/docs/Model/PersonFlowResponseAllOfData.md new file mode 100644 index 00000000..5028ff88 --- /dev/null +++ b/docs/Model/PersonFlowResponseAllOfData.md @@ -0,0 +1,11 @@ +# # PersonFlowResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **string** | The type of the person update. (Possible object types - personChange, note, activity, file) | [optional] +**timestamp** | **string** | The creation date and time of the update | [optional] +**data** | **object** | The data related to the update | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonItem.md b/docs/Model/PersonItem.md new file mode 100644 index 00000000..89654af7 --- /dev/null +++ b/docs/Model/PersonItem.md @@ -0,0 +1,49 @@ +# # PersonItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person | [optional] +**company_id** | **int** | The ID of the company related to the person | [optional] +**active_flag** | **bool** | Whether the person is active or not | [optional] +**phone** | [**\Pipedrive\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**email** | [**\Pipedrive\Model\BasePersonItemEmail[]**](BasePersonItemEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required. | [optional] +**first_char** | **string** | The first letter of the name of the person | [optional] +**add_time** | **string** | The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS | [optional] +**visible_to** | **string** | The visibility group ID of who can see the person | [optional] +**picture_id** | [**\Pipedrive\Model\PictureDataWithID**](PictureDataWithID.md) | | [optional] +**label** | **int** | The label assigned to the person | [optional] +**org_name** | **string** | The name of the organization associated with the person | [optional] +**owner_name** | **string** | The name of the owner associated with the person | [optional] +**cc_email** | **string** | The BCC email associated with the person | [optional] +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag**](RelationshipOrganizationInfoItemWithActiveFlag.md) | | [optional] +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] +**open_deals_count** | **int** | The count of open deals related with the item | [optional] +**related_open_deals_count** | **int** | The count of related open deals related with the item | [optional] +**closed_deals_count** | **int** | The count of closed deals related with the item | [optional] +**related_closed_deals_count** | **int** | The count of related closed deals related with the item | [optional] +**won_deals_count** | **int** | The count of won deals related with the item | [optional] +**related_won_deals_count** | **int** | The count of related won deals related with the item | [optional] +**lost_deals_count** | **int** | The count of lost deals related with the item | [optional] +**related_lost_deals_count** | **int** | The count of related lost deals related with the item | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonListProduct.md b/docs/Model/PersonListProduct.md new file mode 100644 index 00000000..b8495a11 --- /dev/null +++ b/docs/Model/PersonListProduct.md @@ -0,0 +1,25 @@ +# # PersonListProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the product | [optional] +**company_id** | **int** | The ID of the company | [optional] +**name** | **string** | The name of the product | [optional] +**code** | **string** | The product code | [optional] +**description** | **string** | The description of the product | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**category** | **string** | The category of the product | [optional] +**active_flag** | **bool** | Whether this product will be made active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product can be selected in deals or not | [optional] [default to true] +**first_char** | **string** | The first letter of the product name | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers (private)</td></tr><tr><td>`3`</td><td>Entire company (shared)</td></tr></table> | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. | [optional] +**files_count** | **int** | The count of files | [optional] +**add_time** | **string** | The date and time when the product was added to the deal | [optional] +**update_time** | **string** | The date and time when the product was updated to the deal | [optional] +**deal_id** | **int** | The ID of the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonNameCountAndEmailInfo.md b/docs/Model/PersonNameCountAndEmailInfo.md new file mode 100644 index 00000000..586a1840 --- /dev/null +++ b/docs/Model/PersonNameCountAndEmailInfo.md @@ -0,0 +1,20 @@ +# # PersonNameCountAndEmailInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonNameCountAndEmailInfoWithIds.md b/docs/Model/PersonNameCountAndEmailInfoWithIds.md new file mode 100644 index 00000000..7721745b --- /dev/null +++ b/docs/Model/PersonNameCountAndEmailInfoWithIds.md @@ -0,0 +1,23 @@ +# # PersonNameCountAndEmailInfoWithIds + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | **int** | The ID of the owner related to the person | [optional] +**org_id** | **int** | The ID of the organization related to the person | [optional] +**merge_what_id** | **int** | The ID of the person with what the main person was merged | [optional] +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] +**email_messages_count** | **int** | The count of email messages related to the person | [optional] +**activities_count** | **int** | The count of activities related to the person | [optional] +**done_activities_count** | **int** | The count of done activities related to the person | [optional] +**undone_activities_count** | **int** | The count of undone activities related to the person | [optional] +**files_count** | **int** | The count of files related to the person | [optional] +**notes_count** | **int** | The count of notes related to the person | [optional] +**followers_count** | **int** | The count of followers related to the person | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the person | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonNameCountAndEmailInfoWithIdsAllOf.md b/docs/Model/PersonNameCountAndEmailInfoWithIdsAllOf.md new file mode 100644 index 00000000..51e13515 --- /dev/null +++ b/docs/Model/PersonNameCountAndEmailInfoWithIdsAllOf.md @@ -0,0 +1,11 @@ +# # PersonNameCountAndEmailInfoWithIdsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | **int** | The ID of the owner related to the person | [optional] +**org_id** | **int** | The ID of the organization related to the person | [optional] +**merge_what_id** | **int** | The ID of the person with what the main person was merged | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonNameInfo.md b/docs/Model/PersonNameInfo.md new file mode 100644 index 00000000..f96cc3f5 --- /dev/null +++ b/docs/Model/PersonNameInfo.md @@ -0,0 +1,11 @@ +# # PersonNameInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonNameInfoWithOrgAndOwnerId.md b/docs/Model/PersonNameInfoWithOrgAndOwnerId.md new file mode 100644 index 00000000..37e6df67 --- /dev/null +++ b/docs/Model/PersonNameInfoWithOrgAndOwnerId.md @@ -0,0 +1,13 @@ +# # PersonNameInfoWithOrgAndOwnerId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**owner_id** | [**\Pipedrive\Model\Owner**](Owner.md) | | [optional] +**org_id** | [**\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag**](RelationshipOrganizationInfoItemWithActiveFlag.md) | | [optional] +**name** | **string** | The name of the person | [optional] +**first_name** | **string** | The first name of the person | [optional] +**last_name** | **string** | The last name of the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonSearchItem.md b/docs/Model/PersonSearchItem.md new file mode 100644 index 00000000..608b8824 --- /dev/null +++ b/docs/Model/PersonSearchItem.md @@ -0,0 +1,10 @@ +# # PersonSearchItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result_score** | **float** | Search result relevancy | [optional] +**item** | [**\Pipedrive\Model\PersonSearchItemItem**](PersonSearchItemItem.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/PersonSearchItemItem.md b/docs/Model/PersonSearchItemItem.md new file mode 100644 index 00000000..354e1b9b --- /dev/null +++ b/docs/Model/PersonSearchItemItem.md @@ -0,0 +1,18 @@ +# # PersonSearchItemItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the person | [optional] +**type** | **string** | The type of the item | [optional] +**name** | **string** | The name of the person | [optional] +**phones** | **string[]** | An array of phone numbers | [optional] +**emails** | **string[]** | An array of email addresses | [optional] +**visible_to** | **int** | The visibility of the person | [optional] +**owner** | [**\Pipedrive\Model\PersonSearchItemItemOwner**](PersonSearchItemItemOwner.md) | | [optional] +**organization** | [**\Pipedrive\Model\PersonSearchItemItemOrganization**](PersonSearchItemItemOrganization.md) | | [optional] +**custom_fields** | **string[]** | Custom fields | [optional] +**notes** | **string[]** | An array of notes | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonSearchItemItemOrganization.md b/docs/Model/PersonSearchItemItemOrganization.md new file mode 100644 index 00000000..ccd19e5e --- /dev/null +++ b/docs/Model/PersonSearchItemItemOrganization.md @@ -0,0 +1,10 @@ +# # PersonSearchItemItemOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the organization the person is associated with | [optional] +**name** | **string** | The name of the organization the person is associated with | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonSearchItemItemOwner.md b/docs/Model/PersonSearchItemItemOwner.md new file mode 100644 index 00000000..c39e7a32 --- /dev/null +++ b/docs/Model/PersonSearchItemItemOwner.md @@ -0,0 +1,9 @@ +# # PersonSearchItemItemOwner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the owner of the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PersonSearchResponse.md b/docs/Model/PersonSearchResponse.md new file mode 100644 index 00000000..0a8501b4 --- /dev/null +++ b/docs/Model/PersonSearchResponse.md @@ -0,0 +1,11 @@ +# # PersonSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonSearchResponseAllOfData**](PersonSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/PersonSearchResponseAllOf.md b/docs/Model/PersonSearchResponseAllOf.md new file mode 100644 index 00000000..06dc2c35 --- /dev/null +++ b/docs/Model/PersonSearchResponseAllOf.md @@ -0,0 +1,10 @@ +# # PersonSearchResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PersonSearchResponseAllOfData**](PersonSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/PersonSearchResponseAllOfData.md b/docs/Model/PersonSearchResponseAllOfData.md new file mode 100644 index 00000000..1d61c2b8 --- /dev/null +++ b/docs/Model/PersonSearchResponseAllOfData.md @@ -0,0 +1,9 @@ +# # PersonSearchResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\PersonSearchItem[]**](PersonSearchItem.md) | The array of found items | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PictureData.md b/docs/Model/PictureData.md new file mode 100644 index 00000000..a10ce40e --- /dev/null +++ b/docs/Model/PictureData.md @@ -0,0 +1,15 @@ +# # PictureData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item_type** | **string** | The type of item the picture is related to | [optional] +**item_id** | **int** | The ID of related item | [optional] +**active_flag** | **bool** | Whether the associated picture is active or not | [optional] +**add_time** | **string** | The add time of the picture | [optional] +**update_time** | **string** | The update time of the picture | [optional] +**added_by_user_id** | **int** | The ID of the user who added the picture | [optional] +**pictures** | [**\Pipedrive\Model\PictureDataPictures**](PictureDataPictures.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/PictureDataPictures.md b/docs/Model/PictureDataPictures.md new file mode 100644 index 00000000..fd0e0de4 --- /dev/null +++ b/docs/Model/PictureDataPictures.md @@ -0,0 +1,10 @@ +# # PictureDataPictures + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_128** | **string** | The URL of the 128*128 picture | [optional] +**_512** | **string** | The URL of the 512*512 picture | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PictureDataWithID.md b/docs/Model/PictureDataWithID.md new file mode 100644 index 00000000..ee3f5132 --- /dev/null +++ b/docs/Model/PictureDataWithID.md @@ -0,0 +1,16 @@ +# # PictureDataWithID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the picture associated with the item | [optional] +**item_type** | **string** | The type of item the picture is related to | [optional] +**item_id** | **int** | The ID of related item | [optional] +**active_flag** | **bool** | Whether the associated picture is active or not | [optional] +**add_time** | **string** | The add time of the picture | [optional] +**update_time** | **string** | The update time of the picture | [optional] +**added_by_user_id** | **int** | The ID of the user who added the picture | [optional] +**pictures** | [**\Pipedrive\Model\PictureDataPictures**](PictureDataPictures.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/PictureDataWithIDAllOf.md b/docs/Model/PictureDataWithIDAllOf.md new file mode 100644 index 00000000..d408f3d0 --- /dev/null +++ b/docs/Model/PictureDataWithIDAllOf.md @@ -0,0 +1,9 @@ +# # PictureDataWithIDAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the picture associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PictureDataWithValue.md b/docs/Model/PictureDataWithValue.md new file mode 100644 index 00000000..a825f73e --- /dev/null +++ b/docs/Model/PictureDataWithValue.md @@ -0,0 +1,16 @@ +# # PictureDataWithValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the picture associated with the item | [optional] +**item_type** | **string** | The type of item the picture is related to | [optional] +**item_id** | **int** | The ID of related item | [optional] +**active_flag** | **bool** | Whether the associated picture is active or not | [optional] +**add_time** | **string** | The add time of the picture | [optional] +**update_time** | **string** | The update time of the picture | [optional] +**added_by_user_id** | **int** | The ID of the user who added the picture | [optional] +**pictures** | [**\Pipedrive\Model\PictureDataPictures**](PictureDataPictures.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/PictureDataWithValueAllOf.md b/docs/Model/PictureDataWithValueAllOf.md new file mode 100644 index 00000000..35955dab --- /dev/null +++ b/docs/Model/PictureDataWithValueAllOf.md @@ -0,0 +1,9 @@ +# # PictureDataWithValueAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the picture associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Pipeline.md b/docs/Model/Pipeline.md new file mode 100644 index 00000000..bb9b7c80 --- /dev/null +++ b/docs/Model/Pipeline.md @@ -0,0 +1,12 @@ +# # Pipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the pipeline | [optional] +**deal_probability** | [**NumberBoolean**](NumberBoolean.md) | Whether deal probability is disabled or enabled for this pipeline | [optional] +**order_nr** | **int** | Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. | [optional] +**active** | [**NumberBoolean**](NumberBoolean.md) | Whether this pipeline will be made inactive (hidden) or active | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PipelineDetails.md b/docs/Model/PipelineDetails.md new file mode 100644 index 00000000..1b98a65b --- /dev/null +++ b/docs/Model/PipelineDetails.md @@ -0,0 +1,18 @@ +# # PipelineDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the pipeline | [optional] +**name** | **string** | The name of the pipeline | [optional] +**url_title** | **string** | The pipeline title displayed in the URL | [optional] +**order_nr** | **int** | Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. | [optional] +**active** | **bool** | Whether this pipeline will be made inactive (hidden) or active | [optional] +**deal_probability** | **bool** | Whether deal probability is disabled or enabled for this pipeline | [optional] +**add_time** | **string** | The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**selected** | **bool** | A boolean that shows if the pipeline is selected from a filter or not | [optional] +**deals_summary** | [**\Pipedrive\Model\DealSummary**](DealSummary.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/PipelineDetailsAllOf.md b/docs/Model/PipelineDetailsAllOf.md new file mode 100644 index 00000000..5f61c79d --- /dev/null +++ b/docs/Model/PipelineDetailsAllOf.md @@ -0,0 +1,9 @@ +# # PipelineDetailsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deals_summary** | [**\Pipedrive\Model\DealSummary**](DealSummary.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/PostComment.md b/docs/Model/PostComment.md new file mode 100644 index 00000000..8ebdd734 --- /dev/null +++ b/docs/Model/PostComment.md @@ -0,0 +1,10 @@ +# # PostComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseComment**](BaseComment.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/PostDealParticipants.md b/docs/Model/PostDealParticipants.md new file mode 100644 index 00000000..50f0fd47 --- /dev/null +++ b/docs/Model/PostDealParticipants.md @@ -0,0 +1,11 @@ +# # PostDealParticipants + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**PersonItem**](PersonItem.md) | The object of participant | [optional] +**related_objects** | [**\Pipedrive\Model\GetDealsRelatedObjects**](GetDealsRelatedObjects.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/PostGoalResponse.md b/docs/Model/PostGoalResponse.md new file mode 100644 index 00000000..63f89c10 --- /dev/null +++ b/docs/Model/PostGoalResponse.md @@ -0,0 +1,9 @@ +# # PostGoalResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**goal** | [**\Pipedrive\Model\GoalsResponseComponent**](GoalsResponseComponent.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/PostNote.md b/docs/Model/PostNote.md new file mode 100644 index 00000000..a52ea02a --- /dev/null +++ b/docs/Model/PostNote.md @@ -0,0 +1,10 @@ +# # PostNote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseNote**](BaseNote.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/PostRoleAssignment.md b/docs/Model/PostRoleAssignment.md new file mode 100644 index 00000000..829e9805 --- /dev/null +++ b/docs/Model/PostRoleAssignment.md @@ -0,0 +1,10 @@ +# # PostRoleAssignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PostRoleAssignmentAllOfData**](PostRoleAssignmentAllOfData.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/PostRoleAssignmentAllOf.md b/docs/Model/PostRoleAssignmentAllOf.md new file mode 100644 index 00000000..4fb7cc2d --- /dev/null +++ b/docs/Model/PostRoleAssignmentAllOf.md @@ -0,0 +1,9 @@ +# # PostRoleAssignmentAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PostRoleAssignmentAllOfData**](PostRoleAssignmentAllOfData.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/PostRoleAssignmentAllOfData.md b/docs/Model/PostRoleAssignmentAllOfData.md new file mode 100644 index 00000000..16524fb3 --- /dev/null +++ b/docs/Model/PostRoleAssignmentAllOfData.md @@ -0,0 +1,10 @@ +# # PostRoleAssignmentAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user that was added to the role | [optional] +**role_id** | **int** | The ID of the role the user was added 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/PostRoleSettings.md b/docs/Model/PostRoleSettings.md new file mode 100644 index 00000000..46c08437 --- /dev/null +++ b/docs/Model/PostRoleSettings.md @@ -0,0 +1,10 @@ +# # PostRoleSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PostRoleSettingsAllOfData**](PostRoleSettingsAllOfData.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/PostRoleSettingsAllOf.md b/docs/Model/PostRoleSettingsAllOf.md new file mode 100644 index 00000000..c7d6bc4a --- /dev/null +++ b/docs/Model/PostRoleSettingsAllOf.md @@ -0,0 +1,9 @@ +# # PostRoleSettingsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PostRoleSettingsAllOfData**](PostRoleSettingsAllOfData.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/PostRoleSettingsAllOfData.md b/docs/Model/PostRoleSettingsAllOfData.md new file mode 100644 index 00000000..e8cc367d --- /dev/null +++ b/docs/Model/PostRoleSettingsAllOfData.md @@ -0,0 +1,10 @@ +# # PostRoleSettingsAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the role | [optional] +**deal_default_visibility** | **float** | The setting | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PostRoles.md b/docs/Model/PostRoles.md new file mode 100644 index 00000000..d77edea7 --- /dev/null +++ b/docs/Model/PostRoles.md @@ -0,0 +1,10 @@ +# # PostRoles + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PostRolesAllOfData**](PostRolesAllOfData.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/PostRolesAllOf.md b/docs/Model/PostRolesAllOf.md new file mode 100644 index 00000000..c2f17031 --- /dev/null +++ b/docs/Model/PostRolesAllOf.md @@ -0,0 +1,9 @@ +# # PostRolesAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PostRolesAllOfData**](PostRolesAllOfData.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/PostRolesAllOfData.md b/docs/Model/PostRolesAllOfData.md new file mode 100644 index 00000000..ddb84782 --- /dev/null +++ b/docs/Model/PostRolesAllOfData.md @@ -0,0 +1,9 @@ +# # PostRolesAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the created 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/ProductAttachementFields.md b/docs/Model/ProductAttachementFields.md new file mode 100644 index 00000000..399d1c61 --- /dev/null +++ b/docs/Model/ProductAttachementFields.md @@ -0,0 +1,21 @@ +# # ProductAttachementFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal-product (the ID of the product attached to the deal) | [optional] +**company_id** | **int** | The ID of the company | [optional] +**deal_id** | **int** | The ID of the deal | [optional] +**product_id** | **int** | The ID of the product | [optional] +**duration_unit** | **string** | The type of the duration. (For example hourly, daily, etc.) | [optional] +**sum_no_discount** | **float** | The product sum without the discount | [optional] +**sum** | **float** | The sum of all the products attached to the deal | [optional] +**currency** | **string** | The currency associated with the deal product | [optional] +**add_time** | **string** | The date and time when the product was added to the deal | [optional] +**last_edit** | **string** | The date and time when the deal product was last edited | [optional] +**active_flag** | **bool** | Whether the product is active or not | [optional] +**tax** | **float** | The product tax | [optional] +**name** | **string** | The product 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/ProductAttachmentDetails.md b/docs/Model/ProductAttachmentDetails.md new file mode 100644 index 00000000..1587c0a3 --- /dev/null +++ b/docs/Model/ProductAttachmentDetails.md @@ -0,0 +1,28 @@ +# # ProductAttachmentDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | The ID of the product | +**item_price** | **float** | The price at which this product will be added to the deal | +**quantity** | **int** | Quantity – e.g. how many items of this product will be added to the deal | +**discount_percentage** | **float** | The discount %. If omitted, will be set to 0. | [optional] [default to 0] +**duration** | **float** | The duration of the product. If omitted, will be set to 1. | [optional] [default to 1] +**duration_unit** | **string** | The type of the duration. (For example hourly, daily, etc.) | [optional] +**product_variation_id** | **int** | The ID of the product variation to use. When omitted, no variation will be used. | [optional] +**comments** | **string** | A textual comment associated with this product-deal attachment | [optional] +**tax** | **float** | The product tax | [optional] +**enabled_flag** | **bool** | Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. | [optional] [default to true] +**id** | **int** | The ID of the deal-product (the ID of the product attached to the deal) | [optional] +**company_id** | **int** | The ID of the company | [optional] +**deal_id** | **int** | The ID of the deal | [optional] +**sum_no_discount** | **float** | The product sum without the discount | [optional] +**sum** | **float** | The sum of all the products attached to the deal | [optional] +**currency** | **string** | The currency associated with the deal product | [optional] +**add_time** | **string** | The date and time when the product was added to the deal | [optional] +**last_edit** | **string** | The date and time when the deal product was last edited | [optional] +**active_flag** | **bool** | Whether the product is active or not | [optional] +**name** | **string** | The product 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/ProductBaseDeal.md b/docs/Model/ProductBaseDeal.md new file mode 100644 index 00000000..82e8c86c --- /dev/null +++ b/docs/Model/ProductBaseDeal.md @@ -0,0 +1,51 @@ +# # ProductBaseDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal | [optional] +**company_id** | **int** | The ID of the company | [optional] +**creator_user_id** | **int** | The ID of the deal creator | [optional] +**user_id** | **int** | The ID of the user | [optional] +**person_id** | **int** | The ID of the person associated with the deal | [optional] +**org_id** | **int** | The ID of the organization associated with the deal | [optional] +**stage_id** | **int** | The ID of the deal stage | [optional] +**title** | **string** | The title of the deal | [optional] +**value** | **float** | The value of the deal | [optional] +**currency** | **string** | The currency associated with the deal | [optional] +**add_time** | **string** | The creation date and time of the deal | [optional] +**first_add_time** | **string** | The first creation date and time of the deal | [optional] +**update_time** | **string** | The last updated date and time of the deal | [optional] +**stage_change_time** | **string** | The last updated date and time of the deal stage | [optional] +**active** | **bool** | Whether the deal is active or not | [optional] +**deleted** | **bool** | Whether the deal is deleted or not | [optional] +**status** | **string** | The status of the deal | [optional] +**probability** | **float** | The success probability percentage of the deal | [optional] +**next_activity_date** | **string** | The date of the next activity associated with the deal | [optional] +**next_activity_time** | **string** | The time of the next activity associated with the deal | [optional] +**next_activity_id** | **int** | The ID of the next activity associated with the deal | [optional] +**last_activity_id** | **int** | The ID of the last activity associated with the deal | [optional] +**last_activity_date** | **string** | The date of the last activity associated with the deal | [optional] +**lost_reason** | **string** | The reason for losing the deal | [optional] +**visible_to** | **string** | The visibility of the deal | [optional] +**close_time** | **string** | The date and time of closing the deal | [optional] +**pipeline_id** | **int** | The ID of the pipeline associated with the deal | [optional] +**won_time** | **string** | The date and time of changing the deal status as won | [optional] +**first_won_time** | **string** | The date and time of the first time changing the deal status as won | [optional] +**lost_time** | **string** | The date and time of changing the deal status as lost | [optional] +**products_count** | **int** | The number of products associated with the deal | [optional] +**files_count** | **int** | The number of files associated with the deal | [optional] +**notes_count** | **int** | The number of notes associated with the deal | [optional] +**followers_count** | **int** | The number of followers associated with the deal | [optional] +**email_messages_count** | **int** | The number of emails associated with the deal | [optional] +**activities_count** | **int** | The number of activities associated with the deal | [optional] +**done_activities_count** | **int** | The number of completed activities associated with the deal | [optional] +**undone_activities_count** | **int** | The number of incomplete activities associated with the deal | [optional] +**participants_count** | **int** | The number of participants associated with the deal | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal | [optional] +**last_incoming_mail_time** | **string** | The date and time of the last incoming email associated with the deal | [optional] +**last_outgoing_mail_time** | **string** | The date and time of the last outgoing email associated with the deal | [optional] +**label** | **string** | The label or multiple labels assigned to the deal | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductField.md b/docs/Model/ProductField.md new file mode 100644 index 00000000..73993053 --- /dev/null +++ b/docs/Model/ProductField.md @@ -0,0 +1,26 @@ +# # ProductField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the field | +**options** | **object[]** | When `field_type` is either `set` or `enum`, possible options must be supplied as a JSON-encoded sequential array, for example:</br>`[{\"label\":\"red\"}, {\"label\":\"blue\"}, {\"label\":\"lilac\"}]` | [optional] +**field_type** | **string** | The type of the field<table><tr><th>Value</th><th>Description</th></tr><tr><td>`varchar`</td><td>Text (up to 255 characters)</td><tr><td>`varchar_auto`</td><td>Autocomplete text (up to 255 characters)</td><tr><td>`text`</td><td>Long text (up to 65k characters)</td><tr><td>`double`</td><td>Numeric value</td><tr><td>`monetary`</td><td>Monetary field (has a numeric value and a currency value)</td><tr><td>`date`</td><td>Date (format YYYY-MM-DD)</td><tr><td>`set`</td><td>Options field with a possibility of having multiple chosen options</td><tr><td>`enum`</td><td>Options field with a single possible chosen option</td><tr><td>`user`</td><td>User field (contains a user ID of another Pipedrive user)</td><tr><td>`org`</td><td>Organization field (contains an organization ID which is stored on the same account)</td><tr><td>`people`</td><td>Person field (contains a product ID which is stored on the same account)</td><tr><td>`phone`</td><td>Phone field (up to 255 numbers and/or characters)</td><tr><td>`time`</td><td>Time field (format HH:MM:SS)</td><tr><td>`timerange`</td><td>Time-range field (has a start time and end time value, both HH:MM:SS)</td><tr><td>`daterange`</td><td>Date-range field (has a start date and end date value, both YYYY-MM-DD)</td><tr><td>`address`</td><td>Address field (autocompleted by Google Maps)</dd></table> | +**id** | **int** | The ID of the product field | [optional] +**key** | **string** | The key of the product field | [optional] +**order_nr** | **int** | The position (index) of the product field in the detail view | [optional] +**add_time** | **string** | The product field creation time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The product field last update time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**last_updated_by_user_id** | **int** | The ID of the last user to update the product field | [optional] +**active_flag** | **bool** | Whether or not the product field is currently active | [optional] +**edit_flag** | **bool** | Whether or not the product field name and metadata is editable | [optional] +**add_visible_flag** | **bool** | Whether or not the product field is visible in the Add Product Modal | [optional] +**important_flag** | **bool** | Whether or not the product field is marked as important | [optional] +**bulk_edit_allowed** | **bool** | Whether or not the product field data can be edited | [optional] +**searchable_flag** | **bool** | Whether or not the product field is searchable | [optional] +**filtering_allowed** | **bool** | Whether or not the product field value can be used when filtering searches | [optional] +**sortable_flag** | **bool** | Whether or not the product field is sortable | [optional] +**mandatory_flag** | **bool** | Whether or not the product field is mandatory when creating products | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductFieldAllOf.md b/docs/Model/ProductFieldAllOf.md new file mode 100644 index 00000000..ea243bb5 --- /dev/null +++ b/docs/Model/ProductFieldAllOf.md @@ -0,0 +1,23 @@ +# # ProductFieldAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the product field | [optional] +**key** | **string** | The key of the product field | [optional] +**order_nr** | **int** | The position (index) of the product field in the detail view | [optional] +**add_time** | **string** | The product field creation time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The product field last update time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**last_updated_by_user_id** | **int** | The ID of the last user to update the product field | [optional] +**active_flag** | **bool** | Whether or not the product field is currently active | [optional] +**edit_flag** | **bool** | Whether or not the product field name and metadata is editable | [optional] +**add_visible_flag** | **bool** | Whether or not the product field is visible in the Add Product Modal | [optional] +**important_flag** | **bool** | Whether or not the product field is marked as important | [optional] +**bulk_edit_allowed** | **bool** | Whether or not the product field data can be edited | [optional] +**searchable_flag** | **bool** | Whether or not the product field is searchable | [optional] +**filtering_allowed** | **bool** | Whether or not the product field value can be used when filtering searches | [optional] +**sortable_flag** | **bool** | Whether or not the product field is sortable | [optional] +**mandatory_flag** | **bool** | Whether or not the product field is mandatory when creating products | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductFileItem.md b/docs/Model/ProductFileItem.md new file mode 100644 index 00000000..df927c20 --- /dev/null +++ b/docs/Model/ProductFileItem.md @@ -0,0 +1,23 @@ +# # ProductFileItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the file | [optional] +**product_id** | **int** | The ID of the product associated with the file | [optional] +**add_time** | **string** | The UTC date time when the file was uploaded. Format: YYYY-MM-DD HH:MM:SS | [optional] +**update_time** | **string** | The UTC date time when the file was last updated. Format: YYYY-MM-DD HH:MM:SS | [optional] +**file_name** | **string** | The original name of the file | [optional] +**file_size** | **int** | The size of the file in bytes | [optional] +**active_flag** | **bool** | Whether the user is active or not. | [optional] +**inline_flag** | **bool** | Whether the file was uploaded as inline or not | [optional] +**remote_location** | **string** | The location type to send the file to. Only googledrive is supported at the moment. | [optional] +**remote_id** | **string** | The ID of the remote item | [optional] +**s3_bucket** | **string** | The location of the cloud storage | [optional] +**product_name** | **string** | The name of the product associated with the file | [optional] +**url** | **string** | The URL to download the file | [optional] +**name** | **string** | The visible name of the file | [optional] +**description** | **string** | The description of 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/ProductListItem.md b/docs/Model/ProductListItem.md new file mode 100644 index 00000000..01efb538 --- /dev/null +++ b/docs/Model/ProductListItem.md @@ -0,0 +1,31 @@ +# # ProductListItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal-product (the ID of the product attached to the deal) | [optional] +**deal_id** | **int** | The ID of the deal | [optional] +**order_nr** | **int** | The order number of the product | [optional] +**product_id** | **int** | The ID of the product | [optional] +**product_variation_id** | **int** | The ID of the product variation | [optional] +**item_price** | **int** | The price value of the product | [optional] +**discount_percentage** | **int** | The discount percentage of the product | [optional] +**duration** | **int** | The duration of the product | [optional] +**duration_unit** | **string** | The type of the duration. (For example hourly, daily, etc.) | [optional] +**sum_no_discount** | **float** | The product sum without the discount | [optional] +**sum** | **float** | The sum of all the products attached to the deal | [optional] +**currency** | **string** | The currency associated with the deal product | [optional] +**enabled_flag** | **bool** | Whether the product is enabled or not | [optional] +**add_time** | **string** | The date and time when the product was added to the deal | [optional] +**last_edit** | **string** | The date and time when the deal product was last edited | [optional] +**comments** | **string** | The comments of the product | [optional] +**active_flag** | **bool** | Whether the product is active or not | [optional] +**tax** | **float** | The product tax | [optional] +**name** | **string** | The product name | [optional] +**sum_formatted** | **string** | The formatted sum of the product | [optional] +**quantity_formatted** | **string** | The formatted quantity of the product | [optional] +**quantity** | **int** | The quantity of the product | [optional] +**product** | [**\Pipedrive\Model\ProductWithObjectPrices**](ProductWithObjectPrices.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/ProductRequest.md b/docs/Model/ProductRequest.md new file mode 100644 index 00000000..1e12f3ee --- /dev/null +++ b/docs/Model/ProductRequest.md @@ -0,0 +1,16 @@ +# # ProductRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | The product code | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**active_flag** | **bool** | Whether this product will be made active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product can be selected in deals or not | [optional] [default to true] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. | [optional] +**prices** | **object[]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductResponse.md b/docs/Model/ProductResponse.md new file mode 100644 index 00000000..ba2b1822 --- /dev/null +++ b/docs/Model/ProductResponse.md @@ -0,0 +1,11 @@ +# # ProductResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ProductWithArrayPrices**](ProductWithArrayPrices.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetActivitiesResponse200RelatedObjects**](GetActivitiesResponse200RelatedObjects.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/ProductSearchItem.md b/docs/Model/ProductSearchItem.md new file mode 100644 index 00000000..1272d7cd --- /dev/null +++ b/docs/Model/ProductSearchItem.md @@ -0,0 +1,10 @@ +# # ProductSearchItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result_score** | **float** | Search result relevancy | [optional] +**item** | [**\Pipedrive\Model\ProductSearchItemItem**](ProductSearchItemItem.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/ProductSearchItemItem.md b/docs/Model/ProductSearchItemItem.md new file mode 100644 index 00000000..5acd490d --- /dev/null +++ b/docs/Model/ProductSearchItemItem.md @@ -0,0 +1,15 @@ +# # ProductSearchItemItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the product | [optional] +**type** | **string** | The type of the item | [optional] +**name** | **string** | The name of the product | [optional] +**code** | **int** | The code of the product | [optional] +**visible_to** | **int** | The visibility of the product | [optional] +**owner** | [**\Pipedrive\Model\ProductSearchItemItemOwner**](ProductSearchItemItemOwner.md) | | [optional] +**custom_fields** | **string[]** | The custom fields | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductSearchItemItemOwner.md b/docs/Model/ProductSearchItemItemOwner.md new file mode 100644 index 00000000..933edbf1 --- /dev/null +++ b/docs/Model/ProductSearchItemItemOwner.md @@ -0,0 +1,9 @@ +# # ProductSearchItemItemOwner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the owner of the product | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductSearchResponse.md b/docs/Model/ProductSearchResponse.md new file mode 100644 index 00000000..aa76c94a --- /dev/null +++ b/docs/Model/ProductSearchResponse.md @@ -0,0 +1,11 @@ +# # ProductSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ProductSearchResponseAllOfData**](ProductSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ProductSearchResponseAllOf.md b/docs/Model/ProductSearchResponseAllOf.md new file mode 100644 index 00000000..b284d080 --- /dev/null +++ b/docs/Model/ProductSearchResponseAllOf.md @@ -0,0 +1,10 @@ +# # ProductSearchResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\ProductSearchResponseAllOfData**](ProductSearchResponseAllOfData.md) | | [optional] +**additional_data** | [**\Pipedrive\Model\ItemSearchAdditionalData**](ItemSearchAdditionalData.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/ProductSearchResponseAllOfData.md b/docs/Model/ProductSearchResponseAllOfData.md new file mode 100644 index 00000000..8e4d3227 --- /dev/null +++ b/docs/Model/ProductSearchResponseAllOfData.md @@ -0,0 +1,9 @@ +# # ProductSearchResponseAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Pipedrive\Model\ProductSearchItem[]**](ProductSearchItem.md) | The array of found items | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductWithArrayPrices.md b/docs/Model/ProductWithArrayPrices.md new file mode 100644 index 00000000..15cd3652 --- /dev/null +++ b/docs/Model/ProductWithArrayPrices.md @@ -0,0 +1,18 @@ +# # ProductWithArrayPrices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **float** | The ID of the product | [optional] +**name** | **string** | The name of the product | [optional] +**code** | **string** | The product code | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The ax percentage | [optional] [default to 0] +**active_flag** | **bool** | Whether this product is active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product is selected in deals or not | [optional] [default to true] +**visible_to** | [**VisibleTo**](VisibleTo.md) | Visibility of the product | [optional] +**owner_id** | **object** | Information about the Pipedrive user who owns the product | [optional] +**prices** | **object[]** | Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductWithObjectPrices.md b/docs/Model/ProductWithObjectPrices.md new file mode 100644 index 00000000..587e61c9 --- /dev/null +++ b/docs/Model/ProductWithObjectPrices.md @@ -0,0 +1,18 @@ +# # ProductWithObjectPrices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **float** | The ID of the product | [optional] +**name** | **string** | The name of the product | [optional] +**code** | **string** | The product code | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The ax percentage | [optional] [default to 0] +**active_flag** | **bool** | Whether this product is active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product is selected in deals or not | [optional] [default to true] +**visible_to** | [**VisibleTo**](VisibleTo.md) | Visibility of the product | [optional] +**owner_id** | **object** | Information about the Pipedrive user who owns the product | [optional] +**prices** | **object** | Object of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductsResponse.md b/docs/Model/ProductsResponse.md new file mode 100644 index 00000000..20dbef72 --- /dev/null +++ b/docs/Model/ProductsResponse.md @@ -0,0 +1,12 @@ +# # ProductsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ProductResponse[]**](ProductResponse.md) | Array containing data for all products | [optional] +**additional_data** | [**\Pipedrive\Model\AdditionalData**](.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetActivitiesResponse200RelatedObjects**](GetActivitiesResponse200RelatedObjects.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/PutRole.md b/docs/Model/PutRole.md new file mode 100644 index 00000000..6142faaa --- /dev/null +++ b/docs/Model/PutRole.md @@ -0,0 +1,10 @@ +# # PutRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PutRoleAllOfData**](PutRoleAllOfData.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/PutRoleAllOf.md b/docs/Model/PutRoleAllOf.md new file mode 100644 index 00000000..169796b1 --- /dev/null +++ b/docs/Model/PutRoleAllOf.md @@ -0,0 +1,9 @@ +# # PutRoleAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\PutRoleAllOfData**](PutRoleAllOfData.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/PutRoleAllOfData.md b/docs/Model/PutRoleAllOfData.md new file mode 100644 index 00000000..f7857a3a --- /dev/null +++ b/docs/Model/PutRoleAllOfData.md @@ -0,0 +1,9 @@ +# # PutRoleAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the updated 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/PutRolePipelinesBody.md b/docs/Model/PutRolePipelinesBody.md new file mode 100644 index 00000000..f945f78d --- /dev/null +++ b/docs/Model/PutRolePipelinesBody.md @@ -0,0 +1,9 @@ +# # PutRolePipelinesBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**visible_pipeline_ids** | **object** | The pipeline IDs to make the pipelines visible (add) and/or hidden (remove) for the specified role. It requires the following JSON structure: `{ \"add\": \"[1]\", \"remove\": \"[3, 4]\" }`. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RecentDataProduct.md b/docs/Model/RecentDataProduct.md new file mode 100644 index 00000000..1628f14d --- /dev/null +++ b/docs/Model/RecentDataProduct.md @@ -0,0 +1,24 @@ +# # RecentDataProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the product | [optional] +**name** | **string** | The name of the product | [optional] +**code** | **string** | The product code | [optional] +**description** | **string** | The description of the product | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**category** | **string** | The category of the product | [optional] +**active_flag** | **bool** | Whether this product will be made active or not | [optional] +**selectable** | **bool** | Whether this product can be selected in deals or not | [optional] +**first_char** | **string** | The first letter of the product name | [optional] +**visible_to** | **int** | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this product. When omitted, authorized user ID will be used. | [optional] +**files_count** | **int** | The count of files | [optional] +**add_time** | **string** | The date and time when the product was added to the deal | [optional] +**update_time** | **string** | The date and time when the product was updated to the deal | [optional] +**prices** | **object[]** | Array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RecentsActivity.md b/docs/Model/RecentsActivity.md new file mode 100644 index 00000000..19a0fdfc --- /dev/null +++ b/docs/Model/RecentsActivity.md @@ -0,0 +1,11 @@ +# # RecentsActivity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject**](ActivityResponseObject.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/RecentsActivityType.md b/docs/Model/RecentsActivityType.md new file mode 100644 index 00000000..2eb96241 --- /dev/null +++ b/docs/Model/RecentsActivityType.md @@ -0,0 +1,11 @@ +# # RecentsActivityType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\ActivityTypeObjectResponse**](ActivityTypeObjectResponse.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/RecentsDeal.md b/docs/Model/RecentsDeal.md new file mode 100644 index 00000000..d2731b80 --- /dev/null +++ b/docs/Model/RecentsDeal.md @@ -0,0 +1,11 @@ +# # RecentsDeal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\DealStrict**](DealStrict.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/RecentsFile.md b/docs/Model/RecentsFile.md new file mode 100644 index 00000000..ba15415c --- /dev/null +++ b/docs/Model/RecentsFile.md @@ -0,0 +1,11 @@ +# # RecentsFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\FileItem**](FileItem.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/RecentsFilter.md b/docs/Model/RecentsFilter.md new file mode 100644 index 00000000..03d2ffcb --- /dev/null +++ b/docs/Model/RecentsFilter.md @@ -0,0 +1,11 @@ +# # RecentsFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\FilterGetItem**](FilterGetItem.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/RecentsNote.md b/docs/Model/RecentsNote.md new file mode 100644 index 00000000..aeb24787 --- /dev/null +++ b/docs/Model/RecentsNote.md @@ -0,0 +1,11 @@ +# # RecentsNote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\BaseNote**](BaseNote.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/RecentsOrganization.md b/docs/Model/RecentsOrganization.md new file mode 100644 index 00000000..798b4c53 --- /dev/null +++ b/docs/Model/RecentsOrganization.md @@ -0,0 +1,11 @@ +# # RecentsOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\BaseOrganizationItem**](BaseOrganizationItem.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/RecentsPerson.md b/docs/Model/RecentsPerson.md new file mode 100644 index 00000000..f3dd3e07 --- /dev/null +++ b/docs/Model/RecentsPerson.md @@ -0,0 +1,11 @@ +# # RecentsPerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\MergePersonItem**](MergePersonItem.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/RecentsPipeline.md b/docs/Model/RecentsPipeline.md new file mode 100644 index 00000000..49785740 --- /dev/null +++ b/docs/Model/RecentsPipeline.md @@ -0,0 +1,11 @@ +# # RecentsPipeline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\BasePipeline**](BasePipeline.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/RecentsProduct.md b/docs/Model/RecentsProduct.md new file mode 100644 index 00000000..48027d4e --- /dev/null +++ b/docs/Model/RecentsProduct.md @@ -0,0 +1,11 @@ +# # RecentsProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\RecentDataProduct**](RecentDataProduct.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/RecentsStage.md b/docs/Model/RecentsStage.md new file mode 100644 index 00000000..2e9e18bb --- /dev/null +++ b/docs/Model/RecentsStage.md @@ -0,0 +1,11 @@ +# # RecentsStage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\BaseStage**](BaseStage.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/RecentsUser.md b/docs/Model/RecentsUser.md new file mode 100644 index 00000000..5ffa8f9f --- /dev/null +++ b/docs/Model/RecentsUser.md @@ -0,0 +1,11 @@ +# # RecentsUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **string** | | [optional] +**id** | **int** | | [optional] +**data** | [**\Pipedrive\Model\BaseUser**](BaseUser.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/RelatedDealData.md b/docs/Model/RelatedDealData.md new file mode 100644 index 00000000..396d92d6 --- /dev/null +++ b/docs/Model/RelatedDealData.md @@ -0,0 +1,9 @@ +# # RelatedDealData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal_id** | [**\Pipedrive\Model\RelatedDealDataDEALID**](RelatedDealDataDEALID.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/RelatedDealDataDEALID.md b/docs/Model/RelatedDealDataDEALID.md new file mode 100644 index 00000000..50a8b961 --- /dev/null +++ b/docs/Model/RelatedDealDataDEALID.md @@ -0,0 +1,15 @@ +# # RelatedDealDataDEALID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the deal associated with the item | [optional] +**title** | **string** | The title of the deal associated with the item | [optional] +**status** | **string** | The status of the deal associated with the item | [optional] +**value** | **float** | The value of the deal that is associated with the item | [optional] +**currency** | **string** | The currency of the deal value | [optional] +**stage_id** | **int** | The ID of the stage the deal is currently at | [optional] +**pipeline_id** | **int** | The ID of the pipeline the deal is in | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelatedFollowerData.md b/docs/Model/RelatedFollowerData.md new file mode 100644 index 00000000..31bf6dd1 --- /dev/null +++ b/docs/Model/RelatedFollowerData.md @@ -0,0 +1,9 @@ +# # RelatedFollowerData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**follower_user_id** | [**FollowerDataWithID**](FollowerDataWithID.md) | The user ID of the follower | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelatedOrganizationData.md b/docs/Model/RelatedOrganizationData.md new file mode 100644 index 00000000..010dad8e --- /dev/null +++ b/docs/Model/RelatedOrganizationData.md @@ -0,0 +1,9 @@ +# # RelatedOrganizationData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization_id** | [**\Pipedrive\Model\OrganizationDataWithId**](OrganizationDataWithId.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/RelatedOrganizationDataWithActiveFlag.md b/docs/Model/RelatedOrganizationDataWithActiveFlag.md new file mode 100644 index 00000000..e7ea2b5b --- /dev/null +++ b/docs/Model/RelatedOrganizationDataWithActiveFlag.md @@ -0,0 +1,9 @@ +# # RelatedOrganizationDataWithActiveFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization_id** | [**\Pipedrive\Model\OrganizationDataWithIdAndActiveFlag**](OrganizationDataWithIdAndActiveFlag.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/RelatedOrganizationName.md b/docs/Model/RelatedOrganizationName.md new file mode 100644 index 00000000..4b2322f2 --- /dev/null +++ b/docs/Model/RelatedOrganizationName.md @@ -0,0 +1,9 @@ +# # RelatedOrganizationName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**related_organization_name** | **string** | The name of the linked organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelatedPersonData.md b/docs/Model/RelatedPersonData.md new file mode 100644 index 00000000..e2a0cc4e --- /dev/null +++ b/docs/Model/RelatedPersonData.md @@ -0,0 +1,9 @@ +# # RelatedPersonData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**person_id** | [**PersonData**](PersonData.md) | The ID of the person associated with the item | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelatedPersonDataWithActiveFlag.md b/docs/Model/RelatedPersonDataWithActiveFlag.md new file mode 100644 index 00000000..33ad745f --- /dev/null +++ b/docs/Model/RelatedPersonDataWithActiveFlag.md @@ -0,0 +1,9 @@ +# # RelatedPersonDataWithActiveFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**person_id** | [**\Pipedrive\Model\PersonDataWithActiveFlag**](PersonDataWithActiveFlag.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/RelatedPictureData.md b/docs/Model/RelatedPictureData.md new file mode 100644 index 00000000..dbe402f1 --- /dev/null +++ b/docs/Model/RelatedPictureData.md @@ -0,0 +1,9 @@ +# # RelatedPictureData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**picture_id** | [**PictureDataWithID**](PictureDataWithID.md) | The ID of the picture | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelatedUserData.md b/docs/Model/RelatedUserData.md new file mode 100644 index 00000000..771a813f --- /dev/null +++ b/docs/Model/RelatedUserData.md @@ -0,0 +1,9 @@ +# # RelatedUserData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | [**\Pipedrive\Model\UserDataWithId**](UserDataWithId.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/RelationshipOrganizationInfoItem.md b/docs/Model/RelationshipOrganizationInfoItem.md new file mode 100644 index 00000000..3b6c60ae --- /dev/null +++ b/docs/Model/RelationshipOrganizationInfoItem.md @@ -0,0 +1,14 @@ +# # RelationshipOrganizationInfoItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization associated with the item | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the item | [optional] +**address** | **string** | The address of the organization | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the item | [optional] +**value** | **int** | The ID of the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipOrganizationInfoItemAllOf.md b/docs/Model/RelationshipOrganizationInfoItemAllOf.md new file mode 100644 index 00000000..6112f551 --- /dev/null +++ b/docs/Model/RelationshipOrganizationInfoItemAllOf.md @@ -0,0 +1,9 @@ +# # RelationshipOrganizationInfoItemAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | The ID of the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RelationshipOrganizationInfoItemWithActiveFlag.md b/docs/Model/RelationshipOrganizationInfoItemWithActiveFlag.md new file mode 100644 index 00000000..10611efd --- /dev/null +++ b/docs/Model/RelationshipOrganizationInfoItemWithActiveFlag.md @@ -0,0 +1,15 @@ +# # RelationshipOrganizationInfoItemWithActiveFlag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization associated with the item | [optional] +**people_count** | **int** | The number of people connected with the organization that is associated with the item | [optional] +**owner_id** | **int** | The ID of the owner of the organization that is associated with the item | [optional] +**address** | **string** | The address of the organization | [optional] +**cc_email** | **string** | The BCC email of the organization associated with the item | [optional] +**value** | **int** | The ID of the organization | [optional] +**active_flag** | **bool** | Whether the associated organization is active 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/RequiredNameObject.md b/docs/Model/RequiredNameObject.md new file mode 100644 index 00000000..6ceada79 --- /dev/null +++ b/docs/Model/RequiredNameObject.md @@ -0,0 +1,9 @@ +# # RequiredNameObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the product | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RequredTitleParameter.md b/docs/Model/RequredTitleParameter.md new file mode 100644 index 00000000..9b2af83a --- /dev/null +++ b/docs/Model/RequredTitleParameter.md @@ -0,0 +1,9 @@ +# # RequredTitleParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the deal | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ResponseCallLogObject.md b/docs/Model/ResponseCallLogObject.md new file mode 100644 index 00000000..ebca7e3d --- /dev/null +++ b/docs/Model/ResponseCallLogObject.md @@ -0,0 +1,24 @@ +# # ResponseCallLogObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. | [optional] +**activity_id** | **int** | If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. The `activity_id` must refer to a `call` type activity. | [optional] +**subject** | **string** | The name of the activity this call is attached to | [optional] +**duration** | **string** | The duration of the call in seconds | [optional] +**outcome** | **string** | Describes the outcome of the call | +**from_phone_number** | **string** | The number that made the call | [optional] +**to_phone_number** | **string** | The number called | +**start_time** | **\DateTime** | The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. | +**end_time** | **\DateTime** | The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. | +**person_id** | **int** | The ID of the person this call is associated with | [optional] +**org_id** | **int** | The ID of the organization this call is associated with | [optional] +**deal_id** | **int** | The ID of the deal this call is associated with | [optional] +**note** | **string** | The note for the call log in HTML format | [optional] +**id** | **string** | The call log ID, generated when the call log was created | [optional] +**has_recording** | **bool** | If the call log has an audio recording attached, the value should be true | [optional] +**company_id** | **int** | The company ID of the owner of the call log | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ResponseCallLogObjectAllOf.md b/docs/Model/ResponseCallLogObjectAllOf.md new file mode 100644 index 00000000..941c30c6 --- /dev/null +++ b/docs/Model/ResponseCallLogObjectAllOf.md @@ -0,0 +1,11 @@ +# # ResponseCallLogObjectAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The call log ID, generated when the call log was created | [optional] +**has_recording** | **bool** | If the call log has an audio recording attached, the value should be true | [optional] +**company_id** | **int** | The company ID of the owner of the call log | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RoleAssignment.md b/docs/Model/RoleAssignment.md new file mode 100644 index 00000000..a1ffb97c --- /dev/null +++ b/docs/Model/RoleAssignment.md @@ -0,0 +1,14 @@ +# # RoleAssignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_role_id** | **int** | The ID of the parent role | [optional] +**name** | **string** | The name of the role | [optional] +**user_id** | **int** | The user ID | [optional] +**role_id** | **int** | The role ID | [optional] +**active_flag** | **bool** | Whether the role is active or not | [optional] +**type** | **string** | The assignment type | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RoleAssignmentAllOf.md b/docs/Model/RoleAssignmentAllOf.md new file mode 100644 index 00000000..f618b0b7 --- /dev/null +++ b/docs/Model/RoleAssignmentAllOf.md @@ -0,0 +1,12 @@ +# # RoleAssignmentAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The user ID | [optional] +**role_id** | **int** | The role ID | [optional] +**active_flag** | **bool** | Whether the role is active or not | [optional] +**type** | **string** | The assignment type | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RoleSettings.md b/docs/Model/RoleSettings.md new file mode 100644 index 00000000..080dfba5 --- /dev/null +++ b/docs/Model/RoleSettings.md @@ -0,0 +1,17 @@ +# # RoleSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal_default_visibility** | **float** | The default visibility level of the deals for the role | [optional] +**lead_default_visibility** | **float** | The default visibility level of the leads for the role | [optional] +**org_default_visibility** | **float** | The default visibility level of the organizations for the role | [optional] +**person_default_visibility** | **float** | The default visibility level of the people for the role | [optional] +**product_default_visibility** | **float** | The default visibility level of the products for the role | [optional] +**deal_access_level** | **float** | The access level of the deals for the role (only for default role) | [optional] +**org_access_level** | **float** | The access level of the organizations for the role (only for default role) | [optional] +**person_access_level** | **float** | The access level of the people for the role (only for default role) | [optional] +**product_access_level** | **float** | The access level of the products for the role (only for default 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/RolesAdditionalData.md b/docs/Model/RolesAdditionalData.md new file mode 100644 index 00000000..361f1ab9 --- /dev/null +++ b/docs/Model/RolesAdditionalData.md @@ -0,0 +1,9 @@ +# # RolesAdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**\Pipedrive\Model\RolesAdditionalDataPagination**](RolesAdditionalDataPagination.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/RolesAdditionalDataPagination.md b/docs/Model/RolesAdditionalDataPagination.md new file mode 100644 index 00000000..f5acd35e --- /dev/null +++ b/docs/Model/RolesAdditionalDataPagination.md @@ -0,0 +1,11 @@ +# # RolesAdditionalDataPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **int** | Pagination start | [optional] +**limit** | **int** | Items shown per page | [optional] +**more_items_in_collection** | **bool** | Whether there are more list items in the collection than displayed | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SinglePermissionSetsItem.md b/docs/Model/SinglePermissionSetsItem.md new file mode 100644 index 00000000..d94cf044 --- /dev/null +++ b/docs/Model/SinglePermissionSetsItem.md @@ -0,0 +1,15 @@ +# # SinglePermissionSetsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of user permission set | [optional] +**name** | **string** | The name of the permission set | [optional] +**description** | **string** | The description of the permission set | [optional] +**app** | **string** | The app that permission set belongs to | [optional] +**type** | **string** | The type of permission set | [optional] +**assignment_count** | **int** | The number of users assigned to this permission set | [optional] +**contents** | **string[]** | A permission assigned to this permission 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/SinglePermissionSetsItemAllOf.md b/docs/Model/SinglePermissionSetsItemAllOf.md new file mode 100644 index 00000000..e2e0065d --- /dev/null +++ b/docs/Model/SinglePermissionSetsItemAllOf.md @@ -0,0 +1,9 @@ +# # SinglePermissionSetsItemAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contents** | **string[]** | A permission assigned to this permission 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/Stage.md b/docs/Model/Stage.md new file mode 100644 index 00000000..d13b00e6 --- /dev/null +++ b/docs/Model/Stage.md @@ -0,0 +1,13 @@ +# # Stage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the stage | [optional] +**pipeline_id** | **int** | The ID of the pipeline to add stage to | [optional] +**deal_probability** | **int** | The success probability percentage of the deal. Used/shown when deal weighted values are used. | [optional] +**rotten_flag** | **bool** | Whether deals in this stage can become rotten | [optional] +**rotten_days** | **int** | The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is 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/StageConversions.md b/docs/Model/StageConversions.md new file mode 100644 index 00000000..512c0f18 --- /dev/null +++ b/docs/Model/StageConversions.md @@ -0,0 +1,11 @@ +# # StageConversions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_stage_id** | **int** | The stage ID from where conversion starts | [optional] +**to_stage_id** | **int** | The stage ID to where conversion ends | [optional] +**conversion_rate** | **int** | The conversion rate | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StageDetails.md b/docs/Model/StageDetails.md new file mode 100644 index 00000000..ce8f45ae --- /dev/null +++ b/docs/Model/StageDetails.md @@ -0,0 +1,19 @@ +# # StageDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the stage | [optional] +**order_nr** | **int** | Defines the order of the stage | [optional] +**name** | **string** | The name of the stage | [optional] +**active_flag** | **bool** | Whether the stage is active or deleted | [optional] +**deal_probability** | **int** | The success probability percentage of the deal. Used/shown when the deal weighted values are used. | [optional] +**pipeline_id** | **int** | The ID of the pipeline to add the stage to | [optional] +**rotten_flag** | **bool** | Whether deals in this stage can become rotten | [optional] +**rotten_days** | **int** | The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. | [optional] +**add_time** | **string** | The stage creation time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The stage update time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**deals_summary** | [**\Pipedrive\Model\DealSummary**](DealSummary.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/StageWithPipelineInfo.md b/docs/Model/StageWithPipelineInfo.md new file mode 100644 index 00000000..7f277221 --- /dev/null +++ b/docs/Model/StageWithPipelineInfo.md @@ -0,0 +1,20 @@ +# # StageWithPipelineInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the stage | [optional] +**order_nr** | **int** | Defines the order of the stage | [optional] +**name** | **string** | The name of the stage | [optional] +**active_flag** | **bool** | Whether the stage is active or deleted | [optional] +**deal_probability** | **int** | The success probability percentage of the deal. Used/shown when the deal weighted values are used. | [optional] +**pipeline_id** | **int** | The ID of the pipeline to add the stage to | [optional] +**rotten_flag** | **bool** | Whether deals in this stage can become rotten | [optional] +**rotten_days** | **int** | The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. | [optional] +**add_time** | **string** | The stage creation time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**update_time** | **string** | The stage update time. Format: YYYY-MM-DD HH:MM:SS. | [optional] +**pipeline_name** | **string** | The name of the pipeline | [optional] +**pipeline_deal_probability** | **bool** | The pipeline deal probability. When `true`, overrides the stage probability. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StageWithPipelineInfoAllOf.md b/docs/Model/StageWithPipelineInfoAllOf.md new file mode 100644 index 00000000..07e1d63c --- /dev/null +++ b/docs/Model/StageWithPipelineInfoAllOf.md @@ -0,0 +1,10 @@ +# # StageWithPipelineInfoAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pipeline_name** | **string** | The name of the pipeline | [optional] +**pipeline_deal_probability** | **bool** | The pipeline deal probability. When `true`, overrides the stage probability. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubRole.md b/docs/Model/SubRole.md new file mode 100644 index 00000000..289d9e31 --- /dev/null +++ b/docs/Model/SubRole.md @@ -0,0 +1,14 @@ +# # SubRole + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parent_role_id** | **int** | The ID of the parent role | [optional] +**name** | **string** | The name of the role | [optional] +**id** | **int** | The ID of the role | [optional] +**active_flag** | **bool** | Whether the role is active or not | [optional] +**assignment_count** | **string** | The number of users assigned to this role | [optional] +**sub_role_count** | **string** | The number of sub-roles | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubRoleAllOf.md b/docs/Model/SubRoleAllOf.md new file mode 100644 index 00000000..c23a917c --- /dev/null +++ b/docs/Model/SubRoleAllOf.md @@ -0,0 +1,12 @@ +# # SubRoleAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the role | [optional] +**active_flag** | **bool** | Whether the role is active or not | [optional] +**assignment_count** | **string** | The number of users assigned to this role | [optional] +**sub_role_count** | **string** | The number of sub-roles | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionAddonsResponse.md b/docs/Model/SubscriptionAddonsResponse.md new file mode 100644 index 00000000..f533b638 --- /dev/null +++ b/docs/Model/SubscriptionAddonsResponse.md @@ -0,0 +1,10 @@ +# # SubscriptionAddonsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | **object[]** | An array of add-ons that the company has. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionAddonsResponseAllOf.md b/docs/Model/SubscriptionAddonsResponseAllOf.md new file mode 100644 index 00000000..cad684e4 --- /dev/null +++ b/docs/Model/SubscriptionAddonsResponseAllOf.md @@ -0,0 +1,9 @@ +# # SubscriptionAddonsResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object[]** | An array of add-ons that the company has. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionInstallmentCreateRequest.md b/docs/Model/SubscriptionInstallmentCreateRequest.md new file mode 100644 index 00000000..b5e8cc92 --- /dev/null +++ b/docs/Model/SubscriptionInstallmentCreateRequest.md @@ -0,0 +1,12 @@ +# # SubscriptionInstallmentCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal_id** | **int** | The ID of the deal this installment subscription is associated with | +**currency** | **string** | The currency of the installment subscription. Accepts a 3-character currency code. | +**payments** | **object[]** | Array of payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). | +**update_deal_value** | **bool** | Indicates that the deal value must be set to the installment subscription's total value | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionInstallmentUpdateRequest.md b/docs/Model/SubscriptionInstallmentUpdateRequest.md new file mode 100644 index 00000000..ca82e446 --- /dev/null +++ b/docs/Model/SubscriptionInstallmentUpdateRequest.md @@ -0,0 +1,10 @@ +# # SubscriptionInstallmentUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payments** | **object[]** | Array of payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with a explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). | +**update_deal_value** | **bool** | Indicates that the deal value must be set to installment subscription's total value | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionItem.md b/docs/Model/SubscriptionItem.md new file mode 100644 index 00000000..94b085d0 --- /dev/null +++ b/docs/Model/SubscriptionItem.md @@ -0,0 +1,24 @@ +# # SubscriptionItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the subscription | [optional] +**user_id** | **int** | The ID of the user who created the subscription | [optional] +**deal_id** | **int** | The ID of the deal this subscription is associated with | [optional] +**description** | **string** | The description of the recurring subscription | [optional] +**is_active** | **bool** | The subscription status | [optional] +**cycles_count** | **int** | Shows how many payments a recurring subscription has | [optional] +**cycle_amount** | **int** | The amount of each payment | [optional] +**infinite** | **bool** | Indicates that the recurring subscription will last until it is manually canceled or deleted | [optional] +**currency** | **string** | The currency of the subscription | [optional] +**cadence_type** | **string** | The interval between payments | [optional] +**start_date** | **\DateTime** | The start date of the recurring subscription | [optional] +**end_date** | **\DateTime** | The end date of the subscription | [optional] +**lifetime_value** | **double** | The total value of all payments | [optional] +**final_status** | **string** | The final status of the subscription | [optional] +**add_time** | **string** | The creation time of the subscription | [optional] +**update_time** | **string** | The update time of the subscription | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionRecurringCancelRequest.md b/docs/Model/SubscriptionRecurringCancelRequest.md new file mode 100644 index 00000000..4ea4594d --- /dev/null +++ b/docs/Model/SubscriptionRecurringCancelRequest.md @@ -0,0 +1,9 @@ +# # SubscriptionRecurringCancelRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**end_date** | **\DateTime** | The subscription termination date. All payments after specified date will be deleted. Default value is the current 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/SubscriptionRecurringCreateRequest.md b/docs/Model/SubscriptionRecurringCreateRequest.md new file mode 100644 index 00000000..8ab294d8 --- /dev/null +++ b/docs/Model/SubscriptionRecurringCreateRequest.md @@ -0,0 +1,18 @@ +# # SubscriptionRecurringCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deal_id** | **int** | The ID of the deal this recurring subscription is associated with | +**currency** | **string** | The currency of the recurring subscription. Accepts a 3-character currency code. | +**description** | **string** | The description of the recurring subscription | [optional] +**cadence_type** | **string** | The interval between payments | +**cycles_count** | **int** | Shows how many payments the subscription has. Note that one field must be set: `cycles_count` or `infinite`. If `cycles_count` is set, then `cycle_amount` and `start_date` are also required. | [optional] +**cycle_amount** | **int** | The amount of each payment | +**start_date** | **\DateTime** | The start date of the recurring subscription. Format: YYYY-MM-DD | +**infinite** | **bool** | This indicates that the recurring subscription will last until it's manually canceled or deleted. Note that only one field must be set: `cycles_count` or `infinite`. | [optional] +**payments** | **object[]** | Array of additional payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). | [optional] +**update_deal_value** | **bool** | Indicates that the deal value must be set to recurring subscription's MRR value | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionRecurringUpdateRequest.md b/docs/Model/SubscriptionRecurringUpdateRequest.md new file mode 100644 index 00000000..2005bcd7 --- /dev/null +++ b/docs/Model/SubscriptionRecurringUpdateRequest.md @@ -0,0 +1,13 @@ +# # SubscriptionRecurringUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | The description of the recurring subscription | [optional] +**cycle_amount** | **int** | The amount of each payment | [optional] +**payments** | **object[]** | Array of additional payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). | [optional] +**update_deal_value** | **bool** | Indicates that the deal value must be set to recurring subscription's MRR value | [optional] +**effective_date** | **\DateTime** | All payments after that date will be affected. Format: YYYY-MM-DD | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionsIdResponse.md b/docs/Model/SubscriptionsIdResponse.md new file mode 100644 index 00000000..93ff7f51 --- /dev/null +++ b/docs/Model/SubscriptionsIdResponse.md @@ -0,0 +1,10 @@ +# # SubscriptionsIdResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\SubscriptionItem**](SubscriptionItem.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/SubscriptionsIdResponseAllOf.md b/docs/Model/SubscriptionsIdResponseAllOf.md new file mode 100644 index 00000000..78012d5c --- /dev/null +++ b/docs/Model/SubscriptionsIdResponseAllOf.md @@ -0,0 +1,9 @@ +# # SubscriptionsIdResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\SubscriptionItem**](SubscriptionItem.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/Team.md b/docs/Model/Team.md new file mode 100644 index 00000000..9bf87ae0 --- /dev/null +++ b/docs/Model/Team.md @@ -0,0 +1,10 @@ +# # Team + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseTeam**](BaseTeam.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/TeamAllOf.md b/docs/Model/TeamAllOf.md new file mode 100644 index 00000000..20addd5a --- /dev/null +++ b/docs/Model/TeamAllOf.md @@ -0,0 +1,9 @@ +# # TeamAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseTeam**](BaseTeam.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/TeamId.md b/docs/Model/TeamId.md new file mode 100644 index 00000000..751075bb --- /dev/null +++ b/docs/Model/TeamId.md @@ -0,0 +1,9 @@ +# # TeamId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The team 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/Teams.md b/docs/Model/Teams.md new file mode 100644 index 00000000..430651e3 --- /dev/null +++ b/docs/Model/Teams.md @@ -0,0 +1,10 @@ +# # Teams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseTeam[]**](BaseTeam.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/TeamsAllOf.md b/docs/Model/TeamsAllOf.md new file mode 100644 index 00000000..a1f44a91 --- /dev/null +++ b/docs/Model/TeamsAllOf.md @@ -0,0 +1,9 @@ +# # TeamsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseTeam[]**](BaseTeam.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/Unauthorized.md b/docs/Model/Unauthorized.md new file mode 100644 index 00000000..28bdce18 --- /dev/null +++ b/docs/Model/Unauthorized.md @@ -0,0 +1,11 @@ +# # Unauthorized + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**error** | **string** | The error message | [optional] +**error_code** | **int** | The response error code | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateActivityResponse200.md b/docs/Model/UpdateActivityResponse200.md new file mode 100644 index 00000000..50e4deb5 --- /dev/null +++ b/docs/Model/UpdateActivityResponse200.md @@ -0,0 +1,11 @@ +# # UpdateActivityResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**data** | [**\Pipedrive\Model\ActivityResponseObject**](ActivityResponseObject.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\AddActivityResponse200RelatedObjects**](AddActivityResponse200RelatedObjects.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/UpdateDealProduct.md b/docs/Model/UpdateDealProduct.md new file mode 100644 index 00000000..515cf047 --- /dev/null +++ b/docs/Model/UpdateDealProduct.md @@ -0,0 +1,18 @@ +# # UpdateDealProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | The ID of the product to use | +**item_price** | **float** | The price at which this product will be added to the deal | [optional] +**quantity** | **int** | How many items of this product will be added to the deal | [optional] +**discount_percentage** | **float** | The discount %. If omitted, will be set to 0. | [optional] [default to 0] +**duration** | **float** | The duration of the product | [optional] [default to 1] +**duration_unit** | [**DealProductUnitDuration**](DealProductUnitDuration.md) | The unit duration of the product | [optional] +**product_variation_id** | **int** | The ID of the product variation to use. When omitted, no variation will be used. | [optional] +**comments** | **string** | A textual comment associated with this product-deal attachment | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**enabled_flag** | **bool** | Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateDealRequest.md b/docs/Model/UpdateDealRequest.md new file mode 100644 index 00000000..5b06126c --- /dev/null +++ b/docs/Model/UpdateDealRequest.md @@ -0,0 +1,21 @@ +# # UpdateDealRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The title of the deal | [optional] +**value** | **string** | The value of the deal. If omitted, value will be set to 0. | [optional] +**currency** | **string** | The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. | [optional] +**user_id** | **int** | The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. | [optional] +**person_id** | **int** | The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. | [optional] +**org_id** | **int** | The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. | [optional] +**pipeline_id** | **int** | The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. | [optional] +**stage_id** | **int** | The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. | [optional] +**status** | **string** | open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. | [optional] +**expected_close_date** | **\DateTime** | The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. | [optional] +**probability** | **float** | The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. | [optional] +**lost_reason** | **string** | The optional message about why the deal was lost (to be used when status = lost) | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></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/UpdateFile.md b/docs/Model/UpdateFile.md new file mode 100644 index 00000000..6b8095ad --- /dev/null +++ b/docs/Model/UpdateFile.md @@ -0,0 +1,10 @@ +# # UpdateFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the request was successful or not | [optional] +**data** | [**\Pipedrive\Model\FileData**](FileData.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/UpdateFilterRequest.md b/docs/Model/UpdateFilterRequest.md new file mode 100644 index 00000000..1f4c10c5 --- /dev/null +++ b/docs/Model/UpdateFilterRequest.md @@ -0,0 +1,10 @@ +# # UpdateFilterRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the filter | [optional] +**conditions** | **object** | The conditions of the filter as a JSON object. Please note that a maximum of 16 conditions is allowed per filter and `date` values must be supplied in the `YYYY-MM-DD` format. It requires a minimum structure as follows: `{\"glue\":\"and\",\"conditions\":[{\"glue\":\"and\",\"conditions\": [CONDITION_OBJECTS]},{\"glue\":\"or\",\"conditions\":[CONDITION_OBJECTS]}]}`. Replace `CONDITION_OBJECTS` with JSON objects of the following structure: `{\"object\":\"\",\"field_id\":\"\", \"operator\":\"\",\"value\":\"\", \"extra_value\":\"\"}` or leave the array empty. Depending on the object type you should use another API endpoint to get `field_id`. There are five types of objects you can choose from: `\"person\"`, `\"deal\"`, `\"organization\"`, `\"product\"`, `\"activity\"` and you can use these types of operators depending on what type of a field you have: `\"IS NOT NULL\"`, `\"IS NULL\"`, `\"<=\"`, `\">=\"`, `\"<\"`, `\">\"`, `\"!=\"`, `\"=\"`, `\"LIKE '$%'\"`, `\"LIKE '%$%'\"`, `\"NOT LIKE '$%'\"`. To get a better understanding of how filters work try creating them directly from the Pipedrive application. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateLeadLabelRequest.md b/docs/Model/UpdateLeadLabelRequest.md new file mode 100644 index 00000000..719b8f7f --- /dev/null +++ b/docs/Model/UpdateLeadLabelRequest.md @@ -0,0 +1,10 @@ +# # UpdateLeadLabelRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the lead label | [optional] +**color** | [**\Pipedrive\Model\LeadLabelColor**](LeadLabelColor.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/UpdateLeadRequest.md b/docs/Model/UpdateLeadRequest.md new file mode 100644 index 00000000..0570e827 --- /dev/null +++ b/docs/Model/UpdateLeadRequest.md @@ -0,0 +1,18 @@ +# # UpdateLeadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | The name of the lead | [optional] +**owner_id** | **int** | The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used. | [optional] +**label_ids** | **string[]** | The IDs of the lead labels which will be associated with the lead | [optional] +**person_id** | **int** | The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. A lead always has to be linked to a person or organization or both. | [optional] +**organization_id** | **int** | The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. A lead always has to be linked to a person or organization or both. | [optional] +**is_archived** | **bool** | A flag indicating whether the lead is archived or not | [optional] +**value** | [**\Pipedrive\Model\LeadValue**](LeadValue.md) | | [optional] +**expected_close_date** | **\DateTime** | The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**was_seen** | **bool** | A flag indicating whether the lead was seen by someone in the Pipedrive UI | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateOrganization.md b/docs/Model/UpdateOrganization.md new file mode 100644 index 00000000..13afb113 --- /dev/null +++ b/docs/Model/UpdateOrganization.md @@ -0,0 +1,11 @@ +# # UpdateOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></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/UpdateOrganizationAllOf.md b/docs/Model/UpdateOrganizationAllOf.md new file mode 100644 index 00000000..2d3bbce8 --- /dev/null +++ b/docs/Model/UpdateOrganizationAllOf.md @@ -0,0 +1,9 @@ +# # UpdateOrganizationAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the organization | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdatePerson.md b/docs/Model/UpdatePerson.md new file mode 100644 index 00000000..e1ad78c9 --- /dev/null +++ b/docs/Model/UpdatePerson.md @@ -0,0 +1,16 @@ +# # UpdatePerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. | [optional] +**org_id** | **int** | The ID of the organization this person will belong to | [optional] +**email** | [**\Pipedrive\Model\BasicPersonEmail[]**](BasicPersonEmail.md) | An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. | [optional] +**phone** | [**\Pipedrive\Model\BasePersonItemPhone[]**](BasePersonItemPhone.md) | A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. | [optional] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width:40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**marketing_status** | [**MarketingStatus**](MarketingStatus.md) | If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.<table><tr><th>Value</th><th>Description</th></tr><tr><td>`no_consent`</td><td>The customer has not given consent to receive any marketing communications</td></tr><tr><td>`unsubscribed`</td><td>The customers have unsubscribed from ALL marketing communications</td></tr><tr><td>`subscribed`</td><td>The customers are subscribed and are counted towards marketing caps</td></tr><tr><td>`archived`</td><td>The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for</td></tr></table> | [optional] +**add_time** | **string** | The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdatePersonAllOf.md b/docs/Model/UpdatePersonAllOf.md new file mode 100644 index 00000000..148372ae --- /dev/null +++ b/docs/Model/UpdatePersonAllOf.md @@ -0,0 +1,9 @@ +# # UpdatePersonAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdatePersonResponse.md b/docs/Model/UpdatePersonResponse.md new file mode 100644 index 00000000..183f6cf7 --- /dev/null +++ b/docs/Model/UpdatePersonResponse.md @@ -0,0 +1,11 @@ +# # UpdatePersonResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\PersonItem**](PersonItem.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects**](ListProductsResponseAllOfRelatedObjects.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/UpdateProductField.md b/docs/Model/UpdateProductField.md new file mode 100644 index 00000000..d812905f --- /dev/null +++ b/docs/Model/UpdateProductField.md @@ -0,0 +1,10 @@ +# # UpdateProductField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the field | [optional] +**options** | **object[]** | When `field_type` is either set or enum, possible options on update must be supplied as an array of objects each containing id and label, for example: [{\"id\":1, \"label\":\"red\"},{\"id\":2, \"label\":\"blue\"},{\"id\":3, \"label\":\"lilac\"}] | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateProductRequestBody.md b/docs/Model/UpdateProductRequestBody.md new file mode 100644 index 00000000..8522ff06 --- /dev/null +++ b/docs/Model/UpdateProductRequestBody.md @@ -0,0 +1,17 @@ +# # UpdateProductRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the product | +**code** | **string** | The product code | [optional] +**unit** | **string** | The unit in which this product is sold | [optional] +**tax** | **float** | The tax percentage | [optional] [default to 0] +**active_flag** | **bool** | Whether this product will be made active or not | [optional] [default to true] +**selectable** | **bool** | Whether this product can be selected in deals or not | [optional] [default to true] +**visible_to** | [**VisibleTo**](VisibleTo.md) | The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups <a href=\"https://support.pipedrive.com/en/article/visibility-groups\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.<h4>Essential / Advanced plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner &amp; followers</td><tr><td>`3`</td><td>Entire company</td></tr></table><h4>Professional / Enterprise plan</h4><table><tr><th style=\"width: 40px\">Value</th><th>Description</th></tr><tr><td>`1`</td><td>Owner only</td><tr><td>`3`</td><td>Owner's visibility group</td></tr><tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr><tr><td>`7`</td><td>Entire company</td></tr></table> | [optional] +**owner_id** | **int** | The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. | [optional] +**prices** | **object[]** | An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateProductResponse.md b/docs/Model/UpdateProductResponse.md new file mode 100644 index 00000000..7d568c89 --- /dev/null +++ b/docs/Model/UpdateProductResponse.md @@ -0,0 +1,11 @@ +# # UpdateProductResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\ProductWithObjectPrices**](ProductWithObjectPrices.md) | | [optional] +**related_objects** | [**\Pipedrive\Model\GetActivitiesResponse200RelatedObjects**](GetActivitiesResponse200RelatedObjects.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/UpdateStageRequest.md b/docs/Model/UpdateStageRequest.md new file mode 100644 index 00000000..e272a126 --- /dev/null +++ b/docs/Model/UpdateStageRequest.md @@ -0,0 +1,14 @@ +# # UpdateStageRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the stage | [optional] +**pipeline_id** | **int** | The ID of the pipeline to add stage to | [optional] +**deal_probability** | **int** | The success probability percentage of the deal. Used/shown when deal weighted values are used. | [optional] +**rotten_flag** | **bool** | Whether deals in this stage can become rotten | [optional] +**rotten_days** | **int** | The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. | [optional] +**order_nr** | **int** | An order number for this stage. Order numbers should be used to order the stages in the pipeline. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateStageRequestAllOf.md b/docs/Model/UpdateStageRequestAllOf.md new file mode 100644 index 00000000..bc4544c4 --- /dev/null +++ b/docs/Model/UpdateStageRequestAllOf.md @@ -0,0 +1,9 @@ +# # UpdateStageRequestAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_nr** | **int** | An order number for this stage. Order numbers should be used to order the stages in the pipeline. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateTeam.md b/docs/Model/UpdateTeam.md new file mode 100644 index 00000000..4fb6dc59 --- /dev/null +++ b/docs/Model/UpdateTeam.md @@ -0,0 +1,14 @@ +# # UpdateTeam + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The team name | [optional] +**description** | **string** | The team description | [optional] +**manager_id** | **int** | The team manager ID | [optional] +**users** | **int[]** | The list of user IDs | [optional] +**active_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is active | [optional] +**deleted_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateTeamAllOf.md b/docs/Model/UpdateTeamAllOf.md new file mode 100644 index 00000000..743abdc0 --- /dev/null +++ b/docs/Model/UpdateTeamAllOf.md @@ -0,0 +1,10 @@ +# # UpdateTeamAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is active | [optional] +**deleted_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is deleted | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateTeamWithAdditionalProperties.md b/docs/Model/UpdateTeamWithAdditionalProperties.md new file mode 100644 index 00000000..e7cd06d8 --- /dev/null +++ b/docs/Model/UpdateTeamWithAdditionalProperties.md @@ -0,0 +1,16 @@ +# # UpdateTeamWithAdditionalProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The team name | [optional] +**description** | **string** | The team description | [optional] +**manager_id** | **int** | The team manager ID | [optional] +**users** | **int[]** | The list of user IDs | [optional] +**active_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is active | [optional] +**deleted_flag** | [**NumberBoolean**](NumberBoolean.md) | Flag that indicates whether the team is deleted | [optional] +**add_time** | **string** | The team creation time. Format: YYYY-MM-DD HH:MM:SS | [optional] +**created_by_user_id** | **int** | The ID of the user who created the team | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserRequest.md b/docs/Model/UpdateUserRequest.md new file mode 100644 index 00000000..0738e0fe --- /dev/null +++ b/docs/Model/UpdateUserRequest.md @@ -0,0 +1,9 @@ +# # UpdateUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_flag** | **bool** | Whether the user is active or not. `false` = Not activated, `true` = Activated | + +[[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 00000000..5148bbb9 --- /dev/null +++ b/docs/Model/User.md @@ -0,0 +1,10 @@ +# # User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseUser**](BaseUser.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/UserAccess.md b/docs/Model/UserAccess.md new file mode 100644 index 00000000..4fd82efa --- /dev/null +++ b/docs/Model/UserAccess.md @@ -0,0 +1,11 @@ +# # UserAccess + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app** | **string** | | [optional] +**admin** | **bool** | | [optional] +**permission_set_id** | **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/UserAllOf.md b/docs/Model/UserAllOf.md new file mode 100644 index 00000000..19a992dc --- /dev/null +++ b/docs/Model/UserAllOf.md @@ -0,0 +1,9 @@ +# # UserAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseUser**](BaseUser.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/UserAssignmentToPermissionSet.md b/docs/Model/UserAssignmentToPermissionSet.md new file mode 100644 index 00000000..0f5ed895 --- /dev/null +++ b/docs/Model/UserAssignmentToPermissionSet.md @@ -0,0 +1,11 @@ +# # UserAssignmentToPermissionSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | The ID of the user in the permission set | [optional] +**permission_set_id** | **string** | The ID of the permission set | [optional] +**name** | **string** | The name of the permission 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/UserAssignmentsToPermissionSet.md b/docs/Model/UserAssignmentsToPermissionSet.md new file mode 100644 index 00000000..967f6cfa --- /dev/null +++ b/docs/Model/UserAssignmentsToPermissionSet.md @@ -0,0 +1,10 @@ +# # UserAssignmentsToPermissionSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\UserAssignmentToPermissionSet[]**](UserAssignmentToPermissionSet.md) | An array of the assignments of the user | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserAssignmentsToPermissionSetAllOf.md b/docs/Model/UserAssignmentsToPermissionSetAllOf.md new file mode 100644 index 00000000..5471f4f8 --- /dev/null +++ b/docs/Model/UserAssignmentsToPermissionSetAllOf.md @@ -0,0 +1,9 @@ +# # UserAssignmentsToPermissionSetAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\UserAssignmentToPermissionSet[]**](UserAssignmentToPermissionSet.md) | An array of the assignments of the user | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserConnections.md b/docs/Model/UserConnections.md new file mode 100644 index 00000000..0a2b9aab --- /dev/null +++ b/docs/Model/UserConnections.md @@ -0,0 +1,10 @@ +# # UserConnections + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\UserConnectionsAllOfData**](UserConnectionsAllOfData.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/UserConnectionsAllOf.md b/docs/Model/UserConnectionsAllOf.md new file mode 100644 index 00000000..826034dc --- /dev/null +++ b/docs/Model/UserConnectionsAllOf.md @@ -0,0 +1,9 @@ +# # UserConnectionsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\UserConnectionsAllOfData**](UserConnectionsAllOfData.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/UserConnectionsAllOfData.md b/docs/Model/UserConnectionsAllOfData.md new file mode 100644 index 00000000..5b1526cf --- /dev/null +++ b/docs/Model/UserConnectionsAllOfData.md @@ -0,0 +1,9 @@ +# # UserConnectionsAllOfData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**google** | **string** | The third party ID or false in case the ID is not found | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserData.md b/docs/Model/UserData.md new file mode 100644 index 00000000..bec70b99 --- /dev/null +++ b/docs/Model/UserData.md @@ -0,0 +1,14 @@ +# # UserData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the user | [optional] +**name** | **string** | The name of the user | [optional] +**email** | **string** | The email of the user | [optional] +**has_pic** | **int** | Whether the user has picture or not. 0 = No picture, 1 = Has picture. | [optional] +**pic_hash** | **string** | The user picture hash | [optional] +**active_flag** | **bool** | Whether the user is active 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/UserDataWithId.md b/docs/Model/UserDataWithId.md new file mode 100644 index 00000000..1ebd6494 --- /dev/null +++ b/docs/Model/UserDataWithId.md @@ -0,0 +1,14 @@ +# # UserDataWithId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The ID of the user | [optional] +**name** | **string** | The name of the user | [optional] +**email** | **string** | The email of the user | [optional] +**has_pic** | **int** | Whether the user has picture or not. 0 = No picture, 1 = Has picture. | [optional] +**pic_hash** | **string** | The user picture hash | [optional] +**active_flag** | **bool** | Whether the user is active 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/UserIDs.md b/docs/Model/UserIDs.md new file mode 100644 index 00000000..f10e8e01 --- /dev/null +++ b/docs/Model/UserIDs.md @@ -0,0 +1,10 @@ +# # UserIDs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | **int[]** | The list of user IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserIDsAllOf.md b/docs/Model/UserIDsAllOf.md new file mode 100644 index 00000000..7e117922 --- /dev/null +++ b/docs/Model/UserIDsAllOf.md @@ -0,0 +1,9 @@ +# # UserIDsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **int[]** | The list of user IDs | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserMe.md b/docs/Model/UserMe.md new file mode 100644 index 00000000..84f89a3f --- /dev/null +++ b/docs/Model/UserMe.md @@ -0,0 +1,10 @@ +# # UserMe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseUserMe**](BaseUserMe.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/UserMeAllOf.md b/docs/Model/UserMeAllOf.md new file mode 100644 index 00000000..3810bcd1 --- /dev/null +++ b/docs/Model/UserMeAllOf.md @@ -0,0 +1,9 @@ +# # UserMeAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseUserMe**](BaseUserMe.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/UserPermissions.md b/docs/Model/UserPermissions.md new file mode 100644 index 00000000..58edfd59 --- /dev/null +++ b/docs/Model/UserPermissions.md @@ -0,0 +1,10 @@ +# # UserPermissions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\UserPermissionsItem**](UserPermissionsItem.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/UserPermissionsAllOf.md b/docs/Model/UserPermissionsAllOf.md new file mode 100644 index 00000000..23a557f1 --- /dev/null +++ b/docs/Model/UserPermissionsAllOf.md @@ -0,0 +1,9 @@ +# # UserPermissionsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\UserPermissionsItem**](UserPermissionsItem.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/UserPermissionsItem.md b/docs/Model/UserPermissionsItem.md new file mode 100644 index 00000000..4b830a22 --- /dev/null +++ b/docs/Model/UserPermissionsItem.md @@ -0,0 +1,39 @@ +# # UserPermissionsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_add_custom_fields** | **bool** | If the user can add custom fields | [optional] +**can_add_products** | **bool** | If the user can add products | [optional] +**can_add_prospects_as_leads** | **bool** | If the user can add prospects as leads | [optional] +**can_bulk_edit_items** | **bool** | If the user can bulk edit items | [optional] +**can_change_visibility_of_items** | **bool** | If the user can change visibility of items | [optional] +**can_convert_deals_to_leads** | **bool** | If the user can convert deals to leads | [optional] +**can_create_own_workflow** | **bool** | If the user can create workflows | [optional] +**can_delete_activities** | **bool** | If the user can delete activities | [optional] +**can_delete_custom_fields** | **bool** | If the user can delete custom fields | [optional] +**can_delete_deals** | **bool** | If the user can delete deals | [optional] +**can_edit_custom_fields** | **bool** | If the user can edit custom fields | [optional] +**can_edit_deals_closed_date** | **bool** | If the user can edit deals' closed date | [optional] +**can_edit_products** | **bool** | If the user can edit products | [optional] +**can_edit_shared_filters** | **bool** | If the user can edit shared filters | [optional] +**can_export_data_from_lists** | **bool** | If the user can export data from item lists | [optional] +**can_follow_other_users** | **bool** | If the user can follow other users | [optional] +**can_merge_deals** | **bool** | If the user can merge deals | [optional] +**can_merge_organizations** | **bool** | If the user can merge organizations | [optional] +**can_merge_people** | **bool** | If the user can merge people | [optional] +**can_modify_labels** | **bool** | If the user can modify labels | [optional] +**can_see_company_wide_statistics** | **bool** | If the user can see company-wide statistics | [optional] +**can_see_deals_list_summary** | **bool** | If the user can see the summary on the deals page | [optional] +**can_see_hidden_items_names** | **bool** | If the user can see the names of hidden items | [optional] +**can_see_other_users** | **bool** | If the user can see other users | [optional] +**can_see_other_users_statistics** | **bool** | If the user can see other users' statistics | [optional] +**can_see_security_dashboard** | **bool** | If the user can see security dashboard | [optional] +**can_share_filters** | **bool** | If the user can share filters | [optional] +**can_share_insights** | **bool** | If the user can share insights | [optional] +**can_use_api** | **bool** | If the user can use API | [optional] +**can_use_email_tracking** | **bool** | If the user can use email tracking | [optional] +**can_use_import** | **bool** | If the user can use import | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserSettings.md b/docs/Model/UserSettings.md new file mode 100644 index 00000000..3c3ab3e0 --- /dev/null +++ b/docs/Model/UserSettings.md @@ -0,0 +1,10 @@ +# # UserSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\UserSettingsItem**](UserSettingsItem.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/UserSettingsAllOf.md b/docs/Model/UserSettingsAllOf.md new file mode 100644 index 00000000..40c50467 --- /dev/null +++ b/docs/Model/UserSettingsAllOf.md @@ -0,0 +1,9 @@ +# # UserSettingsAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\UserSettingsItem**](UserSettingsItem.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/UserSettingsItem.md b/docs/Model/UserSettingsItem.md new file mode 100644 index 00000000..133279e0 --- /dev/null +++ b/docs/Model/UserSettingsItem.md @@ -0,0 +1,18 @@ +# # UserSettingsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**marketplace_allow_custom_install_url** | **bool** | If the vendors are allowed to install custom Marketplace apps with functionality and content in the Pipedrive UI or not | [optional] +**marketplace_app_extensions_vendor** | **bool** | If the vendors are allowed to extend their Marketplace apps with functionality and content in the Pipedrive UI or not | [optional] +**marketplace_team** | **bool** | If the vendors are allowed to be part of the Marketplace team or not | [optional] +**list_limit** | **float** | The number of results shown in list by default | [optional] +**beta_app** | **bool** | Whether beta app is enabled | [optional] +**prevent_salesphone_callto_override** | **bool** | Prevent salesphone call to override | [optional] +**file_upload_destination** | **string** | The destination of file upload | [optional] +**callto_link_syntax** | **string** | The call to link syntax | [optional] +**autofill_deal_expected_close_date** | **bool** | Whether the expected close date of the deal is filled automatically or not | [optional] +**person_duplicate_condition** | **string** | Allow the vendors to duplicate a person | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Users.md b/docs/Model/Users.md new file mode 100644 index 00000000..a8ecc926 --- /dev/null +++ b/docs/Model/Users.md @@ -0,0 +1,10 @@ +# # Users + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**data** | [**\Pipedrive\Model\BaseUser[]**](BaseUser.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/UsersAllOf.md b/docs/Model/UsersAllOf.md new file mode 100644 index 00000000..d9ce6782 --- /dev/null +++ b/docs/Model/UsersAllOf.md @@ -0,0 +1,9 @@ +# # UsersAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseUser[]**](BaseUser.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/VisibleTo.md b/docs/Model/VisibleTo.md new file mode 100644 index 00000000..3d80d564 --- /dev/null +++ b/docs/Model/VisibleTo.md @@ -0,0 +1,8 @@ +# # VisibleTo + +## 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/Webhook.md b/docs/Model/Webhook.md new file mode 100644 index 00000000..13bea77b --- /dev/null +++ b/docs/Model/Webhook.md @@ -0,0 +1,11 @@ +# # Webhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**status** | **string** | The status of the response | [optional] +**data** | [**\Pipedrive\Model\BaseWebhook**](BaseWebhook.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/WebhookAllOf.md b/docs/Model/WebhookAllOf.md new file mode 100644 index 00000000..5dd099c5 --- /dev/null +++ b/docs/Model/WebhookAllOf.md @@ -0,0 +1,9 @@ +# # WebhookAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseWebhook**](BaseWebhook.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/WebhookBadRequest.md b/docs/Model/WebhookBadRequest.md new file mode 100644 index 00000000..774d114a --- /dev/null +++ b/docs/Model/WebhookBadRequest.md @@ -0,0 +1,11 @@ +# # WebhookBadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**status** | **string** | The status of the response | [optional] +**errors** | **object** | List of 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/WebhookBadRequestAllOf.md b/docs/Model/WebhookBadRequestAllOf.md new file mode 100644 index 00000000..3cf9d901 --- /dev/null +++ b/docs/Model/WebhookBadRequestAllOf.md @@ -0,0 +1,9 @@ +# # WebhookBadRequestAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | **object** | List of 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/Webhooks.md b/docs/Model/Webhooks.md new file mode 100644 index 00000000..abf4cf19 --- /dev/null +++ b/docs/Model/Webhooks.md @@ -0,0 +1,11 @@ +# # Webhooks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**status** | **string** | The status of the response | [optional] +**data** | [**\Pipedrive\Model\BaseWebhook[]**](BaseWebhook.md) | The array of Webhooks | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WebhooksAllOf.md b/docs/Model/WebhooksAllOf.md new file mode 100644 index 00000000..d9cac1d5 --- /dev/null +++ b/docs/Model/WebhooksAllOf.md @@ -0,0 +1,9 @@ +# # WebhooksAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Pipedrive\Model\BaseWebhook[]**](BaseWebhook.md) | The array of Webhooks | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WebhooksDeleteForbiddenSchema.md b/docs/Model/WebhooksDeleteForbiddenSchema.md new file mode 100644 index 00000000..88a94af8 --- /dev/null +++ b/docs/Model/WebhooksDeleteForbiddenSchema.md @@ -0,0 +1,10 @@ +# # WebhooksDeleteForbiddenSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | If the response is successful or not | [optional] +**message** | **string** | The error message | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WebhooksDeleteForbiddenSchemaAllOf.md b/docs/Model/WebhooksDeleteForbiddenSchemaAllOf.md new file mode 100644 index 00000000..485e3a93 --- /dev/null +++ b/docs/Model/WebhooksDeleteForbiddenSchemaAllOf.md @@ -0,0 +1,9 @@ +# # WebhooksDeleteForbiddenSchemaAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | The error message | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/ActivitiesApi.php b/lib/Api/ActivitiesApi.php new file mode 100644 index 00000000..8eeda635 --- /dev/null +++ b/lib/Api/ActivitiesApi.php @@ -0,0 +1,2393 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addActivity + * + * Add an activity + * + * @param \Pipedrive\Model\ActivityPostObject|null $activity_post_object activity_post_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddActivityResponse200 + */ + public function addActivity($activity_post_object = null) + { + list($response) = $this->addActivityWithHttpInfo($activity_post_object); + return $response; + } + + /** + * Operation addActivityWithHttpInfo + * + * Add an activity + * + * @param \Pipedrive\Model\ActivityPostObject|null $activity_post_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddActivityResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function addActivityWithHttpInfo($activity_post_object = null) + { + $request = $this->addActivityRequest($activity_post_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addActivityRequest($activity_post_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddActivityResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addActivityAsync + * + * Add an activity + * + * @param \Pipedrive\Model\ActivityPostObject|null $activity_post_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addActivityAsync($activity_post_object = null): PromiseInterface + { + return $this->addActivityAsyncWithHttpInfo($activity_post_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addActivityAsyncWithHttpInfo + * + * Add an activity + * + * @param \Pipedrive\Model\ActivityPostObject|null $activity_post_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addActivityAsyncWithHttpInfo($activity_post_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddActivityResponse200'; + $request = $this->addActivityRequest($activity_post_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addActivity' + * + * @param \Pipedrive\Model\ActivityPostObject|null $activity_post_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addActivityRequest($activity_post_object = null): Request + { + + $resourcePath = '/activities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($activity_post_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($activity_post_object)); + } else { + $httpBody = $activity_post_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteActivities + * + * Delete multiple activities in bulk + * + * @param string $ids The comma-separated IDs of activities that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteActivitiesResponse200 + */ + public function deleteActivities($ids) + { + list($response) = $this->deleteActivitiesWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteActivitiesWithHttpInfo + * + * Delete multiple activities in bulk + * + * @param string $ids The comma-separated IDs of activities that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteActivitiesResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteActivitiesWithHttpInfo($ids) + { + $request = $this->deleteActivitiesRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteActivitiesRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteActivitiesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteActivitiesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteActivitiesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteActivitiesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteActivitiesResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteActivitiesAsync + * + * Delete multiple activities in bulk + * + * @param string $ids The comma-separated IDs of activities that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivitiesAsync($ids): PromiseInterface + { + return $this->deleteActivitiesAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteActivitiesAsyncWithHttpInfo + * + * Delete multiple activities in bulk + * + * @param string $ids The comma-separated IDs of activities that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivitiesAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteActivitiesResponse200'; + $request = $this->deleteActivitiesRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteActivities' + * + * @param string $ids The comma-separated IDs of activities that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteActivitiesRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteActivities' + ); + } + + $resourcePath = '/activities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteActivity + * + * Delete an activity + * + * @param int $id The ID of the activity (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteActivityResponse200 + */ + public function deleteActivity($id) + { + list($response) = $this->deleteActivityWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteActivityWithHttpInfo + * + * Delete an activity + * + * @param int $id The ID of the activity (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteActivityResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteActivityWithHttpInfo($id) + { + $request = $this->deleteActivityRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteActivityRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteActivityResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteActivityAsync + * + * Delete an activity + * + * @param int $id The ID of the activity (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivityAsync($id): PromiseInterface + { + return $this->deleteActivityAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteActivityAsyncWithHttpInfo + * + * Delete an activity + * + * @param int $id The ID of the activity (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivityAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteActivityResponse200'; + $request = $this->deleteActivityRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteActivity' + * + * @param int $id The ID of the activity (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteActivityRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteActivity' + ); + } + + $resourcePath = '/activities/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getActivities + * + * Get all activities assigned to a particular user + * + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. (optional) + * @param int|null $filter_id The ID of the filter to use (will narrow down results if used together with `user_id` parameter) (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param \DateTime|null $start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \DateTime|null $end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetActivitiesResponse200 + */ + public function getActivities($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null) + { + list($response) = $this->getActivitiesWithHttpInfo($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done); + return $response; + } + + /** + * Operation getActivitiesWithHttpInfo + * + * Get all activities assigned to a particular user + * + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. (optional) + * @param int|null $filter_id The ID of the filter to use (will narrow down results if used together with `user_id` parameter) (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param \DateTime|null $start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \DateTime|null $end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetActivitiesResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getActivitiesWithHttpInfo($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null) + { + $request = $this->getActivitiesRequest($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getActivitiesRequest($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetActivitiesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetActivitiesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetActivitiesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetActivitiesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetActivitiesResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getActivitiesAsync + * + * Get all activities assigned to a particular user + * + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. (optional) + * @param int|null $filter_id The ID of the filter to use (will narrow down results if used together with `user_id` parameter) (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param \DateTime|null $start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \DateTime|null $end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivitiesAsync($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null): PromiseInterface + { + return $this->getActivitiesAsyncWithHttpInfo($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getActivitiesAsyncWithHttpInfo + * + * Get all activities assigned to a particular user + * + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. (optional) + * @param int|null $filter_id The ID of the filter to use (will narrow down results if used together with `user_id` parameter) (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param \DateTime|null $start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \DateTime|null $end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivitiesAsyncWithHttpInfo($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetActivitiesResponse200'; + $request = $this->getActivitiesRequest($user_id, $filter_id, $type, $limit, $start, $start_date, $end_date, $done); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getActivities' + * + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. (optional) + * @param int|null $filter_id The ID of the filter to use (will narrow down results if used together with `user_id` parameter) (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param \DateTime|null $start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \DateTime|null $end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both done and not done activities. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getActivitiesRequest($user_id = null, $filter_id = null, $type = null, $limit = null, $start = null, $start_date = null, $end_date = null, $done = null): Request + { + + $resourcePath = '/activities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type)) { + $type = ObjectSerializer::serializeCollection($type, '', true); + } + if ($type !== null) { + $queryParams['type'] = $type; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start_date)) { + $start_date = ObjectSerializer::serializeCollection($start_date, '', true); + } + if ($start_date !== null) { + $queryParams['start_date'] = $start_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($end_date)) { + $end_date = ObjectSerializer::serializeCollection($end_date, '', true); + } + if ($end_date !== null) { + $queryParams['end_date'] = $end_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($done)) { + $done = ObjectSerializer::serializeCollection($done, '', true); + } + if ($done !== null) { + $queryParams['done'] = $done; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getActivitiesCollection + * + * Get all activities (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, all activities are returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetActivitiesCollectionResponse200|\Pipedrive\Model\FailResponse + */ + public function getActivitiesCollection($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null) + { + list($response) = $this->getActivitiesCollectionWithHttpInfo($cursor, $limit, $since, $until, $user_id, $done, $type); + return $response; + } + + /** + * Operation getActivitiesCollectionWithHttpInfo + * + * Get all activities (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, all activities are returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetActivitiesCollectionResponse200|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getActivitiesCollectionWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null) + { + $request = $this->getActivitiesCollectionRequest($cursor, $limit, $since, $until, $user_id, $done, $type); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getActivitiesCollectionRequest($cursor, $limit, $since, $until, $user_id, $done, $type); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetActivitiesCollectionResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetActivitiesCollectionResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetActivitiesCollectionResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetActivitiesCollectionResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetActivitiesCollectionResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getActivitiesCollectionAsync + * + * Get all activities (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, all activities are returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivitiesCollectionAsync($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null): PromiseInterface + { + return $this->getActivitiesCollectionAsyncWithHttpInfo($cursor, $limit, $since, $until, $user_id, $done, $type) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getActivitiesCollectionAsyncWithHttpInfo + * + * Get all activities (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, all activities are returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivitiesCollectionAsyncWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetActivitiesCollectionResponse200'; + $request = $this->getActivitiesCollectionRequest($cursor, $limit, $since, $until, $user_id, $done, $type); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getActivitiesCollection' + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id The ID of the user whose activities will be fetched. If omitted, all activities are returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities. (optional) + * @param string|null $type The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getActivitiesCollectionRequest($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $done = null, $type = null): Request + { + + $resourcePath = '/activities/collection'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($cursor)) { + $cursor = ObjectSerializer::serializeCollection($cursor, '', true); + } + if ($cursor !== null) { + $queryParams['cursor'] = $cursor; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($since)) { + $since = ObjectSerializer::serializeCollection($since, '', true); + } + if ($since !== null) { + $queryParams['since'] = $since; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($until)) { + $until = ObjectSerializer::serializeCollection($until, '', true); + } + if ($until !== null) { + $queryParams['until'] = $until; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($done)) { + $done = ObjectSerializer::serializeCollection($done, '', true); + } + if ($done !== null) { + $queryParams['done'] = $done; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type)) { + $type = ObjectSerializer::serializeCollection($type, '', true); + } + if ($type !== null) { + $queryParams['type'] = $type; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getActivity + * + * Get details of an activity + * + * @param int $id The ID of the activity (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetActivityResponse200 + */ + public function getActivity($id) + { + list($response) = $this->getActivityWithHttpInfo($id); + return $response; + } + + /** + * Operation getActivityWithHttpInfo + * + * Get details of an activity + * + * @param int $id The ID of the activity (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetActivityResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getActivityWithHttpInfo($id) + { + $request = $this->getActivityRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getActivityRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetActivityResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getActivityAsync + * + * Get details of an activity + * + * @param int $id The ID of the activity (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivityAsync($id): PromiseInterface + { + return $this->getActivityAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getActivityAsyncWithHttpInfo + * + * Get details of an activity + * + * @param int $id The ID of the activity (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivityAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetActivityResponse200'; + $request = $this->getActivityRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getActivity' + * + * @param int $id The ID of the activity (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getActivityRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getActivity' + ); + } + + $resourcePath = '/activities/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateActivity + * + * Update an activity + * + * @param int $id The ID of the activity (required) + * @param \Pipedrive\Model\ActivityPutObject|null $activity_put_object activity_put_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UpdateActivityResponse200 + */ + public function updateActivity($id, $activity_put_object = null) + { + list($response) = $this->updateActivityWithHttpInfo($id, $activity_put_object); + return $response; + } + + /** + * Operation updateActivityWithHttpInfo + * + * Update an activity + * + * @param int $id The ID of the activity (required) + * @param \Pipedrive\Model\ActivityPutObject|null $activity_put_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UpdateActivityResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function updateActivityWithHttpInfo($id, $activity_put_object = null) + { + $request = $this->updateActivityRequest($id, $activity_put_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateActivityRequest($id, $activity_put_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdateActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdateActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdateActivityResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdateActivityResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UpdateActivityResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateActivityAsync + * + * Update an activity + * + * @param int $id The ID of the activity (required) + * @param \Pipedrive\Model\ActivityPutObject|null $activity_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateActivityAsync($id, $activity_put_object = null): PromiseInterface + { + return $this->updateActivityAsyncWithHttpInfo($id, $activity_put_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateActivityAsyncWithHttpInfo + * + * Update an activity + * + * @param int $id The ID of the activity (required) + * @param \Pipedrive\Model\ActivityPutObject|null $activity_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateActivityAsyncWithHttpInfo($id, $activity_put_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UpdateActivityResponse200'; + $request = $this->updateActivityRequest($id, $activity_put_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateActivity' + * + * @param int $id The ID of the activity (required) + * @param \Pipedrive\Model\ActivityPutObject|null $activity_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateActivityRequest($id, $activity_put_object = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateActivity' + ); + } + + $resourcePath = '/activities/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($activity_put_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($activity_put_object)); + } else { + $httpBody = $activity_put_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/ActivityFieldsApi.php b/lib/Api/ActivityFieldsApi.php new file mode 100644 index 00000000..94df646b --- /dev/null +++ b/lib/Api/ActivityFieldsApi.php @@ -0,0 +1,419 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getActivityFields + * + * Get all activity fields + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldsResponse + */ + public function getActivityFields() + { + list($response) = $this->getActivityFieldsWithHttpInfo(); + return $response; + } + + /** + * Operation getActivityFieldsWithHttpInfo + * + * Get all activity fields + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getActivityFieldsWithHttpInfo() + { + $request = $this->getActivityFieldsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getActivityFieldsRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getActivityFieldsAsync + * + * Get all activity fields + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivityFieldsAsync(): PromiseInterface + { + return $this->getActivityFieldsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getActivityFieldsAsyncWithHttpInfo + * + * Get all activity fields + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivityFieldsAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldsResponse'; + $request = $this->getActivityFieldsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getActivityFields' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getActivityFieldsRequest(): Request + { + + $resourcePath = '/activityFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/ActivityTypesApi.php b/lib/Api/ActivityTypesApi.php new file mode 100644 index 00000000..c14637ea --- /dev/null +++ b/lib/Api/ActivityTypesApi.php @@ -0,0 +1,1605 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addActivityType + * + * Add new activity type + * + * @param \Pipedrive\Model\ActivityTypeCreateRequest|null $activity_type_create_request activity_type_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse + */ + public function addActivityType($activity_type_create_request = null) + { + list($response) = $this->addActivityTypeWithHttpInfo($activity_type_create_request); + return $response; + } + + /** + * Operation addActivityTypeWithHttpInfo + * + * Add new activity type + * + * @param \Pipedrive\Model\ActivityTypeCreateRequest|null $activity_type_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addActivityTypeWithHttpInfo($activity_type_create_request = null) + { + $request = $this->addActivityTypeRequest($activity_type_create_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addActivityTypeRequest($activity_type_create_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addActivityTypeAsync + * + * Add new activity type + * + * @param \Pipedrive\Model\ActivityTypeCreateRequest|null $activity_type_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addActivityTypeAsync($activity_type_create_request = null): PromiseInterface + { + return $this->addActivityTypeAsyncWithHttpInfo($activity_type_create_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addActivityTypeAsyncWithHttpInfo + * + * Add new activity type + * + * @param \Pipedrive\Model\ActivityTypeCreateRequest|null $activity_type_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addActivityTypeAsyncWithHttpInfo($activity_type_create_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse'; + $request = $this->addActivityTypeRequest($activity_type_create_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addActivityType' + * + * @param \Pipedrive\Model\ActivityTypeCreateRequest|null $activity_type_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addActivityTypeRequest($activity_type_create_request = null): Request + { + + $resourcePath = '/activityTypes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($activity_type_create_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($activity_type_create_request)); + } else { + $httpBody = $activity_type_create_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteActivityType + * + * Delete an activity type + * + * @param int $id The ID of the activity type (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse + */ + public function deleteActivityType($id) + { + list($response) = $this->deleteActivityTypeWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteActivityTypeWithHttpInfo + * + * Delete an activity type + * + * @param int $id The ID of the activity type (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteActivityTypeWithHttpInfo($id) + { + $request = $this->deleteActivityTypeRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteActivityTypeRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteActivityTypeAsync + * + * Delete an activity type + * + * @param int $id The ID of the activity type (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivityTypeAsync($id): PromiseInterface + { + return $this->deleteActivityTypeAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteActivityTypeAsyncWithHttpInfo + * + * Delete an activity type + * + * @param int $id The ID of the activity type (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivityTypeAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse'; + $request = $this->deleteActivityTypeRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteActivityType' + * + * @param int $id The ID of the activity type (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteActivityTypeRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteActivityType' + ); + } + + $resourcePath = '/activityTypes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteActivityTypes + * + * Delete multiple activity types in bulk + * + * @param string $ids The comma-separated activity type IDs (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ActivityTypeBulkDeleteResponse + */ + public function deleteActivityTypes($ids) + { + list($response) = $this->deleteActivityTypesWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteActivityTypesWithHttpInfo + * + * Delete multiple activity types in bulk + * + * @param string $ids The comma-separated activity type IDs (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ActivityTypeBulkDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteActivityTypesWithHttpInfo($ids) + { + $request = $this->deleteActivityTypesRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteActivityTypesRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeBulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeBulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeBulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeBulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ActivityTypeBulkDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteActivityTypesAsync + * + * Delete multiple activity types in bulk + * + * @param string $ids The comma-separated activity type IDs (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivityTypesAsync($ids): PromiseInterface + { + return $this->deleteActivityTypesAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteActivityTypesAsyncWithHttpInfo + * + * Delete multiple activity types in bulk + * + * @param string $ids The comma-separated activity type IDs (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteActivityTypesAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\ActivityTypeBulkDeleteResponse'; + $request = $this->deleteActivityTypesRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteActivityTypes' + * + * @param string $ids The comma-separated activity type IDs (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteActivityTypesRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteActivityTypes' + ); + } + + $resourcePath = '/activityTypes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getActivityTypes + * + * Get all activity types + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ActivityTypeListResponse + */ + public function getActivityTypes() + { + list($response) = $this->getActivityTypesWithHttpInfo(); + return $response; + } + + /** + * Operation getActivityTypesWithHttpInfo + * + * Get all activity types + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ActivityTypeListResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getActivityTypesWithHttpInfo() + { + $request = $this->getActivityTypesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getActivityTypesRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ActivityTypeListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getActivityTypesAsync + * + * Get all activity types + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivityTypesAsync(): PromiseInterface + { + return $this->getActivityTypesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getActivityTypesAsyncWithHttpInfo + * + * Get all activity types + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getActivityTypesAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\ActivityTypeListResponse'; + $request = $this->getActivityTypesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getActivityTypes' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getActivityTypesRequest(): Request + { + + $resourcePath = '/activityTypes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateActivityType + * + * Update an activity type + * + * @param int $id The ID of the activity type (required) + * @param \Pipedrive\Model\ActivityTypeUpdateRequest|null $activity_type_update_request activity_type_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse + */ + public function updateActivityType($id, $activity_type_update_request = null) + { + list($response) = $this->updateActivityTypeWithHttpInfo($id, $activity_type_update_request); + return $response; + } + + /** + * Operation updateActivityTypeWithHttpInfo + * + * Update an activity type + * + * @param int $id The ID of the activity type (required) + * @param \Pipedrive\Model\ActivityTypeUpdateRequest|null $activity_type_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateActivityTypeWithHttpInfo($id, $activity_type_update_request = null) + { + $request = $this->updateActivityTypeRequest($id, $activity_type_update_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateActivityTypeRequest($id, $activity_type_update_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateActivityTypeAsync + * + * Update an activity type + * + * @param int $id The ID of the activity type (required) + * @param \Pipedrive\Model\ActivityTypeUpdateRequest|null $activity_type_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateActivityTypeAsync($id, $activity_type_update_request = null): PromiseInterface + { + return $this->updateActivityTypeAsyncWithHttpInfo($id, $activity_type_update_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateActivityTypeAsyncWithHttpInfo + * + * Update an activity type + * + * @param int $id The ID of the activity type (required) + * @param \Pipedrive\Model\ActivityTypeUpdateRequest|null $activity_type_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateActivityTypeAsyncWithHttpInfo($id, $activity_type_update_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ActivityTypeCreateUpdateDeleteResponse'; + $request = $this->updateActivityTypeRequest($id, $activity_type_update_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateActivityType' + * + * @param int $id The ID of the activity type (required) + * @param \Pipedrive\Model\ActivityTypeUpdateRequest|null $activity_type_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateActivityTypeRequest($id, $activity_type_update_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateActivityType' + ); + } + + $resourcePath = '/activityTypes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($activity_type_update_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($activity_type_update_request)); + } else { + $httpBody = $activity_type_update_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/BillingApi.php b/lib/Api/BillingApi.php new file mode 100644 index 00000000..42ae78bd --- /dev/null +++ b/lib/Api/BillingApi.php @@ -0,0 +1,419 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getCompanyAddons + * + * Get all add-ons for a single company + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionAddonsResponse + */ + public function getCompanyAddons() + { + list($response) = $this->getCompanyAddonsWithHttpInfo(); + return $response; + } + + /** + * Operation getCompanyAddonsWithHttpInfo + * + * Get all add-ons for a single company + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionAddonsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getCompanyAddonsWithHttpInfo() + { + $request = $this->getCompanyAddonsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getCompanyAddonsRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionAddonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionAddonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionAddonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionAddonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionAddonsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCompanyAddonsAsync + * + * Get all add-ons for a single company + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCompanyAddonsAsync(): PromiseInterface + { + return $this->getCompanyAddonsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCompanyAddonsAsyncWithHttpInfo + * + * Get all add-ons for a single company + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCompanyAddonsAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionAddonsResponse'; + $request = $this->getCompanyAddonsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCompanyAddons' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getCompanyAddonsRequest(): Request + { + + $resourcePath = '/billing/subscriptions/addons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/CallLogsApi.php b/lib/Api/CallLogsApi.php new file mode 100644 index 00000000..e79e7a69 --- /dev/null +++ b/lib/Api/CallLogsApi.php @@ -0,0 +1,1897 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addCallLog + * + * Add a call log + * + * @param \Pipedrive\Model\CallLogObject|null $call_log_object call_log_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\CallLogResponse200|\Pipedrive\Model\CallLogResponse400|\Pipedrive\Model\CallLogResponse403|\Pipedrive\Model\CallLogResponse404|\Pipedrive\Model\CallLogResponse500 + */ + public function addCallLog($call_log_object = null) + { + list($response) = $this->addCallLogWithHttpInfo($call_log_object); + return $response; + } + + /** + * Operation addCallLogWithHttpInfo + * + * Add a call log + * + * @param \Pipedrive\Model\CallLogObject|null $call_log_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\CallLogResponse200|\Pipedrive\Model\CallLogResponse400|\Pipedrive\Model\CallLogResponse403|\Pipedrive\Model\CallLogResponse404|\Pipedrive\Model\CallLogResponse500, HTTP status code, HTTP response headers (array of strings) + */ + public function addCallLogWithHttpInfo($call_log_object = null) + { + $request = $this->addCallLogRequest($call_log_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addCallLogRequest($call_log_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse400' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse400', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse403' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse403', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse500' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse500', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse403', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse500', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addCallLogAsync + * + * Add a call log + * + * @param \Pipedrive\Model\CallLogObject|null $call_log_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addCallLogAsync($call_log_object = null): PromiseInterface + { + return $this->addCallLogAsyncWithHttpInfo($call_log_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addCallLogAsyncWithHttpInfo + * + * Add a call log + * + * @param \Pipedrive\Model\CallLogObject|null $call_log_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addCallLogAsyncWithHttpInfo($call_log_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\CallLogResponse200'; + $request = $this->addCallLogRequest($call_log_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addCallLog' + * + * @param \Pipedrive\Model\CallLogObject|null $call_log_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addCallLogRequest($call_log_object = null): Request + { + + $resourcePath = '/callLogs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($call_log_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($call_log_object)); + } else { + $httpBody = $call_log_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addCallLogAudioFile + * + * Attach an audio file to the call log + * + * @param string $id The ID received when you create the call log (required) + * @param \SplFileObject $file Audio file supported by the HTML5 specification (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\BaseResponse|\Pipedrive\Model\CallLogResponse404|\Pipedrive\Model\CallLogResponse409|\Pipedrive\Model\CallLogResponse500 + */ + public function addCallLogAudioFile($id, $file) + { + list($response) = $this->addCallLogAudioFileWithHttpInfo($id, $file); + return $response; + } + + /** + * Operation addCallLogAudioFileWithHttpInfo + * + * Attach an audio file to the call log + * + * @param string $id The ID received when you create the call log (required) + * @param \SplFileObject $file Audio file supported by the HTML5 specification (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\BaseResponse|\Pipedrive\Model\CallLogResponse404|\Pipedrive\Model\CallLogResponse409|\Pipedrive\Model\CallLogResponse500, HTTP status code, HTTP response headers (array of strings) + */ + public function addCallLogAudioFileWithHttpInfo($id, $file) + { + $request = $this->addCallLogAudioFileRequest($id, $file); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addCallLogAudioFileRequest($id, $file); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BaseResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BaseResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse500' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse500', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BaseResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BaseResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\BaseResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse500', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addCallLogAudioFileAsync + * + * Attach an audio file to the call log + * + * @param string $id The ID received when you create the call log (required) + * @param \SplFileObject $file Audio file supported by the HTML5 specification (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addCallLogAudioFileAsync($id, $file): PromiseInterface + { + return $this->addCallLogAudioFileAsyncWithHttpInfo($id, $file) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addCallLogAudioFileAsyncWithHttpInfo + * + * Attach an audio file to the call log + * + * @param string $id The ID received when you create the call log (required) + * @param \SplFileObject $file Audio file supported by the HTML5 specification (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addCallLogAudioFileAsyncWithHttpInfo($id, $file): PromiseInterface + { + $returnType = '\Pipedrive\Model\BaseResponse'; + $request = $this->addCallLogAudioFileRequest($id, $file); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addCallLogAudioFile' + * + * @param string $id The ID received when you create the call log (required) + * @param \SplFileObject $file Audio file supported by the HTML5 specification (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addCallLogAudioFileRequest($id, $file): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addCallLogAudioFile' + ); + } + // verify the required parameter 'file' is set + /* @phpstan-ignore-next-line */ + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling addCallLogAudioFile' + ); + } + + $resourcePath = '/callLogs/{id}/recordings'; + $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'] = []; + /* @phpstan-ignore-next-line */ + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteCallLog + * + * Delete a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\BaseResponse|\Pipedrive\Model\CallLogResponse403|\Pipedrive\Model\CallLogResponse404|\Pipedrive\Model\CallLogResponse410|\Pipedrive\Model\CallLogResponse500 + */ + public function deleteCallLog($id) + { + list($response) = $this->deleteCallLogWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteCallLogWithHttpInfo + * + * Delete a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\BaseResponse|\Pipedrive\Model\CallLogResponse403|\Pipedrive\Model\CallLogResponse404|\Pipedrive\Model\CallLogResponse410|\Pipedrive\Model\CallLogResponse500, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCallLogWithHttpInfo($id) + { + $request = $this->deleteCallLogRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteCallLogRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BaseResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BaseResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse403' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse403', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 410: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse410' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse410', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse500' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse500', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BaseResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BaseResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\BaseResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse403', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 410: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse410', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse500', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteCallLogAsync + * + * Delete a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteCallLogAsync($id): PromiseInterface + { + return $this->deleteCallLogAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCallLogAsyncWithHttpInfo + * + * Delete a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteCallLogAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\BaseResponse'; + $request = $this->deleteCallLogRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteCallLog' + * + * @param string $id The ID received when you create the call log (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteCallLogRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteCallLog' + ); + } + + $resourcePath = '/callLogs/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCallLog + * + * Get details of a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\CallLogResponse200|\Pipedrive\Model\CallLogResponse404 + */ + public function getCallLog($id) + { + list($response) = $this->getCallLogWithHttpInfo($id); + return $response; + } + + /** + * Operation getCallLogWithHttpInfo + * + * Get details of a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\CallLogResponse200|\Pipedrive\Model\CallLogResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function getCallLogWithHttpInfo($id) + { + $request = $this->getCallLogRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getCallLogRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCallLogAsync + * + * Get details of a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCallLogAsync($id): PromiseInterface + { + return $this->getCallLogAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCallLogAsyncWithHttpInfo + * + * Get details of a call log + * + * @param string $id The ID received when you create the call log (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCallLogAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\CallLogResponse200'; + $request = $this->getCallLogRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCallLog' + * + * @param string $id The ID received when you create the call log (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getCallLogRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getCallLog' + ); + } + + $resourcePath = '/callLogs/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserCallLogs + * + * Get all call logs assigned to a particular user + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit For pagination, the limit of entries to be returned. The upper limit is 50. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\CallLogsResponse + */ + public function getUserCallLogs($start = 0, $limit = null) + { + list($response) = $this->getUserCallLogsWithHttpInfo($start, $limit); + return $response; + } + + /** + * Operation getUserCallLogsWithHttpInfo + * + * Get all call logs assigned to a particular user + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit For pagination, the limit of entries to be returned. The upper limit is 50. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\CallLogsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserCallLogsWithHttpInfo($start = 0, $limit = null) + { + $request = $this->getUserCallLogsRequest($start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserCallLogsRequest($start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CallLogsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CallLogsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CallLogsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserCallLogsAsync + * + * Get all call logs assigned to a particular user + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit For pagination, the limit of entries to be returned. The upper limit is 50. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserCallLogsAsync($start = 0, $limit = null): PromiseInterface + { + return $this->getUserCallLogsAsyncWithHttpInfo($start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserCallLogsAsyncWithHttpInfo + * + * Get all call logs assigned to a particular user + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit For pagination, the limit of entries to be returned. The upper limit is 50. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserCallLogsAsyncWithHttpInfo($start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\CallLogsResponse'; + $request = $this->getUserCallLogsRequest($start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserCallLogs' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit For pagination, the limit of entries to be returned. The upper limit is 50. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserCallLogsRequest($start = 0, $limit = null): Request + { + + $resourcePath = '/callLogs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/ChannelsApi.php b/lib/Api/ChannelsApi.php new file mode 100644 index 00000000..fe946d24 --- /dev/null +++ b/lib/Api/ChannelsApi.php @@ -0,0 +1,1455 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addChannel + * + * Add a channel + * + * @param \Pipedrive\Model\ChannelObject|null $channel_object channel_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ChannelObjectResponse|\Pipedrive\Model\InlineResponse400|\Pipedrive\Model\InlineResponse403 + */ + public function addChannel($channel_object = null) + { + list($response) = $this->addChannelWithHttpInfo($channel_object); + return $response; + } + + /** + * Operation addChannelWithHttpInfo + * + * Add a channel + * + * @param \Pipedrive\Model\ChannelObject|null $channel_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ChannelObjectResponse|\Pipedrive\Model\InlineResponse400|\Pipedrive\Model\InlineResponse403, HTTP status code, HTTP response headers (array of strings) + */ + public function addChannelWithHttpInfo($channel_object = null) + { + $request = $this->addChannelRequest($channel_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addChannelRequest($channel_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ChannelObjectResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChannelObjectResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse400' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse400', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse403' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse403', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ChannelObjectResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ChannelObjectResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ChannelObjectResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse403', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addChannelAsync + * + * Add a channel + * + * @param \Pipedrive\Model\ChannelObject|null $channel_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addChannelAsync($channel_object = null): PromiseInterface + { + return $this->addChannelAsyncWithHttpInfo($channel_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addChannelAsyncWithHttpInfo + * + * Add a channel + * + * @param \Pipedrive\Model\ChannelObject|null $channel_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addChannelAsyncWithHttpInfo($channel_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ChannelObjectResponse'; + $request = $this->addChannelRequest($channel_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addChannel' + * + * @param \Pipedrive\Model\ChannelObject|null $channel_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addChannelRequest($channel_object = null): Request + { + + $resourcePath = '/channels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($channel_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($channel_object)); + } else { + $httpBody = $channel_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteChannel + * + * Delete a channel + * + * @param string $id The ID of the channel provided by the integration (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteChannelSuccess|\Pipedrive\Model\InlineResponse400 + */ + public function deleteChannel($id) + { + list($response) = $this->deleteChannelWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteChannelWithHttpInfo + * + * Delete a channel + * + * @param string $id The ID of the channel provided by the integration (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteChannelSuccess|\Pipedrive\Model\InlineResponse400, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteChannelWithHttpInfo($id) + { + $request = $this->deleteChannelRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteChannelRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteChannelSuccess' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteChannelSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse400' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse400', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteChannelSuccess' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteChannelSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteChannelSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteChannelAsync + * + * Delete a channel + * + * @param string $id The ID of the channel provided by the integration (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteChannelAsync($id): PromiseInterface + { + return $this->deleteChannelAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteChannelAsyncWithHttpInfo + * + * Delete a channel + * + * @param string $id The ID of the channel provided by the integration (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteChannelAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteChannelSuccess'; + $request = $this->deleteChannelRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteChannel' + * + * @param string $id The ID of the channel provided by the integration (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteChannelRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteChannel' + ); + } + + $resourcePath = '/channels/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteConversation + * + * Delete a conversation + * + * @param string $channel_id The ID of the channel provided by the integration (required) + * @param string $conversation_id The ID of the conversation provided by the integration (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteConversationSuccess|\Pipedrive\Model\InlineResponse4031|\Pipedrive\Model\InlineResponse404 + */ + public function deleteConversation($channel_id, $conversation_id) + { + list($response) = $this->deleteConversationWithHttpInfo($channel_id, $conversation_id); + return $response; + } + + /** + * Operation deleteConversationWithHttpInfo + * + * Delete a conversation + * + * @param string $channel_id The ID of the channel provided by the integration (required) + * @param string $conversation_id The ID of the conversation provided by the integration (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteConversationSuccess|\Pipedrive\Model\InlineResponse4031|\Pipedrive\Model\InlineResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteConversationWithHttpInfo($channel_id, $conversation_id) + { + $request = $this->deleteConversationRequest($channel_id, $conversation_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteConversationRequest($channel_id, $conversation_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteConversationSuccess' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteConversationSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse4031' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse4031', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteConversationSuccess' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteConversationSuccess', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteConversationSuccess', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse4031', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteConversationAsync + * + * Delete a conversation + * + * @param string $channel_id The ID of the channel provided by the integration (required) + * @param string $conversation_id The ID of the conversation provided by the integration (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteConversationAsync($channel_id, $conversation_id): PromiseInterface + { + return $this->deleteConversationAsyncWithHttpInfo($channel_id, $conversation_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteConversationAsyncWithHttpInfo + * + * Delete a conversation + * + * @param string $channel_id The ID of the channel provided by the integration (required) + * @param string $conversation_id The ID of the conversation provided by the integration (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteConversationAsyncWithHttpInfo($channel_id, $conversation_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteConversationSuccess'; + $request = $this->deleteConversationRequest($channel_id, $conversation_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteConversation' + * + * @param string $channel_id The ID of the channel provided by the integration (required) + * @param string $conversation_id The ID of the conversation provided by the integration (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteConversationRequest($channel_id, $conversation_id): Request + { + // verify the required parameter 'channel_id' is set + /* @phpstan-ignore-next-line */ + if ($channel_id === null || (is_array($channel_id) && count($channel_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $channel_id when calling deleteConversation' + ); + } + // verify the required parameter 'conversation_id' is set + /* @phpstan-ignore-next-line */ + if ($conversation_id === null || (is_array($conversation_id) && count($conversation_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $conversation_id when calling deleteConversation' + ); + } + + $resourcePath = '/channels/{channel-id}/conversations/{conversation-id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($channel_id !== null) { + $resourcePath = str_replace( + '{' . 'channel-id' . '}', + ObjectSerializer::toPathValue($channel_id), + $resourcePath + ); + } + // path params + if ($conversation_id !== null) { + $resourcePath = str_replace( + '{' . 'conversation-id' . '}', + ObjectSerializer::toPathValue($conversation_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation receiveMessage + * + * Receives an incoming message + * + * @param \Pipedrive\Model\MessageObject|null $message_object message_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\InlineResponse200|\Pipedrive\Model\InlineResponse4001 + */ + public function receiveMessage($message_object = null) + { + list($response) = $this->receiveMessageWithHttpInfo($message_object); + return $response; + } + + /** + * Operation receiveMessageWithHttpInfo + * + * Receives an incoming message + * + * @param \Pipedrive\Model\MessageObject|null $message_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\InlineResponse200|\Pipedrive\Model\InlineResponse4001, HTTP status code, HTTP response headers (array of strings) + */ + public function receiveMessageWithHttpInfo($message_object = null) + { + $request = $this->receiveMessageRequest($message_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->receiveMessageRequest($message_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse4001' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse4001', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\InlineResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\InlineResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\InlineResponse4001', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation receiveMessageAsync + * + * Receives an incoming message + * + * @param \Pipedrive\Model\MessageObject|null $message_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function receiveMessageAsync($message_object = null): PromiseInterface + { + return $this->receiveMessageAsyncWithHttpInfo($message_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation receiveMessageAsyncWithHttpInfo + * + * Receives an incoming message + * + * @param \Pipedrive\Model\MessageObject|null $message_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function receiveMessageAsyncWithHttpInfo($message_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\InlineResponse200'; + $request = $this->receiveMessageRequest($message_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'receiveMessage' + * + * @param \Pipedrive\Model\MessageObject|null $message_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function receiveMessageRequest($message_object = null): Request + { + + $resourcePath = '/channels/messages/receive'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($message_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($message_object)); + } else { + $httpBody = $message_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $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/lib/Api/CurrenciesApi.php b/lib/Api/CurrenciesApi.php new file mode 100644 index 00000000..2aa78891 --- /dev/null +++ b/lib/Api/CurrenciesApi.php @@ -0,0 +1,432 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getCurrencies + * + * Get all supported currencies + * + * @param string|null $term Optional search term that is searched for from currency's name and/or code (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Currencies + */ + public function getCurrencies($term = null) + { + list($response) = $this->getCurrenciesWithHttpInfo($term); + return $response; + } + + /** + * Operation getCurrenciesWithHttpInfo + * + * Get all supported currencies + * + * @param string|null $term Optional search term that is searched for from currency's name and/or code (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Currencies, HTTP status code, HTTP response headers (array of strings) + */ + public function getCurrenciesWithHttpInfo($term = null) + { + $request = $this->getCurrenciesRequest($term); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getCurrenciesRequest($term); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Currencies' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Currencies', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Currencies' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Currencies', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Currencies', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCurrenciesAsync + * + * Get all supported currencies + * + * @param string|null $term Optional search term that is searched for from currency's name and/or code (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCurrenciesAsync($term = null): PromiseInterface + { + return $this->getCurrenciesAsyncWithHttpInfo($term) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCurrenciesAsyncWithHttpInfo + * + * Get all supported currencies + * + * @param string|null $term Optional search term that is searched for from currency's name and/or code (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCurrenciesAsyncWithHttpInfo($term = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Currencies'; + $request = $this->getCurrenciesRequest($term); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCurrencies' + * + * @param string|null $term Optional search term that is searched for from currency's name and/or code (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getCurrenciesRequest($term = null): Request + { + + $resourcePath = '/currencies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/DealFieldsApi.php b/lib/Api/DealFieldsApi.php new file mode 100644 index 00000000..c2aaf4c1 --- /dev/null +++ b/lib/Api/DealFieldsApi.php @@ -0,0 +1,1927 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addDealField + * + * Add a new deal field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request field_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function addDealField($field_create_request = null) + { + list($response) = $this->addDealFieldWithHttpInfo($field_create_request); + return $response; + } + + /** + * Operation addDealFieldWithHttpInfo + * + * Add a new deal field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addDealFieldWithHttpInfo($field_create_request = null) + { + $request = $this->addDealFieldRequest($field_create_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addDealFieldRequest($field_create_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addDealFieldAsync + * + * Add a new deal field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealFieldAsync($field_create_request = null): PromiseInterface + { + return $this->addDealFieldAsyncWithHttpInfo($field_create_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDealFieldAsyncWithHttpInfo + * + * Add a new deal field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealFieldAsyncWithHttpInfo($field_create_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->addDealFieldRequest($field_create_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDealField' + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addDealFieldRequest($field_create_request = null): Request + { + + $resourcePath = '/dealFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($field_create_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($field_create_request)); + } else { + $httpBody = $field_create_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDealField + * + * Delete a deal field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteResponse + */ + public function deleteDealField($id) + { + list($response) = $this->deleteDealFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteDealFieldWithHttpInfo + * + * Delete a deal field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealFieldWithHttpInfo($id) + { + $request = $this->deleteDealFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealFieldAsync + * + * Delete a deal field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealFieldAsync($id): PromiseInterface + { + return $this->deleteDealFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealFieldAsyncWithHttpInfo + * + * Delete a deal field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteResponse'; + $request = $this->deleteDealFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDealField' + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDealField' + ); + } + + $resourcePath = '/dealFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDealFields + * + * Delete multiple deal fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\BulkDeleteResponse + */ + public function deleteDealFields($ids) + { + list($response) = $this->deleteDealFieldsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteDealFieldsWithHttpInfo + * + * Delete multiple deal fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\BulkDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealFieldsWithHttpInfo($ids) + { + $request = $this->deleteDealFieldsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealFieldsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\BulkDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealFieldsAsync + * + * Delete multiple deal fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealFieldsAsync($ids): PromiseInterface + { + return $this->deleteDealFieldsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealFieldsAsyncWithHttpInfo + * + * Delete multiple deal fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealFieldsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\BulkDeleteResponse'; + $request = $this->deleteDealFieldsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDealFields' + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealFieldsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteDealFields' + ); + } + + $resourcePath = '/dealFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealField + * + * Get one deal field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function getDealField($id) + { + list($response) = $this->getDealFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation getDealFieldWithHttpInfo + * + * Get one deal field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealFieldWithHttpInfo($id) + { + $request = $this->getDealFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealFieldAsync + * + * Get one deal field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFieldAsync($id): PromiseInterface + { + return $this->getDealFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealFieldAsyncWithHttpInfo + * + * Get one deal field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->getDealFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealField' + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealField' + ); + } + + $resourcePath = '/dealFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealFields + * + * Get all deal fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldsResponse + */ + public function getDealFields($start = 0, $limit = null) + { + list($response) = $this->getDealFieldsWithHttpInfo($start, $limit); + return $response; + } + + /** + * Operation getDealFieldsWithHttpInfo + * + * Get all deal fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealFieldsWithHttpInfo($start = 0, $limit = null) + { + $request = $this->getDealFieldsRequest($start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealFieldsRequest($start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealFieldsAsync + * + * Get all deal fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFieldsAsync($start = 0, $limit = null): PromiseInterface + { + return $this->getDealFieldsAsyncWithHttpInfo($start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealFieldsAsyncWithHttpInfo + * + * Get all deal fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFieldsAsyncWithHttpInfo($start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldsResponse'; + $request = $this->getDealFieldsRequest($start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealFields' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealFieldsRequest($start = 0, $limit = null): Request + { + + $resourcePath = '/dealFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDealField + * + * Update a deal field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request field_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function updateDealField($id, $field_update_request = null) + { + list($response) = $this->updateDealFieldWithHttpInfo($id, $field_update_request); + return $response; + } + + /** + * Operation updateDealFieldWithHttpInfo + * + * Update a deal field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDealFieldWithHttpInfo($id, $field_update_request = null) + { + $request = $this->updateDealFieldRequest($id, $field_update_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateDealFieldRequest($id, $field_update_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDealFieldAsync + * + * Update a deal field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateDealFieldAsync($id, $field_update_request = null): PromiseInterface + { + return $this->updateDealFieldAsyncWithHttpInfo($id, $field_update_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDealFieldAsyncWithHttpInfo + * + * Update a deal field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateDealFieldAsyncWithHttpInfo($id, $field_update_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->updateDealFieldRequest($id, $field_update_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDealField' + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateDealFieldRequest($id, $field_update_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateDealField' + ); + } + + $resourcePath = '/dealFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($field_update_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($field_update_request)); + } else { + $httpBody = $field_update_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/DealsApi.php b/lib/Api/DealsApi.php new file mode 100644 index 00000000..11062076 --- /dev/null +++ b/lib/Api/DealsApi.php @@ -0,0 +1,9249 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addDeal + * + * Add a deal + * + * @param \Pipedrive\Model\NewDeal|null $new_deal new_deal (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAddedDeal + */ + public function addDeal($new_deal = null) + { + list($response) = $this->addDealWithHttpInfo($new_deal); + return $response; + } + + /** + * Operation addDealWithHttpInfo + * + * Add a deal + * + * @param \Pipedrive\Model\NewDeal|null $new_deal (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAddedDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function addDealWithHttpInfo($new_deal = null) + { + $request = $this->addDealRequest($new_deal); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addDealRequest($new_deal); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAddedDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addDealAsync + * + * Add a deal + * + * @param \Pipedrive\Model\NewDeal|null $new_deal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealAsync($new_deal = null): PromiseInterface + { + return $this->addDealAsyncWithHttpInfo($new_deal) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDealAsyncWithHttpInfo + * + * Add a deal + * + * @param \Pipedrive\Model\NewDeal|null $new_deal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealAsyncWithHttpInfo($new_deal = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAddedDeal'; + $request = $this->addDealRequest($new_deal); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDeal' + * + * @param \Pipedrive\Model\NewDeal|null $new_deal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addDealRequest($new_deal = null): Request + { + + $resourcePath = '/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($new_deal)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($new_deal)); + } else { + $httpBody = $new_deal; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addDealFollower + * + * Add a follower to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealFollowerRequest|null $add_deal_follower_request add_deal_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddedDealFollower + */ + public function addDealFollower($id, $add_deal_follower_request = null) + { + list($response) = $this->addDealFollowerWithHttpInfo($id, $add_deal_follower_request); + return $response; + } + + /** + * Operation addDealFollowerWithHttpInfo + * + * Add a follower to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealFollowerRequest|null $add_deal_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddedDealFollower, HTTP status code, HTTP response headers (array of strings) + */ + public function addDealFollowerWithHttpInfo($id, $add_deal_follower_request = null) + { + $request = $this->addDealFollowerRequest($id, $add_deal_follower_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addDealFollowerRequest($id, $add_deal_follower_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddedDealFollower' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddedDealFollower', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddedDealFollower' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddedDealFollower', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddedDealFollower', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addDealFollowerAsync + * + * Add a follower to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealFollowerRequest|null $add_deal_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealFollowerAsync($id, $add_deal_follower_request = null): PromiseInterface + { + return $this->addDealFollowerAsyncWithHttpInfo($id, $add_deal_follower_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDealFollowerAsyncWithHttpInfo + * + * Add a follower to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealFollowerRequest|null $add_deal_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealFollowerAsyncWithHttpInfo($id, $add_deal_follower_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddedDealFollower'; + $request = $this->addDealFollowerRequest($id, $add_deal_follower_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDealFollower' + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealFollowerRequest|null $add_deal_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addDealFollowerRequest($id, $add_deal_follower_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addDealFollower' + ); + } + + $resourcePath = '/deals/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_deal_follower_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_deal_follower_request)); + } else { + $httpBody = $add_deal_follower_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addDealParticipant + * + * Add a participant to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealParticipantRequest|null $add_deal_participant_request add_deal_participant_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostDealParticipants + */ + public function addDealParticipant($id, $add_deal_participant_request = null) + { + list($response) = $this->addDealParticipantWithHttpInfo($id, $add_deal_participant_request); + return $response; + } + + /** + * Operation addDealParticipantWithHttpInfo + * + * Add a participant to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealParticipantRequest|null $add_deal_participant_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostDealParticipants, HTTP status code, HTTP response headers (array of strings) + */ + public function addDealParticipantWithHttpInfo($id, $add_deal_participant_request = null) + { + $request = $this->addDealParticipantRequest($id, $add_deal_participant_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addDealParticipantRequest($id, $add_deal_participant_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostDealParticipants' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostDealParticipants', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostDealParticipants' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostDealParticipants', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostDealParticipants', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addDealParticipantAsync + * + * Add a participant to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealParticipantRequest|null $add_deal_participant_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealParticipantAsync($id, $add_deal_participant_request = null): PromiseInterface + { + return $this->addDealParticipantAsyncWithHttpInfo($id, $add_deal_participant_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDealParticipantAsyncWithHttpInfo + * + * Add a participant to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealParticipantRequest|null $add_deal_participant_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealParticipantAsyncWithHttpInfo($id, $add_deal_participant_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostDealParticipants'; + $request = $this->addDealParticipantRequest($id, $add_deal_participant_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDealParticipant' + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\AddDealParticipantRequest|null $add_deal_participant_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addDealParticipantRequest($id, $add_deal_participant_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addDealParticipant' + ); + } + + $resourcePath = '/deals/{id}/participants'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_deal_participant_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_deal_participant_request)); + } else { + $httpBody = $add_deal_participant_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addDealProduct + * + * Add a product to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\NewDealProduct|null $new_deal_product new_deal_product (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAddProductAttachementDetails + */ + public function addDealProduct($id, $new_deal_product = null) + { + list($response) = $this->addDealProductWithHttpInfo($id, $new_deal_product); + return $response; + } + + /** + * Operation addDealProductWithHttpInfo + * + * Add a product to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\NewDealProduct|null $new_deal_product (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAddProductAttachementDetails, HTTP status code, HTTP response headers (array of strings) + */ + public function addDealProductWithHttpInfo($id, $new_deal_product = null) + { + $request = $this->addDealProductRequest($id, $new_deal_product); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addDealProductRequest($id, $new_deal_product); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddProductAttachementDetails' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddProductAttachementDetails', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddProductAttachementDetails' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddProductAttachementDetails', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAddProductAttachementDetails', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addDealProductAsync + * + * Add a product to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\NewDealProduct|null $new_deal_product (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealProductAsync($id, $new_deal_product = null): PromiseInterface + { + return $this->addDealProductAsyncWithHttpInfo($id, $new_deal_product) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addDealProductAsyncWithHttpInfo + * + * Add a product to a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\NewDealProduct|null $new_deal_product (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addDealProductAsyncWithHttpInfo($id, $new_deal_product = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAddProductAttachementDetails'; + $request = $this->addDealProductRequest($id, $new_deal_product); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addDealProduct' + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\NewDealProduct|null $new_deal_product (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addDealProductRequest($id, $new_deal_product = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addDealProduct' + ); + } + + $resourcePath = '/deals/{id}/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($new_deal_product)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($new_deal_product)); + } else { + $httpBody = $new_deal_product; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDeal + * + * Delete a deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteDeal + */ + public function deleteDeal($id) + { + list($response) = $this->deleteDealWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteDealWithHttpInfo + * + * Delete a deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealWithHttpInfo($id) + { + $request = $this->deleteDealRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealAsync + * + * Delete a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealAsync($id): PromiseInterface + { + return $this->deleteDealAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealAsyncWithHttpInfo + * + * Delete a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteDeal'; + $request = $this->deleteDealRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDeal' + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDeal' + ); + } + + $resourcePath = '/deals/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDealFollower + * + * Delete a follower from a deal + * + * @param int $id The ID of the deal (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteDealFollower + */ + public function deleteDealFollower($id, $follower_id) + { + list($response) = $this->deleteDealFollowerWithHttpInfo($id, $follower_id); + return $response; + } + + /** + * Operation deleteDealFollowerWithHttpInfo + * + * Delete a follower from a deal + * + * @param int $id The ID of the deal (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteDealFollower, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealFollowerWithHttpInfo($id, $follower_id) + { + $request = $this->deleteDealFollowerRequest($id, $follower_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealFollowerRequest($id, $follower_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDealFollower' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDealFollower', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDealFollower' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDealFollower', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteDealFollower', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealFollowerAsync + * + * Delete a follower from a deal + * + * @param int $id The ID of the deal (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealFollowerAsync($id, $follower_id): PromiseInterface + { + return $this->deleteDealFollowerAsyncWithHttpInfo($id, $follower_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealFollowerAsyncWithHttpInfo + * + * Delete a follower from a deal + * + * @param int $id The ID of the deal (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealFollowerAsyncWithHttpInfo($id, $follower_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteDealFollower'; + $request = $this->deleteDealFollowerRequest($id, $follower_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDealFollower' + * + * @param int $id The ID of the deal (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealFollowerRequest($id, $follower_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDealFollower' + ); + } + // verify the required parameter 'follower_id' is set + /* @phpstan-ignore-next-line */ + if ($follower_id === null || (is_array($follower_id) && count($follower_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $follower_id when calling deleteDealFollower' + ); + } + + $resourcePath = '/deals/{id}/followers/{follower_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($follower_id !== null) { + $resourcePath = str_replace( + '{' . 'follower_id' . '}', + ObjectSerializer::toPathValue($follower_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDealParticipant + * + * Delete a participant from a deal + * + * @param int $id The ID of the deal (required) + * @param int $deal_participant_id The ID of the participant of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteDealParticipant + */ + public function deleteDealParticipant($id, $deal_participant_id) + { + list($response) = $this->deleteDealParticipantWithHttpInfo($id, $deal_participant_id); + return $response; + } + + /** + * Operation deleteDealParticipantWithHttpInfo + * + * Delete a participant from a deal + * + * @param int $id The ID of the deal (required) + * @param int $deal_participant_id The ID of the participant of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteDealParticipant, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealParticipantWithHttpInfo($id, $deal_participant_id) + { + $request = $this->deleteDealParticipantRequest($id, $deal_participant_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealParticipantRequest($id, $deal_participant_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDealParticipant' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDealParticipant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDealParticipant' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDealParticipant', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteDealParticipant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealParticipantAsync + * + * Delete a participant from a deal + * + * @param int $id The ID of the deal (required) + * @param int $deal_participant_id The ID of the participant of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealParticipantAsync($id, $deal_participant_id): PromiseInterface + { + return $this->deleteDealParticipantAsyncWithHttpInfo($id, $deal_participant_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealParticipantAsyncWithHttpInfo + * + * Delete a participant from a deal + * + * @param int $id The ID of the deal (required) + * @param int $deal_participant_id The ID of the participant of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealParticipantAsyncWithHttpInfo($id, $deal_participant_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteDealParticipant'; + $request = $this->deleteDealParticipantRequest($id, $deal_participant_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDealParticipant' + * + * @param int $id The ID of the deal (required) + * @param int $deal_participant_id The ID of the participant of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealParticipantRequest($id, $deal_participant_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDealParticipant' + ); + } + // verify the required parameter 'deal_participant_id' is set + /* @phpstan-ignore-next-line */ + if ($deal_participant_id === null || (is_array($deal_participant_id) && count($deal_participant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $deal_participant_id when calling deleteDealParticipant' + ); + } + + $resourcePath = '/deals/{id}/participants/{deal_participant_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($deal_participant_id !== null) { + $resourcePath = str_replace( + '{' . 'deal_participant_id' . '}', + ObjectSerializer::toPathValue($deal_participant_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDealProduct + * + * Delete an attached product from a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The product attachment ID (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteDealProduct + */ + public function deleteDealProduct($id, $product_attachment_id) + { + list($response) = $this->deleteDealProductWithHttpInfo($id, $product_attachment_id); + return $response; + } + + /** + * Operation deleteDealProductWithHttpInfo + * + * Delete an attached product from a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The product attachment ID (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteDealProduct, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealProductWithHttpInfo($id, $product_attachment_id) + { + $request = $this->deleteDealProductRequest($id, $product_attachment_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealProductRequest($id, $product_attachment_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDealProduct' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDealProduct', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteDealProduct' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteDealProduct', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteDealProduct', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealProductAsync + * + * Delete an attached product from a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The product attachment ID (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealProductAsync($id, $product_attachment_id): PromiseInterface + { + return $this->deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealProductAsyncWithHttpInfo + * + * Delete an attached product from a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The product attachment ID (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealProductAsyncWithHttpInfo($id, $product_attachment_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteDealProduct'; + $request = $this->deleteDealProductRequest($id, $product_attachment_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDealProduct' + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The product attachment ID (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealProductRequest($id, $product_attachment_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDealProduct' + ); + } + // verify the required parameter 'product_attachment_id' is set + /* @phpstan-ignore-next-line */ + if ($product_attachment_id === null || (is_array($product_attachment_id) && count($product_attachment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $product_attachment_id when calling deleteDealProduct' + ); + } + + $resourcePath = '/deals/{id}/products/{product_attachment_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($product_attachment_id !== null) { + $resourcePath = str_replace( + '{' . 'product_attachment_id' . '}', + ObjectSerializer::toPathValue($product_attachment_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDeals + * + * Delete multiple deals in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteMultipleDeals + */ + public function deleteDeals($ids) + { + list($response) = $this->deleteDealsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteDealsWithHttpInfo + * + * Delete multiple deals in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteMultipleDeals, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDealsWithHttpInfo($ids) + { + $request = $this->deleteDealsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteDealsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteMultipleDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteMultipleDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteMultipleDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteMultipleDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteMultipleDeals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDealsAsync + * + * Delete multiple deals in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealsAsync($ids): PromiseInterface + { + return $this->deleteDealsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDealsAsyncWithHttpInfo + * + * Delete multiple deals in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteDealsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteMultipleDeals'; + $request = $this->deleteDealsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDeals' + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteDealsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteDeals' + ); + } + + $resourcePath = '/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation duplicateDeal + * + * Duplicate deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDuplicatedDeal + */ + public function duplicateDeal($id) + { + list($response) = $this->duplicateDealWithHttpInfo($id); + return $response; + } + + /** + * Operation duplicateDealWithHttpInfo + * + * Duplicate deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDuplicatedDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function duplicateDealWithHttpInfo($id) + { + $request = $this->duplicateDealRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->duplicateDealRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDuplicatedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDuplicatedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDuplicatedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDuplicatedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDuplicatedDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation duplicateDealAsync + * + * Duplicate deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function duplicateDealAsync($id): PromiseInterface + { + return $this->duplicateDealAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation duplicateDealAsyncWithHttpInfo + * + * Duplicate deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function duplicateDealAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDuplicatedDeal'; + $request = $this->duplicateDealRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'duplicateDeal' + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function duplicateDealRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling duplicateDeal' + ); + } + + $resourcePath = '/deals/{id}/duplicate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDeal + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDeal + */ + public function getDeal($id) + { + list($response) = $this->getDealWithHttpInfo($id); + return $response; + } + + /** + * Operation getDealWithHttpInfo + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealWithHttpInfo($id) + { + $request = $this->getDealRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealAsync + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealAsync($id): PromiseInterface + { + return $this->getDealAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealAsyncWithHttpInfo + * + * Get details of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDeal'; + $request = $this->getDealRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDeal' + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDeal' + ); + } + + $resourcePath = '/deals/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealActivities + * + * List activities associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DealListActivitiesResponse + */ + public function getDealActivities($id, $start = 0, $limit = null, $done = null, $exclude = null) + { + list($response) = $this->getDealActivitiesWithHttpInfo($id, $start, $limit, $done, $exclude); + return $response; + } + + /** + * Operation getDealActivitiesWithHttpInfo + * + * List activities associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DealListActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealActivitiesWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null) + { + $request = $this->getDealActivitiesRequest($id, $start, $limit, $done, $exclude); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealActivitiesRequest($id, $start, $limit, $done, $exclude); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealListActivitiesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealListActivitiesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealListActivitiesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealListActivitiesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DealListActivitiesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealActivitiesAsync + * + * List activities associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealActivitiesAsync($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface + { + return $this->getDealActivitiesAsyncWithHttpInfo($id, $start, $limit, $done, $exclude) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealActivitiesAsyncWithHttpInfo + * + * List activities associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealActivitiesAsyncWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\DealListActivitiesResponse'; + $request = $this->getDealActivitiesRequest($id, $start, $limit, $done, $exclude); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealActivities' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealActivitiesRequest($id, $start = 0, $limit = null, $done = null, $exclude = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealActivities' + ); + } + + $resourcePath = '/deals/{id}/activities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($done)) { + $done = ObjectSerializer::serializeCollection($done, '', true); + } + if ($done !== null) { + $queryParams['done'] = $done; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exclude)) { + $exclude = ObjectSerializer::serializeCollection($exclude, '', true); + } + if ($exclude !== null) { + $queryParams['exclude'] = $exclude; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealFiles + * + * List files attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListFilesResponse + */ + public function getDealFiles($id, $start = 0, $limit = null, $sort = null) + { + list($response) = $this->getDealFilesWithHttpInfo($id, $start, $limit, $sort); + return $response; + } + + /** + * Operation getDealFilesWithHttpInfo + * + * List files attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListFilesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealFilesWithHttpInfo($id, $start = 0, $limit = null, $sort = null) + { + $request = $this->getDealFilesRequest($id, $start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealFilesRequest($id, $start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListFilesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealFilesAsync + * + * List files attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFilesAsync($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getDealFilesAsyncWithHttpInfo($id, $start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealFilesAsyncWithHttpInfo + * + * List files attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFilesAsyncWithHttpInfo($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListFilesResponse'; + $request = $this->getDealFilesRequest($id, $start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealFiles' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealFilesRequest($id, $start = 0, $limit = null, $sort = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealFiles' + ); + } + + $resourcePath = '/deals/{id}/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealFollowers + * + * List followers of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListFollowersResponse + */ + public function getDealFollowers($id) + { + list($response) = $this->getDealFollowersWithHttpInfo($id); + return $response; + } + + /** + * Operation getDealFollowersWithHttpInfo + * + * List followers of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListFollowersResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealFollowersWithHttpInfo($id) + { + $request = $this->getDealFollowersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealFollowersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFollowersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFollowersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFollowersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFollowersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListFollowersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealFollowersAsync + * + * List followers of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFollowersAsync($id): PromiseInterface + { + return $this->getDealFollowersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealFollowersAsyncWithHttpInfo + * + * List followers of a deal + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealFollowersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListFollowersResponse'; + $request = $this->getDealFollowersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealFollowers' + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealFollowersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealFollowers' + ); + } + + $resourcePath = '/deals/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealMailMessages + * + * List mail messages associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListMailMessagesResponse + */ + public function getDealMailMessages($id, $start = 0, $limit = null) + { + list($response) = $this->getDealMailMessagesWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getDealMailMessagesWithHttpInfo + * + * List mail messages associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getDealMailMessagesRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealMailMessagesRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListMailMessagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListMailMessagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListMailMessagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListMailMessagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListMailMessagesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealMailMessagesAsync + * + * List mail messages associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getDealMailMessagesAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealMailMessagesAsyncWithHttpInfo + * + * List mail messages associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListMailMessagesResponse'; + $request = $this->getDealMailMessagesRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealMailMessages' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealMailMessagesRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealMailMessages' + ); + } + + $resourcePath = '/deals/{id}/mailMessages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealParticipants + * + * List participants of a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DealParticipants + */ + public function getDealParticipants($id, $start = 0, $limit = null) + { + list($response) = $this->getDealParticipantsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getDealParticipantsWithHttpInfo + * + * List participants of a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DealParticipants, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealParticipantsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getDealParticipantsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealParticipantsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealParticipants' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealParticipants', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealParticipants' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealParticipants', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DealParticipants', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealParticipantsAsync + * + * List participants of a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealParticipantsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getDealParticipantsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealParticipantsAsyncWithHttpInfo + * + * List participants of a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealParticipantsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\DealParticipants'; + $request = $this->getDealParticipantsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealParticipants' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealParticipantsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealParticipants' + ); + } + + $resourcePath = '/deals/{id}/participants'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealPersons + * + * List all persons associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListPersonsResponse + */ + public function getDealPersons($id, $start = 0, $limit = null) + { + list($response) = $this->getDealPersonsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getDealPersonsWithHttpInfo + * + * List all persons associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListPersonsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealPersonsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getDealPersonsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealPersonsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListPersonsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealPersonsAsync + * + * List all persons associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealPersonsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getDealPersonsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealPersonsAsyncWithHttpInfo + * + * List all persons associated with a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealPersonsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListPersonsResponse'; + $request = $this->getDealPersonsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealPersons' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealPersonsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealPersons' + ); + } + + $resourcePath = '/deals/{id}/persons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealProducts + * + * List products attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $include_product_data Whether to fetch product data along with each attached product (1) or not (0, default) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListProductsResponse + */ + public function getDealProducts($id, $start = 0, $limit = null, $include_product_data = null) + { + list($response) = $this->getDealProductsWithHttpInfo($id, $start, $limit, $include_product_data); + return $response; + } + + /** + * Operation getDealProductsWithHttpInfo + * + * List products attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $include_product_data Whether to fetch product data along with each attached product (1) or not (0, default) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListProductsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealProductsWithHttpInfo($id, $start = 0, $limit = null, $include_product_data = null) + { + $request = $this->getDealProductsRequest($id, $start, $limit, $include_product_data); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealProductsRequest($id, $start, $limit, $include_product_data); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListProductsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListProductsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListProductsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListProductsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListProductsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealProductsAsync + * + * List products attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $include_product_data Whether to fetch product data along with each attached product (1) or not (0, default) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealProductsAsync($id, $start = 0, $limit = null, $include_product_data = null): PromiseInterface + { + return $this->getDealProductsAsyncWithHttpInfo($id, $start, $limit, $include_product_data) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealProductsAsyncWithHttpInfo + * + * List products attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $include_product_data Whether to fetch product data along with each attached product (1) or not (0, default) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealProductsAsyncWithHttpInfo($id, $start = 0, $limit = null, $include_product_data = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListProductsResponse'; + $request = $this->getDealProductsRequest($id, $start, $limit, $include_product_data); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealProducts' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $include_product_data Whether to fetch product data along with each attached product (1) or not (0, default) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealProductsRequest($id, $start = 0, $limit = null, $include_product_data = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealProducts' + ); + } + + $resourcePath = '/deals/{id}/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_product_data)) { + $include_product_data = ObjectSerializer::serializeCollection($include_product_data, '', true); + } + if ($include_product_data !== null) { + $queryParams['include_product_data'] = $include_product_data; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealUpdates + * + * List updates about a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DealFlowResponse + */ + public function getDealUpdates($id, $start = 0, $limit = null, $all_changes = null, $items = null) + { + list($response) = $this->getDealUpdatesWithHttpInfo($id, $start, $limit, $all_changes, $items); + return $response; + } + + /** + * Operation getDealUpdatesWithHttpInfo + * + * List updates about a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DealFlowResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealUpdatesWithHttpInfo($id, $start = 0, $limit = null, $all_changes = null, $items = null) + { + $request = $this->getDealUpdatesRequest($id, $start, $limit, $all_changes, $items); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealUpdatesRequest($id, $start, $limit, $all_changes, $items); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealFlowResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealFlowResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealFlowResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealFlowResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DealFlowResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealUpdatesAsync + * + * List updates about a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealUpdatesAsync($id, $start = 0, $limit = null, $all_changes = null, $items = null): PromiseInterface + { + return $this->getDealUpdatesAsyncWithHttpInfo($id, $start, $limit, $all_changes, $items) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealUpdatesAsyncWithHttpInfo + * + * List updates about a deal + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealUpdatesAsyncWithHttpInfo($id, $start = 0, $limit = null, $all_changes = null, $items = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\DealFlowResponse'; + $request = $this->getDealUpdatesRequest($id, $start, $limit, $all_changes, $items); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealUpdates' + * + * @param int $id The ID of the deal (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealUpdatesRequest($id, $start = 0, $limit = null, $all_changes = null, $items = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealUpdates' + ); + } + + $resourcePath = '/deals/{id}/flow'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($all_changes)) { + $all_changes = ObjectSerializer::serializeCollection($all_changes, '', true); + } + if ($all_changes !== null) { + $queryParams['all_changes'] = $all_changes; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($items)) { + $items = ObjectSerializer::serializeCollection($items, '', true); + } + if ($items !== null) { + $queryParams['items'] = $items; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealUsers + * + * List permitted users + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListPermittedUsersResponse + */ + public function getDealUsers($id) + { + list($response) = $this->getDealUsersWithHttpInfo($id); + return $response; + } + + /** + * Operation getDealUsersWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListPermittedUsersResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealUsersWithHttpInfo($id) + { + $request = $this->getDealUsersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealUsersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPermittedUsersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPermittedUsersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPermittedUsersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPermittedUsersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListPermittedUsersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealUsersAsync + * + * List permitted users + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealUsersAsync($id): PromiseInterface + { + return $this->getDealUsersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealUsersAsyncWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealUsersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListPermittedUsersResponse'; + $request = $this->getDealUsersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealUsers' + * + * @param int $id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealUsersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDealUsers' + ); + } + + $resourcePath = '/deals/{id}/permittedUsers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDeals + * + * Get all deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDeals + */ + public function getDeals($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null) + { + list($response) = $this->getDealsWithHttpInfo($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + return $response; + } + + /** + * Operation getDealsWithHttpInfo + * + * Get all deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDeals, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealsWithHttpInfo($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null) + { + $request = $this->getDealsRequest($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealsRequest($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDeals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealsAsync + * + * Get all deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsAsync($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): PromiseInterface + { + return $this->getDealsAsyncWithHttpInfo($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealsAsyncWithHttpInfo + * + * Get all deals + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsAsyncWithHttpInfo($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDeals'; + $request = $this->getDealsRequest($user_id, $filter_id, $stage_id, $status, $start, $limit, $sort, $owned_by_you); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDeals' + * + * @param int|null $user_id If supplied, only deals matching the given user will be returned. However, `filter_id` and `owned_by_you` takes precedence over `user_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $owned_by_you When supplied, only deals owned by you are returned. However, `filter_id` takes precedence over `owned_by_you` when both are supplied. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealsRequest($user_id = null, $filter_id = null, $stage_id = null, $status = 'all_not_deleted', $start = 0, $limit = null, $sort = null, $owned_by_you = null): Request + { + + $resourcePath = '/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($owned_by_you)) { + $owned_by_you = ObjectSerializer::serializeCollection($owned_by_you, '', true); + } + if ($owned_by_you !== null) { + $queryParams['owned_by_you'] = $owned_by_you; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealsCollection + * + * Get all deals (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDealsCollection|\Pipedrive\Model\FailResponse + */ + public function getDealsCollection($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null) + { + list($response) = $this->getDealsCollectionWithHttpInfo($cursor, $limit, $since, $until, $user_id, $stage_id, $status); + return $response; + } + + /** + * Operation getDealsCollectionWithHttpInfo + * + * Get all deals (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDealsCollection|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealsCollectionWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null) + { + $request = $this->getDealsCollectionRequest($cursor, $limit, $since, $until, $user_id, $stage_id, $status); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealsCollectionRequest($cursor, $limit, $since, $until, $user_id, $stage_id, $status); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsCollection' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsCollection', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsCollection' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsCollection', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDealsCollection', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealsCollectionAsync + * + * Get all deals (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsCollectionAsync($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null): PromiseInterface + { + return $this->getDealsCollectionAsyncWithHttpInfo($cursor, $limit, $since, $until, $user_id, $stage_id, $status) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealsCollectionAsyncWithHttpInfo + * + * Get all deals (BETA) + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsCollectionAsyncWithHttpInfo($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDealsCollection'; + $request = $this->getDealsCollectionRequest($cursor, $limit, $since, $until, $user_id, $stage_id, $status); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealsCollection' + * + * @param string|null $cursor For pagination, the marker (an opaque string value) representing the first item on the next page (optional) + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. (optional) + * @param string|null $since The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param string|null $until The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field. (optional) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param string|null $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealsCollectionRequest($cursor = null, $limit = null, $since = null, $until = null, $user_id = null, $stage_id = null, $status = null): Request + { + + $resourcePath = '/deals/collection'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($cursor)) { + $cursor = ObjectSerializer::serializeCollection($cursor, '', true); + } + if ($cursor !== null) { + $queryParams['cursor'] = $cursor; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($since)) { + $since = ObjectSerializer::serializeCollection($since, '', true); + } + if ($since !== null) { + $queryParams['since'] = $since; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($until)) { + $until = ObjectSerializer::serializeCollection($until, '', true); + } + if ($until !== null) { + $queryParams['until'] = $until; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealsSummary + * + * Get deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDealsSummary + */ + public function getDealsSummary($status = null, $filter_id = null, $user_id = null, $stage_id = null) + { + list($response) = $this->getDealsSummaryWithHttpInfo($status, $filter_id, $user_id, $stage_id); + return $response; + } + + /** + * Operation getDealsSummaryWithHttpInfo + * + * Get deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDealsSummary, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealsSummaryWithHttpInfo($status = null, $filter_id = null, $user_id = null, $stage_id = null) + { + $request = $this->getDealsSummaryRequest($status, $filter_id, $user_id, $stage_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealsSummaryRequest($status, $filter_id, $user_id, $stage_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsSummary' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsSummary' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsSummary', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDealsSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealsSummaryAsync + * + * Get deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsSummaryAsync($status = null, $filter_id = null, $user_id = null, $stage_id = null): PromiseInterface + { + return $this->getDealsSummaryAsyncWithHttpInfo($status, $filter_id, $user_id, $stage_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealsSummaryAsyncWithHttpInfo + * + * Get deals summary + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsSummaryAsyncWithHttpInfo($status = null, $filter_id = null, $user_id = null, $stage_id = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDealsSummary'; + $request = $this->getDealsSummaryRequest($status, $filter_id, $user_id, $stage_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealsSummary' + * + * @param string|null $status Only fetch deals with a specific status. open = Open, won = Won, lost = Lost (optional) + * @param int|null $filter_id <code>user_id</code> will not be considered. Only deals matching the given filter will be returned. (optional) + * @param int|null $user_id Only deals matching the given user will be returned. `user_id` will not be considered if you use `filter_id`. (optional) + * @param int|null $stage_id Only deals within the given stage will be returned (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealsSummaryRequest($status = null, $filter_id = null, $user_id = null, $stage_id = null): Request + { + + $resourcePath = '/deals/summary'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDealsTimeline + * + * Get deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDealsTimeline + */ + public function getDealsTimeline($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null) + { + list($response) = $this->getDealsTimelineWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + return $response; + } + + /** + * Operation getDealsTimelineWithHttpInfo + * + * Get deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDealsTimeline, HTTP status code, HTTP response headers (array of strings) + */ + public function getDealsTimelineWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null) + { + $request = $this->getDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsTimeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsTimeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsTimeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsTimeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDealsTimeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDealsTimelineAsync + * + * Get deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsTimelineAsync($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null): PromiseInterface + { + return $this->getDealsTimelineAsyncWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDealsTimelineAsyncWithHttpInfo + * + * Get deals timeline + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getDealsTimelineAsyncWithHttpInfo($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDealsTimeline'; + $request = $this->getDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id, $pipeline_id, $filter_id, $exclude_deals, $totals_convert_currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDealsTimeline' + * + * @param \DateTime $start_date The date when the first interval starts. Format: YYYY-MM-DD (required) + * @param string $interval The type of the interval<table><tr><th>Value</th><th>Description</th></tr><tr><td>`day`</td><td>Day</td></tr><tr><td>`week`</td><td>A full week (7 days) starting from `start_date`</td></tr><tr><td>`month`</td><td>A full month (depending on the number of days in given month) starting from `start_date`</td></tr><tr><td>`quarter`</td><td>A full quarter (3 months) starting from `start_date`</td></tr></table> (required) + * @param int $amount The number of given intervals, starting from `start_date`, to fetch. E.g. 3 (months). (required) + * @param string $field_key The date field key which deals will be retrieved from (required) + * @param int|null $user_id If supplied, only deals matching the given user will be returned (optional) + * @param int|null $pipeline_id If supplied, only deals matching the given pipeline will be returned (optional) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param \Pipedrive\Model\NumberBoolean|null $exclude_deals Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `totals_converted` is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to `default_currency` in which case the user's default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getDealsTimelineRequest($start_date, $interval, $amount, $field_key, $user_id = null, $pipeline_id = null, $filter_id = null, $exclude_deals = null, $totals_convert_currency = null): Request + { + // verify the required parameter 'start_date' is set + /* @phpstan-ignore-next-line */ + if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_date when calling getDealsTimeline' + ); + } + // verify the required parameter 'interval' is set + /* @phpstan-ignore-next-line */ + if ($interval === null || (is_array($interval) && count($interval) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $interval when calling getDealsTimeline' + ); + } + // verify the required parameter 'amount' is set + /* @phpstan-ignore-next-line */ + if ($amount === null || (is_array($amount) && count($amount) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $amount when calling getDealsTimeline' + ); + } + // verify the required parameter 'field_key' is set + /* @phpstan-ignore-next-line */ + if ($field_key === null || (is_array($field_key) && count($field_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $field_key when calling getDealsTimeline' + ); + } + + $resourcePath = '/deals/timeline'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start_date)) { + $start_date = ObjectSerializer::serializeCollection($start_date, '', true); + } + if ($start_date !== null) { + $queryParams['start_date'] = $start_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($interval)) { + $interval = ObjectSerializer::serializeCollection($interval, '', true); + } + if ($interval !== null) { + $queryParams['interval'] = $interval; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($amount)) { + $amount = ObjectSerializer::serializeCollection($amount, '', true); + } + if ($amount !== null) { + $queryParams['amount'] = $amount; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($field_key)) { + $field_key = ObjectSerializer::serializeCollection($field_key, '', true); + } + if ($field_key !== null) { + $queryParams['field_key'] = $field_key; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pipeline_id)) { + $pipeline_id = ObjectSerializer::serializeCollection($pipeline_id, '', true); + } + if ($pipeline_id !== null) { + $queryParams['pipeline_id'] = $pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exclude_deals)) { + $exclude_deals = ObjectSerializer::serializeCollection($exclude_deals, '', true); + } + if ($exclude_deals !== null) { + $queryParams['exclude_deals'] = $exclude_deals; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($totals_convert_currency)) { + $totals_convert_currency = ObjectSerializer::serializeCollection($totals_convert_currency, '', true); + } + if ($totals_convert_currency !== null) { + $queryParams['totals_convert_currency'] = $totals_convert_currency; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation mergeDeals + * + * Merge two deals + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\MergeDealsRequest|null $merge_deals_request merge_deals_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetMergedDeal + */ + public function mergeDeals($id, $merge_deals_request = null) + { + list($response) = $this->mergeDealsWithHttpInfo($id, $merge_deals_request); + return $response; + } + + /** + * Operation mergeDealsWithHttpInfo + * + * Merge two deals + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\MergeDealsRequest|null $merge_deals_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetMergedDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function mergeDealsWithHttpInfo($id, $merge_deals_request = null) + { + $request = $this->mergeDealsRequest($id, $merge_deals_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->mergeDealsRequest($id, $merge_deals_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetMergedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetMergedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetMergedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetMergedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetMergedDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mergeDealsAsync + * + * Merge two deals + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\MergeDealsRequest|null $merge_deals_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function mergeDealsAsync($id, $merge_deals_request = null): PromiseInterface + { + return $this->mergeDealsAsyncWithHttpInfo($id, $merge_deals_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mergeDealsAsyncWithHttpInfo + * + * Merge two deals + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\MergeDealsRequest|null $merge_deals_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function mergeDealsAsyncWithHttpInfo($id, $merge_deals_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetMergedDeal'; + $request = $this->mergeDealsRequest($id, $merge_deals_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'mergeDeals' + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\MergeDealsRequest|null $merge_deals_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function mergeDealsRequest($id, $merge_deals_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling mergeDeals' + ); + } + + $resourcePath = '/deals/{id}/merge'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($merge_deals_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($merge_deals_request)); + } else { + $httpBody = $merge_deals_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchDeals + * + * Search deals + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. (optional) + * @param string|null $status Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DealSearchResponse + */ + public function searchDeals($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null) + { + list($response) = $this->searchDealsWithHttpInfo($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit); + return $response; + } + + /** + * Operation searchDealsWithHttpInfo + * + * Search deals + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. (optional) + * @param string|null $status Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DealSearchResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchDealsWithHttpInfo($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null) + { + $request = $this->searchDealsRequest($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchDealsRequest($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DealSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DealSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DealSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchDealsAsync + * + * Search deals + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. (optional) + * @param string|null $status Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchDealsAsync($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + return $this->searchDealsAsyncWithHttpInfo($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchDealsAsyncWithHttpInfo + * + * Search deals + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. (optional) + * @param string|null $status Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchDealsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\DealSearchResponse'; + $request = $this->searchDealsRequest($term, $fields, $exact_match, $person_id, $organization_id, $status, $include_fields, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchDeals' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. (optional) + * @param string|null $status Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchDealsRequest($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $status = null, $include_fields = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchDeals' + ); + } + + $resourcePath = '/deals/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($fields)) { + $fields = ObjectSerializer::serializeCollection($fields, '', true); + } + if ($fields !== null) { + $queryParams['fields'] = $fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($organization_id)) { + $organization_id = ObjectSerializer::serializeCollection($organization_id, '', true); + } + if ($organization_id !== null) { + $queryParams['organization_id'] = $organization_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_fields)) { + $include_fields = ObjectSerializer::serializeCollection($include_fields, '', true); + } + if ($include_fields !== null) { + $queryParams['include_fields'] = $include_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDeal + * + * Update a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\UpdateDealRequest|null $update_deal_request update_deal_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAddedDeal + */ + public function updateDeal($id, $update_deal_request = null) + { + list($response) = $this->updateDealWithHttpInfo($id, $update_deal_request); + return $response; + } + + /** + * Operation updateDealWithHttpInfo + * + * Update a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\UpdateDealRequest|null $update_deal_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAddedDeal, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDealWithHttpInfo($id, $update_deal_request = null) + { + $request = $this->updateDealRequest($id, $update_deal_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateDealRequest($id, $update_deal_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddedDeal' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddedDeal', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAddedDeal', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDealAsync + * + * Update a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\UpdateDealRequest|null $update_deal_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateDealAsync($id, $update_deal_request = null): PromiseInterface + { + return $this->updateDealAsyncWithHttpInfo($id, $update_deal_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDealAsyncWithHttpInfo + * + * Update a deal + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\UpdateDealRequest|null $update_deal_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateDealAsyncWithHttpInfo($id, $update_deal_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAddedDeal'; + $request = $this->updateDealRequest($id, $update_deal_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDeal' + * + * @param int $id The ID of the deal (required) + * @param \Pipedrive\Model\UpdateDealRequest|null $update_deal_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateDealRequest($id, $update_deal_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateDeal' + ); + } + + $resourcePath = '/deals/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_deal_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_deal_request)); + } else { + $httpBody = $update_deal_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateDealProduct + * + * Update the product attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) (required) + * @param \Pipedrive\Model\UpdateDealProduct|null $update_deal_product update_deal_product (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetProductAttachementDetails + */ + public function updateDealProduct($id, $product_attachment_id, $update_deal_product = null) + { + list($response) = $this->updateDealProductWithHttpInfo($id, $product_attachment_id, $update_deal_product); + return $response; + } + + /** + * Operation updateDealProductWithHttpInfo + * + * Update the product attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) (required) + * @param \Pipedrive\Model\UpdateDealProduct|null $update_deal_product (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetProductAttachementDetails, HTTP status code, HTTP response headers (array of strings) + */ + public function updateDealProductWithHttpInfo($id, $product_attachment_id, $update_deal_product = null) + { + $request = $this->updateDealProductRequest($id, $product_attachment_id, $update_deal_product); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateDealProductRequest($id, $product_attachment_id, $update_deal_product); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductAttachementDetails' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductAttachementDetails', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductAttachementDetails' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductAttachementDetails', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetProductAttachementDetails', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateDealProductAsync + * + * Update the product attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) (required) + * @param \Pipedrive\Model\UpdateDealProduct|null $update_deal_product (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateDealProductAsync($id, $product_attachment_id, $update_deal_product = null): PromiseInterface + { + return $this->updateDealProductAsyncWithHttpInfo($id, $product_attachment_id, $update_deal_product) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateDealProductAsyncWithHttpInfo + * + * Update the product attached to a deal + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) (required) + * @param \Pipedrive\Model\UpdateDealProduct|null $update_deal_product (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateDealProductAsyncWithHttpInfo($id, $product_attachment_id, $update_deal_product = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetProductAttachementDetails'; + $request = $this->updateDealProductRequest($id, $product_attachment_id, $update_deal_product); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateDealProduct' + * + * @param int $id The ID of the deal (required) + * @param int $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) (required) + * @param \Pipedrive\Model\UpdateDealProduct|null $update_deal_product (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateDealProductRequest($id, $product_attachment_id, $update_deal_product = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateDealProduct' + ); + } + // verify the required parameter 'product_attachment_id' is set + /* @phpstan-ignore-next-line */ + if ($product_attachment_id === null || (is_array($product_attachment_id) && count($product_attachment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $product_attachment_id when calling updateDealProduct' + ); + } + + $resourcePath = '/deals/{id}/products/{product_attachment_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($product_attachment_id !== null) { + $resourcePath = str_replace( + '{' . 'product_attachment_id' . '}', + ObjectSerializer::toPathValue($product_attachment_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_deal_product)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_deal_product)); + } else { + $httpBody = $update_deal_product; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/FilesApi.php b/lib/Api/FilesApi.php new file mode 100644 index 00000000..15dcfca6 --- /dev/null +++ b/lib/Api/FilesApi.php @@ -0,0 +1,2711 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addFile + * + * Add file + * + * @param \SplFileObject $file A single file, supplied in the multipart/form-data encoding and contained within the given boundaries (required) + * @param int|null $deal_id The ID of the deal to associate file(s) with (optional) + * @param int|null $person_id The ID of the person to associate file(s) with (optional) + * @param int|null $org_id The ID of the organization to associate file(s) with (optional) + * @param int|null $product_id The ID of the product to associate file(s) with (optional) + * @param int|null $activity_id The ID of the activity to associate file(s) with (optional) + * @param string|null $lead_id The ID of the lead to associate file(s) with (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddFile + */ + public function addFile($file, $deal_id = null, $person_id = null, $org_id = null, $product_id = null, $activity_id = null, $lead_id = null) + { + list($response) = $this->addFileWithHttpInfo($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id); + return $response; + } + + /** + * Operation addFileWithHttpInfo + * + * Add file + * + * @param \SplFileObject $file A single file, supplied in the multipart/form-data encoding and contained within the given boundaries (required) + * @param int|null $deal_id The ID of the deal to associate file(s) with (optional) + * @param int|null $person_id The ID of the person to associate file(s) with (optional) + * @param int|null $org_id The ID of the organization to associate file(s) with (optional) + * @param int|null $product_id The ID of the product to associate file(s) with (optional) + * @param int|null $activity_id The ID of the activity to associate file(s) with (optional) + * @param string|null $lead_id The ID of the lead to associate file(s) with (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddFile, HTTP status code, HTTP response headers (array of strings) + */ + public function addFileWithHttpInfo($file, $deal_id = null, $person_id = null, $org_id = null, $product_id = null, $activity_id = null, $lead_id = null) + { + $request = $this->addFileRequest($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addFileRequest($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddFile', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addFileAsync + * + * Add file + * + * @param \SplFileObject $file A single file, supplied in the multipart/form-data encoding and contained within the given boundaries (required) + * @param int|null $deal_id The ID of the deal to associate file(s) with (optional) + * @param int|null $person_id The ID of the person to associate file(s) with (optional) + * @param int|null $org_id The ID of the organization to associate file(s) with (optional) + * @param int|null $product_id The ID of the product to associate file(s) with (optional) + * @param int|null $activity_id The ID of the activity to associate file(s) with (optional) + * @param string|null $lead_id The ID of the lead to associate file(s) with (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addFileAsync($file, $deal_id = null, $person_id = null, $org_id = null, $product_id = null, $activity_id = null, $lead_id = null): PromiseInterface + { + return $this->addFileAsyncWithHttpInfo($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addFileAsyncWithHttpInfo + * + * Add file + * + * @param \SplFileObject $file A single file, supplied in the multipart/form-data encoding and contained within the given boundaries (required) + * @param int|null $deal_id The ID of the deal to associate file(s) with (optional) + * @param int|null $person_id The ID of the person to associate file(s) with (optional) + * @param int|null $org_id The ID of the organization to associate file(s) with (optional) + * @param int|null $product_id The ID of the product to associate file(s) with (optional) + * @param int|null $activity_id The ID of the activity to associate file(s) with (optional) + * @param string|null $lead_id The ID of the lead to associate file(s) with (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addFileAsyncWithHttpInfo($file, $deal_id = null, $person_id = null, $org_id = null, $product_id = null, $activity_id = null, $lead_id = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddFile'; + $request = $this->addFileRequest($file, $deal_id, $person_id, $org_id, $product_id, $activity_id, $lead_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addFile' + * + * @param \SplFileObject $file A single file, supplied in the multipart/form-data encoding and contained within the given boundaries (required) + * @param int|null $deal_id The ID of the deal to associate file(s) with (optional) + * @param int|null $person_id The ID of the person to associate file(s) with (optional) + * @param int|null $org_id The ID of the organization to associate file(s) with (optional) + * @param int|null $product_id The ID of the product to associate file(s) with (optional) + * @param int|null $activity_id The ID of the activity to associate file(s) with (optional) + * @param string|null $lead_id The ID of the lead to associate file(s) with (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addFileRequest($file, $deal_id = null, $person_id = null, $org_id = null, $product_id = null, $activity_id = null, $lead_id = null): Request + { + // verify the required parameter 'file' is set + /* @phpstan-ignore-next-line */ + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling addFile' + ); + } + + $resourcePath = '/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + /* @phpstan-ignore-next-line */ + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + // form params + if ($deal_id !== null) { + $formParams['deal_id'] = ObjectSerializer::toFormValue($deal_id); + } + // form params + if ($person_id !== null) { + $formParams['person_id'] = ObjectSerializer::toFormValue($person_id); + } + // form params + if ($org_id !== null) { + $formParams['org_id'] = ObjectSerializer::toFormValue($org_id); + } + // form params + if ($product_id !== null) { + $formParams['product_id'] = ObjectSerializer::toFormValue($product_id); + } + // form params + if ($activity_id !== null) { + $formParams['activity_id'] = ObjectSerializer::toFormValue($activity_id); + } + // form params + if ($lead_id !== null) { + $formParams['lead_id'] = ObjectSerializer::toFormValue($lead_id); + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addFileAndLinkIt + * + * Create a remote file and link it to an item + * + * @param string $file_type The file type (required) + * @param string $title The title of the file (required) + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\CreateRemoteFileAndLinkItToItem + */ + public function addFileAndLinkIt($file_type, $title, $item_type, $item_id, $remote_location) + { + list($response) = $this->addFileAndLinkItWithHttpInfo($file_type, $title, $item_type, $item_id, $remote_location); + return $response; + } + + /** + * Operation addFileAndLinkItWithHttpInfo + * + * Create a remote file and link it to an item + * + * @param string $file_type The file type (required) + * @param string $title The title of the file (required) + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\CreateRemoteFileAndLinkItToItem, HTTP status code, HTTP response headers (array of strings) + */ + public function addFileAndLinkItWithHttpInfo($file_type, $title, $item_type, $item_id, $remote_location) + { + $request = $this->addFileAndLinkItRequest($file_type, $title, $item_type, $item_id, $remote_location); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addFileAndLinkItRequest($file_type, $title, $item_type, $item_id, $remote_location); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CreateRemoteFileAndLinkItToItem' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CreateRemoteFileAndLinkItToItem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\CreateRemoteFileAndLinkItToItem' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\CreateRemoteFileAndLinkItToItem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\CreateRemoteFileAndLinkItToItem', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addFileAndLinkItAsync + * + * Create a remote file and link it to an item + * + * @param string $file_type The file type (required) + * @param string $title The title of the file (required) + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addFileAndLinkItAsync($file_type, $title, $item_type, $item_id, $remote_location): PromiseInterface + { + return $this->addFileAndLinkItAsyncWithHttpInfo($file_type, $title, $item_type, $item_id, $remote_location) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addFileAndLinkItAsyncWithHttpInfo + * + * Create a remote file and link it to an item + * + * @param string $file_type The file type (required) + * @param string $title The title of the file (required) + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addFileAndLinkItAsyncWithHttpInfo($file_type, $title, $item_type, $item_id, $remote_location): PromiseInterface + { + $returnType = '\Pipedrive\Model\CreateRemoteFileAndLinkItToItem'; + $request = $this->addFileAndLinkItRequest($file_type, $title, $item_type, $item_id, $remote_location); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addFileAndLinkIt' + * + * @param string $file_type The file type (required) + * @param string $title The title of the file (required) + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addFileAndLinkItRequest($file_type, $title, $item_type, $item_id, $remote_location): Request + { + // verify the required parameter 'file_type' is set + /* @phpstan-ignore-next-line */ + if ($file_type === null || (is_array($file_type) && count($file_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file_type when calling addFileAndLinkIt' + ); + } + // verify the required parameter 'title' is set + /* @phpstan-ignore-next-line */ + if ($title === null || (is_array($title) && count($title) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $title when calling addFileAndLinkIt' + ); + } + // verify the required parameter 'item_type' is set + /* @phpstan-ignore-next-line */ + if ($item_type === null || (is_array($item_type) && count($item_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $item_type when calling addFileAndLinkIt' + ); + } + // verify the required parameter 'item_id' is set + /* @phpstan-ignore-next-line */ + if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $item_id when calling addFileAndLinkIt' + ); + } + // verify the required parameter 'remote_location' is set + /* @phpstan-ignore-next-line */ + if ($remote_location === null || (is_array($remote_location) && count($remote_location) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $remote_location when calling addFileAndLinkIt' + ); + } + + $resourcePath = '/files/remote'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // form params + if ($file_type !== null) { + $formParams['file_type'] = ObjectSerializer::toFormValue($file_type); + } + // form params + if ($title !== null) { + $formParams['title'] = ObjectSerializer::toFormValue($title); + } + // form params + if ($item_type !== null) { + $formParams['item_type'] = ObjectSerializer::toFormValue($item_type); + } + // form params + if ($item_id !== null) { + $formParams['item_id'] = ObjectSerializer::toFormValue($item_id); + } + // form params + if ($remote_location !== null) { + $formParams['remote_location'] = ObjectSerializer::toFormValue($remote_location); + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFile + * + * Delete a file + * + * @param int $id The ID of the file (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteFile + */ + public function deleteFile($id) + { + list($response) = $this->deleteFileWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteFileWithHttpInfo + * + * Delete a file + * + * @param int $id The ID of the file (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteFile, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFileWithHttpInfo($id) + { + $request = $this->deleteFileRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteFileRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteFile', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteFileAsync + * + * Delete a file + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteFileAsync($id): PromiseInterface + { + return $this->deleteFileAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFileAsyncWithHttpInfo + * + * Delete a file + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteFileAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteFile'; + $request = $this->deleteFileRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFile' + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteFileRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteFile' + ); + } + + $resourcePath = '/files/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation downloadFile + * + * Download one file + * + * @param int $id The ID of the file (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return string + */ + public function downloadFile($id) + { + list($response) = $this->downloadFileWithHttpInfo($id); + return $response; + } + + /** + * Operation downloadFileWithHttpInfo + * + * Download one file + * + * @param int $id The ID of the file (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadFileWithHttpInfo($id) + { + $request = $this->downloadFileRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->downloadFileRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + 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() + ); + } + + /* @phpstan-ignore-next-line */ + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $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 downloadFileAsync + * + * Download one file + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function downloadFileAsync($id): PromiseInterface + { + return $this->downloadFileAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadFileAsyncWithHttpInfo + * + * Download one file + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function downloadFileAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = 'string'; + $request = $this->downloadFileRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'downloadFile' + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function downloadFileRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling downloadFile' + ); + } + + $resourcePath = '/files/{id}/download'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/octet-stream'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/octet-stream'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFile + * + * Get one file + * + * @param int $id The ID of the file (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetOneFile + */ + public function getFile($id) + { + list($response) = $this->getFileWithHttpInfo($id); + return $response; + } + + /** + * Operation getFileWithHttpInfo + * + * Get one file + * + * @param int $id The ID of the file (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetOneFile, HTTP status code, HTTP response headers (array of strings) + */ + public function getFileWithHttpInfo($id) + { + $request = $this->getFileRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getFileRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetOneFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetOneFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetOneFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetOneFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetOneFile', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFileAsync + * + * Get one file + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFileAsync($id): PromiseInterface + { + return $this->getFileAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFileAsyncWithHttpInfo + * + * Get one file + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFileAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetOneFile'; + $request = $this->getFileRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFile' + * + * @param int $id The ID of the file (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getFileRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getFile' + ); + } + + $resourcePath = '/files/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFiles + * + * Get all files + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAllFiles + */ + public function getFiles($start = 0, $limit = null, $sort = null) + { + list($response) = $this->getFilesWithHttpInfo($start, $limit, $sort); + return $response; + } + + /** + * Operation getFilesWithHttpInfo + * + * Get all files + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAllFiles, HTTP status code, HTTP response headers (array of strings) + */ + public function getFilesWithHttpInfo($start = 0, $limit = null, $sort = null) + { + $request = $this->getFilesRequest($start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getFilesRequest($start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllFiles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllFiles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllFiles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllFiles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAllFiles', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFilesAsync + * + * Get all files + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFilesAsync($start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getFilesAsyncWithHttpInfo($start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFilesAsyncWithHttpInfo + * + * Get all files + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFilesAsyncWithHttpInfo($start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAllFiles'; + $request = $this->getFilesRequest($start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFiles' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getFilesRequest($start = 0, $limit = null, $sort = null): Request + { + + $resourcePath = '/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation linkFileToItem + * + * Link a remote file to an item + * + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_id The remote item ID (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\LinkRemoteFileToItem + */ + public function linkFileToItem($item_type, $item_id, $remote_id, $remote_location) + { + list($response) = $this->linkFileToItemWithHttpInfo($item_type, $item_id, $remote_id, $remote_location); + return $response; + } + + /** + * Operation linkFileToItemWithHttpInfo + * + * Link a remote file to an item + * + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_id The remote item ID (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\LinkRemoteFileToItem, HTTP status code, HTTP response headers (array of strings) + */ + public function linkFileToItemWithHttpInfo($item_type, $item_id, $remote_id, $remote_location) + { + $request = $this->linkFileToItemRequest($item_type, $item_id, $remote_id, $remote_location); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->linkFileToItemRequest($item_type, $item_id, $remote_id, $remote_location); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LinkRemoteFileToItem' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LinkRemoteFileToItem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LinkRemoteFileToItem' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LinkRemoteFileToItem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LinkRemoteFileToItem', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation linkFileToItemAsync + * + * Link a remote file to an item + * + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_id The remote item ID (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function linkFileToItemAsync($item_type, $item_id, $remote_id, $remote_location): PromiseInterface + { + return $this->linkFileToItemAsyncWithHttpInfo($item_type, $item_id, $remote_id, $remote_location) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation linkFileToItemAsyncWithHttpInfo + * + * Link a remote file to an item + * + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_id The remote item ID (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function linkFileToItemAsyncWithHttpInfo($item_type, $item_id, $remote_id, $remote_location): PromiseInterface + { + $returnType = '\Pipedrive\Model\LinkRemoteFileToItem'; + $request = $this->linkFileToItemRequest($item_type, $item_id, $remote_id, $remote_location); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'linkFileToItem' + * + * @param string $item_type The item type (required) + * @param int $item_id The ID of the item to associate the file with (required) + * @param string $remote_id The remote item ID (required) + * @param string $remote_location The location type to send the file to. Only `googledrive` is supported at the moment. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function linkFileToItemRequest($item_type, $item_id, $remote_id, $remote_location): Request + { + // verify the required parameter 'item_type' is set + /* @phpstan-ignore-next-line */ + if ($item_type === null || (is_array($item_type) && count($item_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $item_type when calling linkFileToItem' + ); + } + // verify the required parameter 'item_id' is set + /* @phpstan-ignore-next-line */ + if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $item_id when calling linkFileToItem' + ); + } + // verify the required parameter 'remote_id' is set + /* @phpstan-ignore-next-line */ + if ($remote_id === null || (is_array($remote_id) && count($remote_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $remote_id when calling linkFileToItem' + ); + } + // verify the required parameter 'remote_location' is set + /* @phpstan-ignore-next-line */ + if ($remote_location === null || (is_array($remote_location) && count($remote_location) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $remote_location when calling linkFileToItem' + ); + } + + $resourcePath = '/files/remoteLink'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // form params + if ($item_type !== null) { + $formParams['item_type'] = ObjectSerializer::toFormValue($item_type); + } + // form params + if ($item_id !== null) { + $formParams['item_id'] = ObjectSerializer::toFormValue($item_id); + } + // form params + if ($remote_id !== null) { + $formParams['remote_id'] = ObjectSerializer::toFormValue($remote_id); + } + // form params + if ($remote_location !== null) { + $formParams['remote_location'] = ObjectSerializer::toFormValue($remote_location); + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFile + * + * Update file details + * + * @param int $id The ID of the file (required) + * @param string|null $name The visible name of the file (optional) + * @param string|null $description The description of the file (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UpdateFile + */ + public function updateFile($id, $name = null, $description = null) + { + list($response) = $this->updateFileWithHttpInfo($id, $name, $description); + return $response; + } + + /** + * Operation updateFileWithHttpInfo + * + * Update file details + * + * @param int $id The ID of the file (required) + * @param string|null $name The visible name of the file (optional) + * @param string|null $description The description of the file (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UpdateFile, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFileWithHttpInfo($id, $name = null, $description = null) + { + $request = $this->updateFileRequest($id, $name, $description); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateFileRequest($id, $name, $description); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdateFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdateFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdateFile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdateFile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UpdateFile', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateFileAsync + * + * Update file details + * + * @param int $id The ID of the file (required) + * @param string|null $name The visible name of the file (optional) + * @param string|null $description The description of the file (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateFileAsync($id, $name = null, $description = null): PromiseInterface + { + return $this->updateFileAsyncWithHttpInfo($id, $name, $description) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFileAsyncWithHttpInfo + * + * Update file details + * + * @param int $id The ID of the file (required) + * @param string|null $name The visible name of the file (optional) + * @param string|null $description The description of the file (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateFileAsyncWithHttpInfo($id, $name = null, $description = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UpdateFile'; + $request = $this->updateFileRequest($id, $name, $description); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFile' + * + * @param int $id The ID of the file (required) + * @param string|null $name The visible name of the file (optional) + * @param string|null $description The description of the file (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateFileRequest($id, $name = null, $description = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateFile' + ); + } + + $resourcePath = '/files/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($name !== null) { + $formParams['name'] = ObjectSerializer::toFormValue($name); + } + // form params + if ($description !== null) { + $formParams['description'] = ObjectSerializer::toFormValue($description); + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/FiltersApi.php b/lib/Api/FiltersApi.php new file mode 100644 index 00000000..aec022ea --- /dev/null +++ b/lib/Api/FiltersApi.php @@ -0,0 +1,2182 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addFilter + * + * Add a new filter + * + * @param \Pipedrive\Model\AddFilterRequest|null $add_filter_request add_filter_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FiltersPostResponse + */ + public function addFilter($add_filter_request = null) + { + list($response) = $this->addFilterWithHttpInfo($add_filter_request); + return $response; + } + + /** + * Operation addFilterWithHttpInfo + * + * Add a new filter + * + * @param \Pipedrive\Model\AddFilterRequest|null $add_filter_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FiltersPostResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addFilterWithHttpInfo($add_filter_request = null) + { + $request = $this->addFilterRequest($add_filter_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addFilterRequest($add_filter_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FiltersPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addFilterAsync + * + * Add a new filter + * + * @param \Pipedrive\Model\AddFilterRequest|null $add_filter_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addFilterAsync($add_filter_request = null): PromiseInterface + { + return $this->addFilterAsyncWithHttpInfo($add_filter_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addFilterAsyncWithHttpInfo + * + * Add a new filter + * + * @param \Pipedrive\Model\AddFilterRequest|null $add_filter_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addFilterAsyncWithHttpInfo($add_filter_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FiltersPostResponse'; + $request = $this->addFilterRequest($add_filter_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addFilter' + * + * @param \Pipedrive\Model\AddFilterRequest|null $add_filter_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addFilterRequest($add_filter_request = null): Request + { + + $resourcePath = '/filters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_filter_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_filter_request)); + } else { + $httpBody = $add_filter_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFilter + * + * Delete a filter + * + * @param int $id The ID of the filter (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FiltersDeleteResponse + */ + public function deleteFilter($id) + { + list($response) = $this->deleteFilterWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteFilterWithHttpInfo + * + * Delete a filter + * + * @param int $id The ID of the filter (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FiltersDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFilterWithHttpInfo($id) + { + $request = $this->deleteFilterRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteFilterRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FiltersDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteFilterAsync + * + * Delete a filter + * + * @param int $id The ID of the filter (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteFilterAsync($id): PromiseInterface + { + return $this->deleteFilterAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFilterAsyncWithHttpInfo + * + * Delete a filter + * + * @param int $id The ID of the filter (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteFilterAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\FiltersDeleteResponse'; + $request = $this->deleteFilterRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFilter' + * + * @param int $id The ID of the filter (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteFilterRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteFilter' + ); + } + + $resourcePath = '/filters/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteFilters + * + * Delete multiple filters in bulk + * + * @param string $ids The comma-separated filter IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FiltersBulkDeleteResponse + */ + public function deleteFilters($ids) + { + list($response) = $this->deleteFiltersWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteFiltersWithHttpInfo + * + * Delete multiple filters in bulk + * + * @param string $ids The comma-separated filter IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FiltersBulkDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteFiltersWithHttpInfo($ids) + { + $request = $this->deleteFiltersRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteFiltersRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersBulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersBulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersBulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersBulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FiltersBulkDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteFiltersAsync + * + * Delete multiple filters in bulk + * + * @param string $ids The comma-separated filter IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteFiltersAsync($ids): PromiseInterface + { + return $this->deleteFiltersAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteFiltersAsyncWithHttpInfo + * + * Delete multiple filters in bulk + * + * @param string $ids The comma-separated filter IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteFiltersAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\FiltersBulkDeleteResponse'; + $request = $this->deleteFiltersRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteFilters' + * + * @param string $ids The comma-separated filter IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteFiltersRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteFilters' + ); + } + + $resourcePath = '/filters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFilter + * + * Get one filter + * + * @param int $id The ID of the filter (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FiltersGetResponse + */ + public function getFilter($id) + { + list($response) = $this->getFilterWithHttpInfo($id); + return $response; + } + + /** + * Operation getFilterWithHttpInfo + * + * Get one filter + * + * @param int $id The ID of the filter (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FiltersGetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getFilterWithHttpInfo($id) + { + $request = $this->getFilterRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getFilterRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FiltersGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFilterAsync + * + * Get one filter + * + * @param int $id The ID of the filter (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFilterAsync($id): PromiseInterface + { + return $this->getFilterAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFilterAsyncWithHttpInfo + * + * Get one filter + * + * @param int $id The ID of the filter (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFilterAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\FiltersGetResponse'; + $request = $this->getFilterRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFilter' + * + * @param int $id The ID of the filter (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getFilterRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getFilter' + ); + } + + $resourcePath = '/filters/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFilterHelpers + * + * Get all filter helpers + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return object + */ + public function getFilterHelpers() + { + list($response) = $this->getFilterHelpersWithHttpInfo(); + return $response; + } + + /** + * Operation getFilterHelpersWithHttpInfo + * + * Get all filter helpers + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function getFilterHelpersWithHttpInfo() + { + $request = $this->getFilterHelpersRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getFilterHelpersRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFilterHelpersAsync + * + * Get all filter helpers + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFilterHelpersAsync(): PromiseInterface + { + return $this->getFilterHelpersAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFilterHelpersAsyncWithHttpInfo + * + * Get all filter helpers + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFilterHelpersAsyncWithHttpInfo(): PromiseInterface + { + $returnType = 'object'; + $request = $this->getFilterHelpersRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFilterHelpers' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getFilterHelpersRequest(): Request + { + + $resourcePath = '/filters/helpers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getFilters + * + * Get all filters + * + * @param \Pipedrive\Model\FilterType|null $type The types of filters to fetch (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FiltersBulkGetResponse + */ + public function getFilters($type = null) + { + list($response) = $this->getFiltersWithHttpInfo($type); + return $response; + } + + /** + * Operation getFiltersWithHttpInfo + * + * Get all filters + * + * @param \Pipedrive\Model\FilterType|null $type The types of filters to fetch (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FiltersBulkGetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getFiltersWithHttpInfo($type = null) + { + $request = $this->getFiltersRequest($type); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getFiltersRequest($type); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersBulkGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersBulkGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersBulkGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersBulkGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FiltersBulkGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getFiltersAsync + * + * Get all filters + * + * @param \Pipedrive\Model\FilterType|null $type The types of filters to fetch (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFiltersAsync($type = null): PromiseInterface + { + return $this->getFiltersAsyncWithHttpInfo($type) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFiltersAsyncWithHttpInfo + * + * Get all filters + * + * @param \Pipedrive\Model\FilterType|null $type The types of filters to fetch (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getFiltersAsyncWithHttpInfo($type = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FiltersBulkGetResponse'; + $request = $this->getFiltersRequest($type); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getFilters' + * + * @param \Pipedrive\Model\FilterType|null $type The types of filters to fetch (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getFiltersRequest($type = null): Request + { + + $resourcePath = '/filters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type)) { + $type = ObjectSerializer::serializeCollection($type, '', true); + } + if ($type !== null) { + $queryParams['type'] = $type; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateFilter + * + * Update filter + * + * @param int $id The ID of the filter (required) + * @param \Pipedrive\Model\UpdateFilterRequest|null $update_filter_request update_filter_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FiltersPostResponse + */ + public function updateFilter($id, $update_filter_request = null) + { + list($response) = $this->updateFilterWithHttpInfo($id, $update_filter_request); + return $response; + } + + /** + * Operation updateFilterWithHttpInfo + * + * Update filter + * + * @param int $id The ID of the filter (required) + * @param \Pipedrive\Model\UpdateFilterRequest|null $update_filter_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FiltersPostResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateFilterWithHttpInfo($id, $update_filter_request = null) + { + $request = $this->updateFilterRequest($id, $update_filter_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateFilterRequest($id, $update_filter_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FiltersPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FiltersPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FiltersPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateFilterAsync + * + * Update filter + * + * @param int $id The ID of the filter (required) + * @param \Pipedrive\Model\UpdateFilterRequest|null $update_filter_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateFilterAsync($id, $update_filter_request = null): PromiseInterface + { + return $this->updateFilterAsyncWithHttpInfo($id, $update_filter_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateFilterAsyncWithHttpInfo + * + * Update filter + * + * @param int $id The ID of the filter (required) + * @param \Pipedrive\Model\UpdateFilterRequest|null $update_filter_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateFilterAsyncWithHttpInfo($id, $update_filter_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FiltersPostResponse'; + $request = $this->updateFilterRequest($id, $update_filter_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateFilter' + * + * @param int $id The ID of the filter (required) + * @param \Pipedrive\Model\UpdateFilterRequest|null $update_filter_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateFilterRequest($id, $update_filter_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateFilter' + ); + } + + $resourcePath = '/filters/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_filter_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_filter_request)); + } else { + $httpBody = $update_filter_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/GoalsApi.php b/lib/Api/GoalsApi.php new file mode 100644 index 00000000..dd7db058 --- /dev/null +++ b/lib/Api/GoalsApi.php @@ -0,0 +1,1814 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addGoal + * + * Add a new goal + * + * @param \Pipedrive\Model\NewGoal|null $new_goal new_goal (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddOrUpdateGoalResponse200 + */ + public function addGoal($new_goal = null) + { + list($response) = $this->addGoalWithHttpInfo($new_goal); + return $response; + } + + /** + * Operation addGoalWithHttpInfo + * + * Add a new goal + * + * @param \Pipedrive\Model\NewGoal|null $new_goal (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddOrUpdateGoalResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function addGoalWithHttpInfo($new_goal = null) + { + $request = $this->addGoalRequest($new_goal); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addGoalRequest($new_goal); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateGoalResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateGoalResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateGoalResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateGoalResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddOrUpdateGoalResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addGoalAsync + * + * Add a new goal + * + * @param \Pipedrive\Model\NewGoal|null $new_goal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addGoalAsync($new_goal = null): PromiseInterface + { + return $this->addGoalAsyncWithHttpInfo($new_goal) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addGoalAsyncWithHttpInfo + * + * Add a new goal + * + * @param \Pipedrive\Model\NewGoal|null $new_goal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addGoalAsyncWithHttpInfo($new_goal = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddOrUpdateGoalResponse200'; + $request = $this->addGoalRequest($new_goal); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addGoal' + * + * @param \Pipedrive\Model\NewGoal|null $new_goal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addGoalRequest($new_goal = null): Request + { + + $resourcePath = '/goals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($new_goal)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($new_goal)); + } else { + $httpBody = $new_goal; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteGoal + * + * Delete existing goal + * + * @param string $id The ID of the goal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteGoalResponse200 + */ + public function deleteGoal($id) + { + list($response) = $this->deleteGoalWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteGoalWithHttpInfo + * + * Delete existing goal + * + * @param string $id The ID of the goal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteGoalResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteGoalWithHttpInfo($id) + { + $request = $this->deleteGoalRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteGoalRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteGoalResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteGoalResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteGoalResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteGoalResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteGoalResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteGoalAsync + * + * Delete existing goal + * + * @param string $id The ID of the goal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteGoalAsync($id): PromiseInterface + { + return $this->deleteGoalAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteGoalAsyncWithHttpInfo + * + * Delete existing goal + * + * @param string $id The ID of the goal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteGoalAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteGoalResponse200'; + $request = $this->deleteGoalRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteGoal' + * + * @param string $id The ID of the goal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteGoalRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteGoal' + ); + } + + $resourcePath = '/goals/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGoalResult + * + * Get result of a goal + * + * @param string $id The ID of the goal that the results are looked for (required) + * @param \DateTime $period_start The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. (required) + * @param \DateTime $period_end The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetGoalResultResponse200 + */ + public function getGoalResult($id, $period_start, $period_end) + { + list($response) = $this->getGoalResultWithHttpInfo($id, $period_start, $period_end); + return $response; + } + + /** + * Operation getGoalResultWithHttpInfo + * + * Get result of a goal + * + * @param string $id The ID of the goal that the results are looked for (required) + * @param \DateTime $period_start The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. (required) + * @param \DateTime $period_end The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetGoalResultResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getGoalResultWithHttpInfo($id, $period_start, $period_end) + { + $request = $this->getGoalResultRequest($id, $period_start, $period_end); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getGoalResultRequest($id, $period_start, $period_end); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetGoalResultResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetGoalResultResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetGoalResultResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetGoalResultResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetGoalResultResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGoalResultAsync + * + * Get result of a goal + * + * @param string $id The ID of the goal that the results are looked for (required) + * @param \DateTime $period_start The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. (required) + * @param \DateTime $period_end The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getGoalResultAsync($id, $period_start, $period_end): PromiseInterface + { + return $this->getGoalResultAsyncWithHttpInfo($id, $period_start, $period_end) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGoalResultAsyncWithHttpInfo + * + * Get result of a goal + * + * @param string $id The ID of the goal that the results are looked for (required) + * @param \DateTime $period_start The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. (required) + * @param \DateTime $period_end The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getGoalResultAsyncWithHttpInfo($id, $period_start, $period_end): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetGoalResultResponse200'; + $request = $this->getGoalResultRequest($id, $period_start, $period_end); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGoalResult' + * + * @param string $id The ID of the goal that the results are looked for (required) + * @param \DateTime $period_start The start date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or after the goal duration start date. (required) + * @param \DateTime $period_end The end date of the period for which to find the goal's progress. Format: YYYY-MM-DD. This date must be the same or before the goal duration end date. (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getGoalResultRequest($id, $period_start, $period_end): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getGoalResult' + ); + } + // verify the required parameter 'period_start' is set + /* @phpstan-ignore-next-line */ + if ($period_start === null || (is_array($period_start) && count($period_start) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $period_start when calling getGoalResult' + ); + } + // verify the required parameter 'period_end' is set + /* @phpstan-ignore-next-line */ + if ($period_end === null || (is_array($period_end) && count($period_end) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $period_end when calling getGoalResult' + ); + } + + $resourcePath = '/goals/{id}/results'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($period_start)) { + $period_start = ObjectSerializer::serializeCollection($period_start, '', true); + } + if ($period_start !== null) { + $queryParams['period.start'] = $period_start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($period_end)) { + $period_end = ObjectSerializer::serializeCollection($period_end, '', true); + } + if ($period_end !== null) { + $queryParams['period.end'] = $period_end; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getGoals + * + * Find goals + * + * @param string|null $type_name The type of the goal. If provided, everyone's goals will be returned. (optional) + * @param string|null $title The title of the goal (optional) + * @param bool|true $is_active Whether the goal is active or not (optional, default to true) + * @param int|null $assignee_id The ID of the user who's goal to fetch. When omitted, only your goals will be returned. (optional) + * @param string|null $assignee_type The type of the goal's assignee. If provided, everyone's goals will be returned. (optional) + * @param float|null $expected_outcome_target The numeric value of the outcome. If provided, everyone's goals will be returned. (optional) + * @param string|null $expected_outcome_tracking_metric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. (optional) + * @param int|null $expected_outcome_currency_id The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_pipeline_id An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. (optional) + * @param int|null $type_params_stage_id The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_activity_type_id An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. (optional) + * @param \DateTime|null $period_start The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. (optional) + * @param \DateTime|null $period_end The end date of the period for which to find goals. Date in format of YYYY-MM-DD. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetGoalsResponse200 + */ + public function getGoals($type_name = null, $title = null, $is_active = true, $assignee_id = null, $assignee_type = null, $expected_outcome_target = null, $expected_outcome_tracking_metric = null, $expected_outcome_currency_id = null, $type_params_pipeline_id = null, $type_params_stage_id = null, $type_params_activity_type_id = null, $period_start = null, $period_end = null) + { + list($response) = $this->getGoalsWithHttpInfo($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end); + return $response; + } + + /** + * Operation getGoalsWithHttpInfo + * + * Find goals + * + * @param string|null $type_name The type of the goal. If provided, everyone's goals will be returned. (optional) + * @param string|null $title The title of the goal (optional) + * @param bool|true $is_active Whether the goal is active or not (optional, default to true) + * @param int|null $assignee_id The ID of the user who's goal to fetch. When omitted, only your goals will be returned. (optional) + * @param string|null $assignee_type The type of the goal's assignee. If provided, everyone's goals will be returned. (optional) + * @param float|null $expected_outcome_target The numeric value of the outcome. If provided, everyone's goals will be returned. (optional) + * @param string|null $expected_outcome_tracking_metric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. (optional) + * @param int|null $expected_outcome_currency_id The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_pipeline_id An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. (optional) + * @param int|null $type_params_stage_id The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_activity_type_id An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. (optional) + * @param \DateTime|null $period_start The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. (optional) + * @param \DateTime|null $period_end The end date of the period for which to find goals. Date in format of YYYY-MM-DD. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetGoalsResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getGoalsWithHttpInfo($type_name = null, $title = null, $is_active = true, $assignee_id = null, $assignee_type = null, $expected_outcome_target = null, $expected_outcome_tracking_metric = null, $expected_outcome_currency_id = null, $type_params_pipeline_id = null, $type_params_stage_id = null, $type_params_activity_type_id = null, $period_start = null, $period_end = null) + { + $request = $this->getGoalsRequest($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getGoalsRequest($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetGoalsResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetGoalsResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetGoalsResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetGoalsResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetGoalsResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getGoalsAsync + * + * Find goals + * + * @param string|null $type_name The type of the goal. If provided, everyone's goals will be returned. (optional) + * @param string|null $title The title of the goal (optional) + * @param bool|true $is_active Whether the goal is active or not (optional, default to true) + * @param int|null $assignee_id The ID of the user who's goal to fetch. When omitted, only your goals will be returned. (optional) + * @param string|null $assignee_type The type of the goal's assignee. If provided, everyone's goals will be returned. (optional) + * @param float|null $expected_outcome_target The numeric value of the outcome. If provided, everyone's goals will be returned. (optional) + * @param string|null $expected_outcome_tracking_metric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. (optional) + * @param int|null $expected_outcome_currency_id The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_pipeline_id An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. (optional) + * @param int|null $type_params_stage_id The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_activity_type_id An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. (optional) + * @param \DateTime|null $period_start The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. (optional) + * @param \DateTime|null $period_end The end date of the period for which to find goals. Date in format of YYYY-MM-DD. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getGoalsAsync($type_name = null, $title = null, $is_active = true, $assignee_id = null, $assignee_type = null, $expected_outcome_target = null, $expected_outcome_tracking_metric = null, $expected_outcome_currency_id = null, $type_params_pipeline_id = null, $type_params_stage_id = null, $type_params_activity_type_id = null, $period_start = null, $period_end = null): PromiseInterface + { + return $this->getGoalsAsyncWithHttpInfo($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getGoalsAsyncWithHttpInfo + * + * Find goals + * + * @param string|null $type_name The type of the goal. If provided, everyone's goals will be returned. (optional) + * @param string|null $title The title of the goal (optional) + * @param bool|true $is_active Whether the goal is active or not (optional, default to true) + * @param int|null $assignee_id The ID of the user who's goal to fetch. When omitted, only your goals will be returned. (optional) + * @param string|null $assignee_type The type of the goal's assignee. If provided, everyone's goals will be returned. (optional) + * @param float|null $expected_outcome_target The numeric value of the outcome. If provided, everyone's goals will be returned. (optional) + * @param string|null $expected_outcome_tracking_metric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. (optional) + * @param int|null $expected_outcome_currency_id The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_pipeline_id An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. (optional) + * @param int|null $type_params_stage_id The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_activity_type_id An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. (optional) + * @param \DateTime|null $period_start The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. (optional) + * @param \DateTime|null $period_end The end date of the period for which to find goals. Date in format of YYYY-MM-DD. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getGoalsAsyncWithHttpInfo($type_name = null, $title = null, $is_active = true, $assignee_id = null, $assignee_type = null, $expected_outcome_target = null, $expected_outcome_tracking_metric = null, $expected_outcome_currency_id = null, $type_params_pipeline_id = null, $type_params_stage_id = null, $type_params_activity_type_id = null, $period_start = null, $period_end = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetGoalsResponse200'; + $request = $this->getGoalsRequest($type_name, $title, $is_active, $assignee_id, $assignee_type, $expected_outcome_target, $expected_outcome_tracking_metric, $expected_outcome_currency_id, $type_params_pipeline_id, $type_params_stage_id, $type_params_activity_type_id, $period_start, $period_end); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getGoals' + * + * @param string|null $type_name The type of the goal. If provided, everyone's goals will be returned. (optional) + * @param string|null $title The title of the goal (optional) + * @param bool|true $is_active Whether the goal is active or not (optional, default to true) + * @param int|null $assignee_id The ID of the user who's goal to fetch. When omitted, only your goals will be returned. (optional) + * @param string|null $assignee_type The type of the goal's assignee. If provided, everyone's goals will be returned. (optional) + * @param float|null $expected_outcome_target The numeric value of the outcome. If provided, everyone's goals will be returned. (optional) + * @param string|null $expected_outcome_tracking_metric The tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. (optional) + * @param int|null $expected_outcome_currency_id The numeric ID of the goal's currency. Only applicable to goals with `expected_outcome.tracking_metric` with value `sum`. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_pipeline_id An array of pipeline IDs or `null` for all pipelines. If provided, everyone's goals will be returned. (optional) + * @param int|null $type_params_stage_id The ID of the stage. Applicable to only `deals_progressed` type of goals. If provided, everyone's goals will be returned. (optional) + * @param int[]|null $type_params_activity_type_id An array of IDs or `null` for all activity types. Only applicable for `activities_completed` and/or `activities_added` types of goals. If provided, everyone's goals will be returned. (optional) + * @param \DateTime|null $period_start The start date of the period for which to find goals. Date in format of YYYY-MM-DD. When `period.start` is provided, `period.end` must be provided too. (optional) + * @param \DateTime|null $period_end The end date of the period for which to find goals. Date in format of YYYY-MM-DD. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getGoalsRequest($type_name = null, $title = null, $is_active = true, $assignee_id = null, $assignee_type = null, $expected_outcome_target = null, $expected_outcome_tracking_metric = null, $expected_outcome_currency_id = null, $type_params_pipeline_id = null, $type_params_stage_id = null, $type_params_activity_type_id = null, $period_start = null, $period_end = null): Request + { + + $resourcePath = '/goals/find'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type_name)) { + $type_name = ObjectSerializer::serializeCollection($type_name, '', true); + } + if ($type_name !== null) { + $queryParams['type.name'] = $type_name; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($title)) { + $title = ObjectSerializer::serializeCollection($title, '', true); + } + if ($title !== null) { + $queryParams['title'] = $title; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($is_active)) { + $is_active = ObjectSerializer::serializeCollection($is_active, '', true); + } + if ($is_active !== null) { + $queryParams['is_active'] = $is_active; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($assignee_id)) { + $assignee_id = ObjectSerializer::serializeCollection($assignee_id, '', true); + } + if ($assignee_id !== null) { + $queryParams['assignee.id'] = $assignee_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($assignee_type)) { + $assignee_type = ObjectSerializer::serializeCollection($assignee_type, '', true); + } + if ($assignee_type !== null) { + $queryParams['assignee.type'] = $assignee_type; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($expected_outcome_target)) { + $expected_outcome_target = ObjectSerializer::serializeCollection($expected_outcome_target, '', true); + } + if ($expected_outcome_target !== null) { + $queryParams['expected_outcome.target'] = $expected_outcome_target; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($expected_outcome_tracking_metric)) { + $expected_outcome_tracking_metric = ObjectSerializer::serializeCollection($expected_outcome_tracking_metric, '', true); + } + if ($expected_outcome_tracking_metric !== null) { + $queryParams['expected_outcome.tracking_metric'] = $expected_outcome_tracking_metric; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($expected_outcome_currency_id)) { + $expected_outcome_currency_id = ObjectSerializer::serializeCollection($expected_outcome_currency_id, '', true); + } + if ($expected_outcome_currency_id !== null) { + $queryParams['expected_outcome.currency_id'] = $expected_outcome_currency_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type_params_pipeline_id)) { + $type_params_pipeline_id = ObjectSerializer::serializeCollection($type_params_pipeline_id, 'csv', true); + } + if ($type_params_pipeline_id !== null) { + $queryParams['type.params.pipeline_id'] = $type_params_pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type_params_stage_id)) { + $type_params_stage_id = ObjectSerializer::serializeCollection($type_params_stage_id, '', true); + } + if ($type_params_stage_id !== null) { + $queryParams['type.params.stage_id'] = $type_params_stage_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($type_params_activity_type_id)) { + $type_params_activity_type_id = ObjectSerializer::serializeCollection($type_params_activity_type_id, 'csv', true); + } + if ($type_params_activity_type_id !== null) { + $queryParams['type.params.activity_type_id'] = $type_params_activity_type_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($period_start)) { + $period_start = ObjectSerializer::serializeCollection($period_start, '', true); + } + if ($period_start !== null) { + $queryParams['period.start'] = $period_start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($period_end)) { + $period_end = ObjectSerializer::serializeCollection($period_end, '', true); + } + if ($period_end !== null) { + $queryParams['period.end'] = $period_end; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateGoal + * + * Update existing goal + * + * @param string $id The ID of the goal (required) + * @param \Pipedrive\Model\BasicGoal|null $basic_goal basic_goal (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddOrUpdateGoalResponse200 + */ + public function updateGoal($id, $basic_goal = null) + { + list($response) = $this->updateGoalWithHttpInfo($id, $basic_goal); + return $response; + } + + /** + * Operation updateGoalWithHttpInfo + * + * Update existing goal + * + * @param string $id The ID of the goal (required) + * @param \Pipedrive\Model\BasicGoal|null $basic_goal (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddOrUpdateGoalResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function updateGoalWithHttpInfo($id, $basic_goal = null) + { + $request = $this->updateGoalRequest($id, $basic_goal); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateGoalRequest($id, $basic_goal); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateGoalResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateGoalResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateGoalResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateGoalResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddOrUpdateGoalResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateGoalAsync + * + * Update existing goal + * + * @param string $id The ID of the goal (required) + * @param \Pipedrive\Model\BasicGoal|null $basic_goal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateGoalAsync($id, $basic_goal = null): PromiseInterface + { + return $this->updateGoalAsyncWithHttpInfo($id, $basic_goal) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateGoalAsyncWithHttpInfo + * + * Update existing goal + * + * @param string $id The ID of the goal (required) + * @param \Pipedrive\Model\BasicGoal|null $basic_goal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateGoalAsyncWithHttpInfo($id, $basic_goal = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddOrUpdateGoalResponse200'; + $request = $this->updateGoalRequest($id, $basic_goal); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateGoal' + * + * @param string $id The ID of the goal (required) + * @param \Pipedrive\Model\BasicGoal|null $basic_goal (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateGoalRequest($id, $basic_goal = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateGoal' + ); + } + + $resourcePath = '/goals/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($basic_goal)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($basic_goal)); + } else { + $httpBody = $basic_goal; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/ItemSearchApi.php b/lib/Api/ItemSearchApi.php new file mode 100644 index 00000000..ec5613bd --- /dev/null +++ b/lib/Api/ItemSearchApi.php @@ -0,0 +1,918 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 searchItem + * + * Perform a search from multiple item types + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $item_types A comma-separated string array. The type of items to perform the search from. Defaults to all. (optional) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. (optional) + * @param bool|null $search_for_related_items When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields A comma-separated string array. Supports including optional fields in the results which are not provided by default. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ItemSearchResponse + */ + public function searchItem($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) + { + list($response) = $this->searchItemWithHttpInfo($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit); + return $response; + } + + /** + * Operation searchItemWithHttpInfo + * + * Perform a search from multiple item types + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $item_types A comma-separated string array. The type of items to perform the search from. Defaults to all. (optional) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. (optional) + * @param bool|null $search_for_related_items When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields A comma-separated string array. Supports including optional fields in the results which are not provided by default. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ItemSearchResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchItemWithHttpInfo($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) + { + $request = $this->searchItemRequest($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchItemRequest($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ItemSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ItemSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ItemSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ItemSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ItemSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchItemAsync + * + * Perform a search from multiple item types + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $item_types A comma-separated string array. The type of items to perform the search from. Defaults to all. (optional) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. (optional) + * @param bool|null $search_for_related_items When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields A comma-separated string array. Supports including optional fields in the results which are not provided by default. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchItemAsync($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + return $this->searchItemAsyncWithHttpInfo($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchItemAsyncWithHttpInfo + * + * Perform a search from multiple item types + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $item_types A comma-separated string array. The type of items to perform the search from. Defaults to all. (optional) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. (optional) + * @param bool|null $search_for_related_items When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields A comma-separated string array. Supports including optional fields in the results which are not provided by default. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchItemAsyncWithHttpInfo($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ItemSearchResponse'; + $request = $this->searchItemRequest($term, $item_types, $fields, $search_for_related_items, $exact_match, $include_fields, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchItem' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $item_types A comma-separated string array. The type of items to perform the search from. Defaults to all. (optional) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:<br> <table> <tr><th><b>Item type</b></th><th><b>Field</b></th></tr> <tr><td>Deal</td><td>`custom_fields`, `notes`, `title`</td></tr> <tr><td>Person</td><td>`custom_fields`, `email`, `name`, `notes`, `phone`</td></tr> <tr><td>Organization</td><td>`address`, `custom_fields`, `name`, `notes`</td></tr> <tr><td>Product</td><td>`code`, `custom_fields`, `name`</td></tr> <tr><td>Lead</td><td>`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`</td></tr> <tr><td>File</td><td>`name`</td></tr> <tr><td>Mail attachment</td><td>`name`</td></tr> <tr><td>Project</td><td> `custom_fields`, `notes`, `title`, `description` </td></tr> </table> <br> When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`. (optional) + * @param bool|null $search_for_related_items When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields A comma-separated string array. Supports including optional fields in the results which are not provided by default. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchItemRequest($term, $item_types = null, $fields = null, $search_for_related_items = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchItem' + ); + } + + $resourcePath = '/itemSearch'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($item_types)) { + $item_types = ObjectSerializer::serializeCollection($item_types, '', true); + } + if ($item_types !== null) { + $queryParams['item_types'] = $item_types; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($fields)) { + $fields = ObjectSerializer::serializeCollection($fields, '', true); + } + if ($fields !== null) { + $queryParams['fields'] = $fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($search_for_related_items)) { + $search_for_related_items = ObjectSerializer::serializeCollection($search_for_related_items, '', true); + } + if ($search_for_related_items !== null) { + $queryParams['search_for_related_items'] = $search_for_related_items; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_fields)) { + $include_fields = ObjectSerializer::serializeCollection($include_fields, '', true); + } + if ($include_fields !== null) { + $queryParams['include_fields'] = $include_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchItemByField + * + * Perform a search using a specific field from an item type + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string $field_type The type of the field to perform the search from (required) + * @param string $field_key The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). (required) + * @param bool|false $exact_match When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. (optional, default to false) + * @param bool|null $return_item_ids Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. (optional) + * @param int|null $start Pagination start (optional) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ItemSearchFieldResponse + */ + public function searchItemByField($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null) + { + list($response) = $this->searchItemByFieldWithHttpInfo($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit); + return $response; + } + + /** + * Operation searchItemByFieldWithHttpInfo + * + * Perform a search using a specific field from an item type + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string $field_type The type of the field to perform the search from (required) + * @param string $field_key The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). (required) + * @param bool|false $exact_match When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. (optional, default to false) + * @param bool|null $return_item_ids Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. (optional) + * @param int|null $start Pagination start (optional) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ItemSearchFieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchItemByFieldWithHttpInfo($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null) + { + $request = $this->searchItemByFieldRequest($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchItemByFieldRequest($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ItemSearchFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ItemSearchFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ItemSearchFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ItemSearchFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ItemSearchFieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchItemByFieldAsync + * + * Perform a search using a specific field from an item type + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string $field_type The type of the field to perform the search from (required) + * @param string $field_key The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). (required) + * @param bool|false $exact_match When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. (optional, default to false) + * @param bool|null $return_item_ids Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. (optional) + * @param int|null $start Pagination start (optional) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchItemByFieldAsync($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null): PromiseInterface + { + return $this->searchItemByFieldAsyncWithHttpInfo($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchItemByFieldAsyncWithHttpInfo + * + * Perform a search using a specific field from an item type + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string $field_type The type of the field to perform the search from (required) + * @param string $field_key The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). (required) + * @param bool|false $exact_match When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. (optional, default to false) + * @param bool|null $return_item_ids Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. (optional) + * @param int|null $start Pagination start (optional) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchItemByFieldAsyncWithHttpInfo($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ItemSearchFieldResponse'; + $request = $this->searchItemByFieldRequest($term, $field_type, $field_key, $exact_match, $return_item_ids, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchItemByField' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string $field_type The type of the field to perform the search from (required) + * @param string $field_key The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). (required) + * @param bool|false $exact_match When enabled, only full exact matches against the given term are returned. The search <b>is</b> case sensitive. (optional, default to false) + * @param bool|null $return_item_ids Whether to return the IDs of the matching items or not. When not set or set to `0` or `false`, only distinct values of the searched field are returned. When set to `1` or `true`, the ID of each found item is returned. (optional) + * @param int|null $start Pagination start (optional) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchItemByFieldRequest($term, $field_type, $field_key, $exact_match = false, $return_item_ids = null, $start = null, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchItemByField' + ); + } + // verify the required parameter 'field_type' is set + /* @phpstan-ignore-next-line */ + if ($field_type === null || (is_array($field_type) && count($field_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $field_type when calling searchItemByField' + ); + } + // verify the required parameter 'field_key' is set + /* @phpstan-ignore-next-line */ + if ($field_key === null || (is_array($field_key) && count($field_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $field_key when calling searchItemByField' + ); + } + + $resourcePath = '/itemSearch/field'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($field_type)) { + $field_type = ObjectSerializer::serializeCollection($field_type, '', true); + } + if ($field_type !== null) { + $queryParams['field_type'] = $field_type; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($field_key)) { + $field_key = ObjectSerializer::serializeCollection($field_key, '', true); + } + if ($field_key !== null) { + $queryParams['field_key'] = $field_key; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($return_item_ids)) { + $return_item_ids = ObjectSerializer::serializeCollection($return_item_ids, '', true); + } + if ($return_item_ids !== null) { + $queryParams['return_item_ids'] = $return_item_ids; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/LeadLabelsApi.php b/lib/Api/LeadLabelsApi.php new file mode 100644 index 00000000..fdae9e53 --- /dev/null +++ b/lib/Api/LeadLabelsApi.php @@ -0,0 +1,1351 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addLeadLabel + * + * Add a lead label + * + * @param \Pipedrive\Model\AddLeadLabelRequest|null $add_lead_label_request add_lead_label_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddOrUpdateLeadLabelResponse200 + */ + public function addLeadLabel($add_lead_label_request = null) + { + list($response) = $this->addLeadLabelWithHttpInfo($add_lead_label_request); + return $response; + } + + /** + * Operation addLeadLabelWithHttpInfo + * + * Add a lead label + * + * @param \Pipedrive\Model\AddLeadLabelRequest|null $add_lead_label_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddOrUpdateLeadLabelResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function addLeadLabelWithHttpInfo($add_lead_label_request = null) + { + $request = $this->addLeadLabelRequest($add_lead_label_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addLeadLabelRequest($add_lead_label_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateLeadLabelResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateLeadLabelResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addLeadLabelAsync + * + * Add a lead label + * + * @param \Pipedrive\Model\AddLeadLabelRequest|null $add_lead_label_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addLeadLabelAsync($add_lead_label_request = null): PromiseInterface + { + return $this->addLeadLabelAsyncWithHttpInfo($add_lead_label_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addLeadLabelAsyncWithHttpInfo + * + * Add a lead label + * + * @param \Pipedrive\Model\AddLeadLabelRequest|null $add_lead_label_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addLeadLabelAsyncWithHttpInfo($add_lead_label_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200'; + $request = $this->addLeadLabelRequest($add_lead_label_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addLeadLabel' + * + * @param \Pipedrive\Model\AddLeadLabelRequest|null $add_lead_label_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addLeadLabelRequest($add_lead_label_request = null): Request + { + + $resourcePath = '/leadLabels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_lead_label_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_lead_label_request)); + } else { + $httpBody = $add_lead_label_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLeadLabel + * + * Delete a lead label + * + * @param string $id The ID of the lead label (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\LeadIdResponse200|\Pipedrive\Model\LeadResponse404 + */ + public function deleteLeadLabel($id) + { + list($response) = $this->deleteLeadLabelWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteLeadLabelWithHttpInfo + * + * Delete a lead label + * + * @param string $id The ID of the lead label (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\LeadIdResponse200|\Pipedrive\Model\LeadResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLeadLabelWithHttpInfo($id) + { + $request = $this->deleteLeadLabelRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteLeadLabelRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadIdResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadIdResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadIdResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadIdResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadIdResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteLeadLabelAsync + * + * Delete a lead label + * + * @param string $id The ID of the lead label (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteLeadLabelAsync($id): PromiseInterface + { + return $this->deleteLeadLabelAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLeadLabelAsyncWithHttpInfo + * + * Delete a lead label + * + * @param string $id The ID of the lead label (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteLeadLabelAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\LeadIdResponse200'; + $request = $this->deleteLeadLabelRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLeadLabel' + * + * @param string $id The ID of the lead label (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteLeadLabelRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteLeadLabel' + ); + } + + $resourcePath = '/leadLabels/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeadLabels + * + * Get all lead labels + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetLeadLabelsResponse200 + */ + public function getLeadLabels() + { + list($response) = $this->getLeadLabelsWithHttpInfo(); + return $response; + } + + /** + * Operation getLeadLabelsWithHttpInfo + * + * Get all lead labels + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetLeadLabelsResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadLabelsWithHttpInfo() + { + $request = $this->getLeadLabelsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadLabelsRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetLeadLabelsResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetLeadLabelsResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetLeadLabelsResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetLeadLabelsResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetLeadLabelsResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadLabelsAsync + * + * Get all lead labels + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadLabelsAsync(): PromiseInterface + { + return $this->getLeadLabelsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadLabelsAsyncWithHttpInfo + * + * Get all lead labels + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadLabelsAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetLeadLabelsResponse200'; + $request = $this->getLeadLabelsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeadLabels' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadLabelsRequest(): Request + { + + $resourcePath = '/leadLabels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLeadLabel + * + * Update a lead label + * + * @param string $id The ID of the lead label (required) + * @param \Pipedrive\Model\UpdateLeadLabelRequest|null $update_lead_label_request update_lead_label_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddOrUpdateLeadLabelResponse200|\Pipedrive\Model\LeadResponse404 + */ + public function updateLeadLabel($id, $update_lead_label_request = null) + { + list($response) = $this->updateLeadLabelWithHttpInfo($id, $update_lead_label_request); + return $response; + } + + /** + * Operation updateLeadLabelWithHttpInfo + * + * Update a lead label + * + * @param string $id The ID of the lead label (required) + * @param \Pipedrive\Model\UpdateLeadLabelRequest|null $update_lead_label_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddOrUpdateLeadLabelResponse200|\Pipedrive\Model\LeadResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLeadLabelWithHttpInfo($id, $update_lead_label_request = null) + { + $request = $this->updateLeadLabelRequest($id, $update_lead_label_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateLeadLabelRequest($id, $update_lead_label_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateLeadLabelResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddOrUpdateLeadLabelResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLeadLabelAsync + * + * Update a lead label + * + * @param string $id The ID of the lead label (required) + * @param \Pipedrive\Model\UpdateLeadLabelRequest|null $update_lead_label_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateLeadLabelAsync($id, $update_lead_label_request = null): PromiseInterface + { + return $this->updateLeadLabelAsyncWithHttpInfo($id, $update_lead_label_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLeadLabelAsyncWithHttpInfo + * + * Update a lead label + * + * @param string $id The ID of the lead label (required) + * @param \Pipedrive\Model\UpdateLeadLabelRequest|null $update_lead_label_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateLeadLabelAsyncWithHttpInfo($id, $update_lead_label_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddOrUpdateLeadLabelResponse200'; + $request = $this->updateLeadLabelRequest($id, $update_lead_label_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLeadLabel' + * + * @param string $id The ID of the lead label (required) + * @param \Pipedrive\Model\UpdateLeadLabelRequest|null $update_lead_label_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateLeadLabelRequest($id, $update_lead_label_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateLeadLabel' + ); + } + + $resourcePath = '/leadLabels/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_lead_label_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_lead_label_request)); + } else { + $httpBody = $update_lead_label_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $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/lib/Api/LeadSourcesApi.php b/lib/Api/LeadSourcesApi.php new file mode 100644 index 00000000..cf843590 --- /dev/null +++ b/lib/Api/LeadSourcesApi.php @@ -0,0 +1,419 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getLeadSources + * + * Get all lead sources + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetLeadSourcesResponse200 + */ + public function getLeadSources() + { + list($response) = $this->getLeadSourcesWithHttpInfo(); + return $response; + } + + /** + * Operation getLeadSourcesWithHttpInfo + * + * Get all lead sources + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetLeadSourcesResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadSourcesWithHttpInfo() + { + $request = $this->getLeadSourcesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadSourcesRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetLeadSourcesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetLeadSourcesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetLeadSourcesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetLeadSourcesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetLeadSourcesResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadSourcesAsync + * + * Get all lead sources + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadSourcesAsync(): PromiseInterface + { + return $this->getLeadSourcesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadSourcesAsyncWithHttpInfo + * + * Get all lead sources + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadSourcesAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetLeadSourcesResponse200'; + $request = $this->getLeadSourcesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeadSources' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadSourcesRequest(): Request + { + + $resourcePath = '/leadSources'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/LeadsApi.php b/lib/Api/LeadsApi.php new file mode 100644 index 00000000..b40b6c2a --- /dev/null +++ b/lib/Api/LeadsApi.php @@ -0,0 +1,2447 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addLead + * + * Add a lead + * + * @param \Pipedrive\Model\AddLeadRequest|null $add_lead_request add_lead_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OneLeadResponse200 + */ + public function addLead($add_lead_request = null) + { + list($response) = $this->addLeadWithHttpInfo($add_lead_request); + return $response; + } + + /** + * Operation addLeadWithHttpInfo + * + * Add a lead + * + * @param \Pipedrive\Model\AddLeadRequest|null $add_lead_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OneLeadResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function addLeadWithHttpInfo($add_lead_request = null) + { + $request = $this->addLeadRequest($add_lead_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addLeadRequest($add_lead_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OneLeadResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OneLeadResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OneLeadResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OneLeadResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OneLeadResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addLeadAsync + * + * Add a lead + * + * @param \Pipedrive\Model\AddLeadRequest|null $add_lead_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addLeadAsync($add_lead_request = null): PromiseInterface + { + return $this->addLeadAsyncWithHttpInfo($add_lead_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addLeadAsyncWithHttpInfo + * + * Add a lead + * + * @param \Pipedrive\Model\AddLeadRequest|null $add_lead_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addLeadAsyncWithHttpInfo($add_lead_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OneLeadResponse200'; + $request = $this->addLeadRequest($add_lead_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addLead' + * + * @param \Pipedrive\Model\AddLeadRequest|null $add_lead_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addLeadRequest($add_lead_request = null): Request + { + + $resourcePath = '/leads'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_lead_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_lead_request)); + } else { + $httpBody = $add_lead_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteLead + * + * Delete a lead + * + * @param string $id The ID of the lead (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\LeadIdResponse200|\Pipedrive\Model\LeadResponse404 + */ + public function deleteLead($id) + { + list($response) = $this->deleteLeadWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteLeadWithHttpInfo + * + * Delete a lead + * + * @param string $id The ID of the lead (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\LeadIdResponse200|\Pipedrive\Model\LeadResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteLeadWithHttpInfo($id) + { + $request = $this->deleteLeadRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteLeadRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadIdResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadIdResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadIdResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadIdResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadIdResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteLeadAsync + * + * Delete a lead + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteLeadAsync($id): PromiseInterface + { + return $this->deleteLeadAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteLeadAsyncWithHttpInfo + * + * Delete a lead + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteLeadAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\LeadIdResponse200'; + $request = $this->deleteLeadRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteLead' + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteLeadRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteLead' + ); + } + + $resourcePath = '/leads/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLead + * + * Get one lead + * + * @param string $id The ID of the lead (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OneLeadResponse200|\Pipedrive\Model\LeadResponse404 + */ + public function getLead($id) + { + list($response) = $this->getLeadWithHttpInfo($id); + return $response; + } + + /** + * Operation getLeadWithHttpInfo + * + * Get one lead + * + * @param string $id The ID of the lead (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OneLeadResponse200|\Pipedrive\Model\LeadResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadWithHttpInfo($id) + { + $request = $this->getLeadRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OneLeadResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OneLeadResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OneLeadResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OneLeadResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OneLeadResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadAsync + * + * Get one lead + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadAsync($id): PromiseInterface + { + return $this->getLeadAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadAsyncWithHttpInfo + * + * Get one lead + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\OneLeadResponse200'; + $request = $this->getLeadRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLead' + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getLead' + ); + } + + $resourcePath = '/leads/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeadUsers + * + * List permitted users + * + * @param string $id The ID of the lead (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserIDs + */ + public function getLeadUsers($id) + { + list($response) = $this->getLeadUsersWithHttpInfo($id); + return $response; + } + + /** + * Operation getLeadUsersWithHttpInfo + * + * List permitted users + * + * @param string $id The ID of the lead (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserIDs, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadUsersWithHttpInfo($id) + { + $request = $this->getLeadUsersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadUsersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserIDs', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadUsersAsync + * + * List permitted users + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadUsersAsync($id): PromiseInterface + { + return $this->getLeadUsersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadUsersAsyncWithHttpInfo + * + * List permitted users + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadUsersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserIDs'; + $request = $this->getLeadUsersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeadUsers' + * + * @param string $id The ID of the lead (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadUsersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getLeadUsers' + ); + } + + $resourcePath = '/leads/{id}/permittedUsers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeads + * + * Get all leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetLeadsResponse200 + */ + public function getLeads($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) + { + list($response) = $this->getLeadsWithHttpInfo($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + return $response; + } + + /** + * Operation getLeadsWithHttpInfo + * + * Get all leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetLeadsResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeadsWithHttpInfo($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null) + { + $request = $this->getLeadsRequest($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getLeadsRequest($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetLeadsResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetLeadsResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetLeadsResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetLeadsResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetLeadsResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getLeadsAsync + * + * Get all leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadsAsync($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface + { + return $this->getLeadsAsyncWithHttpInfo($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getLeadsAsyncWithHttpInfo + * + * Get all leads + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetLeadsResponse200'; + $request = $this->getLeadsRequest($limit, $start, $archived_status, $owner_id, $person_id, $organization_id, $filter_id, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeads' + * + * @param int|null $limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. (optional) + * @param int|null $start For pagination, the position that represents the first result for the page (optional) + * @param string|null $archived_status Filtering based on the archived status of a lead. If not provided, `All` is used. (optional) + * @param int|null $owner_id If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. (optional) + * @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional) + * @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getLeadsRequest($limit = null, $start = null, $archived_status = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): Request + { + + $resourcePath = '/leads'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($archived_status)) { + $archived_status = ObjectSerializer::serializeCollection($archived_status, '', true); + } + if ($archived_status !== null) { + $queryParams['archived_status'] = $archived_status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($owner_id)) { + $owner_id = ObjectSerializer::serializeCollection($owner_id, '', true); + } + if ($owner_id !== null) { + $queryParams['owner_id'] = $owner_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($organization_id)) { + $organization_id = ObjectSerializer::serializeCollection($organization_id, '', true); + } + if ($organization_id !== null) { + $queryParams['organization_id'] = $organization_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchLeads + * + * Search leads + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\LeadSearchResponse + */ + public function searchLeads($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null) + { + list($response) = $this->searchLeadsWithHttpInfo($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit); + return $response; + } + + /** + * Operation searchLeadsWithHttpInfo + * + * Search leads + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\LeadSearchResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchLeadsWithHttpInfo($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null) + { + $request = $this->searchLeadsRequest($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchLeadsRequest($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchLeadsAsync + * + * Search leads + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchLeadsAsync($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + return $this->searchLeadsAsyncWithHttpInfo($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchLeadsAsyncWithHttpInfo + * + * Search leads + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchLeadsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\LeadSearchResponse'; + $request = $this->searchLeadsRequest($term, $fields, $exact_match, $person_id, $organization_id, $include_fields, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchLeads' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $person_id Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. (optional) + * @param int|null $organization_id Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchLeadsRequest($term, $fields = null, $exact_match = null, $person_id = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchLeads' + ); + } + + $resourcePath = '/leads/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($fields)) { + $fields = ObjectSerializer::serializeCollection($fields, '', true); + } + if ($fields !== null) { + $queryParams['fields'] = $fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($organization_id)) { + $organization_id = ObjectSerializer::serializeCollection($organization_id, '', true); + } + if ($organization_id !== null) { + $queryParams['organization_id'] = $organization_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_fields)) { + $include_fields = ObjectSerializer::serializeCollection($include_fields, '', true); + } + if ($include_fields !== null) { + $queryParams['include_fields'] = $include_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateLead + * + * Update a lead + * + * @param string $id The ID of the lead (required) + * @param \Pipedrive\Model\UpdateLeadRequest|null $update_lead_request update_lead_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OneLeadResponse200|\Pipedrive\Model\LeadResponse404 + */ + public function updateLead($id, $update_lead_request = null) + { + list($response) = $this->updateLeadWithHttpInfo($id, $update_lead_request); + return $response; + } + + /** + * Operation updateLeadWithHttpInfo + * + * Update a lead + * + * @param string $id The ID of the lead (required) + * @param \Pipedrive\Model\UpdateLeadRequest|null $update_lead_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OneLeadResponse200|\Pipedrive\Model\LeadResponse404, HTTP status code, HTTP response headers (array of strings) + */ + public function updateLeadWithHttpInfo($id, $update_lead_request = null) + { + $request = $this->updateLeadRequest($id, $update_lead_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateLeadRequest($id, $update_lead_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OneLeadResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OneLeadResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\LeadResponse404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\LeadResponse404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OneLeadResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OneLeadResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OneLeadResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\LeadResponse404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateLeadAsync + * + * Update a lead + * + * @param string $id The ID of the lead (required) + * @param \Pipedrive\Model\UpdateLeadRequest|null $update_lead_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateLeadAsync($id, $update_lead_request = null): PromiseInterface + { + return $this->updateLeadAsyncWithHttpInfo($id, $update_lead_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateLeadAsyncWithHttpInfo + * + * Update a lead + * + * @param string $id The ID of the lead (required) + * @param \Pipedrive\Model\UpdateLeadRequest|null $update_lead_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateLeadAsyncWithHttpInfo($id, $update_lead_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OneLeadResponse200'; + $request = $this->updateLeadRequest($id, $update_lead_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateLead' + * + * @param string $id The ID of the lead (required) + * @param \Pipedrive\Model\UpdateLeadRequest|null $update_lead_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateLeadRequest($id, $update_lead_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateLead' + ); + } + + $resourcePath = '/leads/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_lead_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_lead_request)); + } else { + $httpBody = $update_lead_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PATCH', + $this->config->getHost() . $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/lib/Api/LegacyTeamsApi.php b/lib/Api/LegacyTeamsApi.php new file mode 100644 index 00000000..f356f82d --- /dev/null +++ b/lib/Api/LegacyTeamsApi.php @@ -0,0 +1,2809 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addTeam + * + * Add a new team + * + * @param \Pipedrive\Model\CreateTeam|null $create_team create_team (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Team|\Pipedrive\Model\FailResponse + * @deprecated + */ + public function addTeam($create_team = null) + { + list($response) = $this->addTeamWithHttpInfo($create_team); + return $response; + } + + /** + * Operation addTeamWithHttpInfo + * + * Add a new team + * + * @param \Pipedrive\Model\CreateTeam|null $create_team (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Team|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function addTeamWithHttpInfo($create_team = null) + { + $request = $this->addTeamRequest($create_team); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addTeamRequest($create_team); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Team' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Team', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Team' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Team', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Team', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addTeamAsync + * + * Add a new team + * + * @param \Pipedrive\Model\CreateTeam|null $create_team (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function addTeamAsync($create_team = null): PromiseInterface + { + return $this->addTeamAsyncWithHttpInfo($create_team) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addTeamAsyncWithHttpInfo + * + * Add a new team + * + * @param \Pipedrive\Model\CreateTeam|null $create_team (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function addTeamAsyncWithHttpInfo($create_team = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Team'; + $request = $this->addTeamRequest($create_team); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addTeam' + * + * @param \Pipedrive\Model\CreateTeam|null $create_team (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function addTeamRequest($create_team = null): Request + { + + $resourcePath = '/legacyTeams'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($create_team)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_team)); + } else { + $httpBody = $create_team; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addTeamUser + * + * Add users to a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\AddTeamUserRequest|null $add_team_user_request add_team_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse + * @deprecated + */ + public function addTeamUser($id, $add_team_user_request = null) + { + list($response) = $this->addTeamUserWithHttpInfo($id, $add_team_user_request); + return $response; + } + + /** + * Operation addTeamUserWithHttpInfo + * + * Add users to a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\AddTeamUserRequest|null $add_team_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function addTeamUserWithHttpInfo($id, $add_team_user_request = null) + { + $request = $this->addTeamUserRequest($id, $add_team_user_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addTeamUserRequest($id, $add_team_user_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserIDs', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addTeamUserAsync + * + * Add users to a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\AddTeamUserRequest|null $add_team_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function addTeamUserAsync($id, $add_team_user_request = null): PromiseInterface + { + return $this->addTeamUserAsyncWithHttpInfo($id, $add_team_user_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addTeamUserAsyncWithHttpInfo + * + * Add users to a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\AddTeamUserRequest|null $add_team_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function addTeamUserAsyncWithHttpInfo($id, $add_team_user_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserIDs'; + $request = $this->addTeamUserRequest($id, $add_team_user_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addTeamUser' + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\AddTeamUserRequest|null $add_team_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function addTeamUserRequest($id, $add_team_user_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addTeamUser' + ); + } + + $resourcePath = '/legacyTeams/{id}/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_team_user_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_team_user_request)); + } else { + $httpBody = $add_team_user_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteTeamUser + * + * Delete users from a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\DeleteTeamUserRequest|null $delete_team_user_request delete_team_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse + * @deprecated + */ + public function deleteTeamUser($id, $delete_team_user_request = null) + { + list($response) = $this->deleteTeamUserWithHttpInfo($id, $delete_team_user_request); + return $response; + } + + /** + * Operation deleteTeamUserWithHttpInfo + * + * Delete users from a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\DeleteTeamUserRequest|null $delete_team_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function deleteTeamUserWithHttpInfo($id, $delete_team_user_request = null) + { + $request = $this->deleteTeamUserRequest($id, $delete_team_user_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteTeamUserRequest($id, $delete_team_user_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserIDs', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteTeamUserAsync + * + * Delete users from a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\DeleteTeamUserRequest|null $delete_team_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function deleteTeamUserAsync($id, $delete_team_user_request = null): PromiseInterface + { + return $this->deleteTeamUserAsyncWithHttpInfo($id, $delete_team_user_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteTeamUserAsyncWithHttpInfo + * + * Delete users from a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\DeleteTeamUserRequest|null $delete_team_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function deleteTeamUserAsyncWithHttpInfo($id, $delete_team_user_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserIDs'; + $request = $this->deleteTeamUserRequest($id, $delete_team_user_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteTeamUser' + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\DeleteTeamUserRequest|null $delete_team_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function deleteTeamUserRequest($id, $delete_team_user_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteTeamUser' + ); + } + + $resourcePath = '/legacyTeams/{id}/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($delete_team_user_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_team_user_request)); + } else { + $httpBody = $delete_team_user_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTeam + * + * Get a single team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Team|\Pipedrive\Model\FailResponse + * @deprecated + */ + public function getTeam($id, $skip_users = null) + { + list($response) = $this->getTeamWithHttpInfo($id, $skip_users); + return $response; + } + + /** + * Operation getTeamWithHttpInfo + * + * Get a single team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Team|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getTeamWithHttpInfo($id, $skip_users = null) + { + $request = $this->getTeamRequest($id, $skip_users); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getTeamRequest($id, $skip_users); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Team' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Team', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Team' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Team', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Team', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTeamAsync + * + * Get a single team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getTeamAsync($id, $skip_users = null): PromiseInterface + { + return $this->getTeamAsyncWithHttpInfo($id, $skip_users) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTeamAsyncWithHttpInfo + * + * Get a single team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getTeamAsyncWithHttpInfo($id, $skip_users = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Team'; + $request = $this->getTeamRequest($id, $skip_users); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTeam' + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getTeamRequest($id, $skip_users = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTeam' + ); + } + + $resourcePath = '/legacyTeams/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($skip_users)) { + $skip_users = ObjectSerializer::serializeCollection($skip_users, '', true); + } + if ($skip_users !== null) { + $queryParams['skip_users'] = $skip_users; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTeamUsers + * + * Get all users in a team + * + * @param int $id The ID of the team (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse + * @deprecated + */ + public function getTeamUsers($id) + { + list($response) = $this->getTeamUsersWithHttpInfo($id); + return $response; + } + + /** + * Operation getTeamUsersWithHttpInfo + * + * Get all users in a team + * + * @param int $id The ID of the team (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getTeamUsersWithHttpInfo($id) + { + $request = $this->getTeamUsersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getTeamUsersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserIDs', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTeamUsersAsync + * + * Get all users in a team + * + * @param int $id The ID of the team (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getTeamUsersAsync($id): PromiseInterface + { + return $this->getTeamUsersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTeamUsersAsyncWithHttpInfo + * + * Get all users in a team + * + * @param int $id The ID of the team (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getTeamUsersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserIDs'; + $request = $this->getTeamUsersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTeamUsers' + * + * @param int $id The ID of the team (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getTeamUsersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getTeamUsers' + ); + } + + $resourcePath = '/legacyTeams/{id}/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTeams + * + * Get all teams + * + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Teams + * @deprecated + */ + public function getTeams($order_by = 'id', $skip_users = null) + { + list($response) = $this->getTeamsWithHttpInfo($order_by, $skip_users); + return $response; + } + + /** + * Operation getTeamsWithHttpInfo + * + * Get all teams + * + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Teams, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getTeamsWithHttpInfo($order_by = 'id', $skip_users = null) + { + $request = $this->getTeamsRequest($order_by, $skip_users); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getTeamsRequest($order_by, $skip_users); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Teams' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Teams', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Teams' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Teams', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Teams', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getTeamsAsync + * + * Get all teams + * + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getTeamsAsync($order_by = 'id', $skip_users = null): PromiseInterface + { + return $this->getTeamsAsyncWithHttpInfo($order_by, $skip_users) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getTeamsAsyncWithHttpInfo + * + * Get all teams + * + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getTeamsAsyncWithHttpInfo($order_by = 'id', $skip_users = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Teams'; + $request = $this->getTeamsRequest($order_by, $skip_users); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTeams' + * + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getTeamsRequest($order_by = 'id', $skip_users = null): Request + { + + $resourcePath = '/legacyTeams'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($order_by)) { + $order_by = ObjectSerializer::serializeCollection($order_by, '', true); + } + if ($order_by !== null) { + $queryParams['order_by'] = $order_by; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($skip_users)) { + $skip_users = ObjectSerializer::serializeCollection($skip_users, '', true); + } + if ($skip_users !== null) { + $queryParams['skip_users'] = $skip_users; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserTeams + * + * Get all teams of a user + * + * @param int $id The ID of the user (required) + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Teams + * @deprecated + */ + public function getUserTeams($id, $order_by = 'id', $skip_users = null) + { + list($response) = $this->getUserTeamsWithHttpInfo($id, $order_by, $skip_users); + return $response; + } + + /** + * Operation getUserTeamsWithHttpInfo + * + * Get all teams of a user + * + * @param int $id The ID of the user (required) + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Teams, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getUserTeamsWithHttpInfo($id, $order_by = 'id', $skip_users = null) + { + $request = $this->getUserTeamsRequest($id, $order_by, $skip_users); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserTeamsRequest($id, $order_by, $skip_users); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Teams' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Teams', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Teams' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Teams', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Teams', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserTeamsAsync + * + * Get all teams of a user + * + * @param int $id The ID of the user (required) + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getUserTeamsAsync($id, $order_by = 'id', $skip_users = null): PromiseInterface + { + return $this->getUserTeamsAsyncWithHttpInfo($id, $order_by, $skip_users) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserTeamsAsyncWithHttpInfo + * + * Get all teams of a user + * + * @param int $id The ID of the user (required) + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function getUserTeamsAsyncWithHttpInfo($id, $order_by = 'id', $skip_users = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Teams'; + $request = $this->getUserTeamsRequest($id, $order_by, $skip_users); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserTeams' + * + * @param int $id The ID of the user (required) + * @param string|'id' $order_by The field name to sort returned teams by (optional, default to 'id') + * @param \Pipedrive\Model\NumberBooleanDefault0|null $skip_users When enabled, the teams will not include IDs of member users (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function getUserTeamsRequest($id, $order_by = 'id', $skip_users = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUserTeams' + ); + } + + $resourcePath = '/legacyTeams/user/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($order_by)) { + $order_by = ObjectSerializer::serializeCollection($order_by, '', true); + } + if ($order_by !== null) { + $queryParams['order_by'] = $order_by; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($skip_users)) { + $skip_users = ObjectSerializer::serializeCollection($skip_users, '', true); + } + if ($skip_users !== null) { + $queryParams['skip_users'] = $skip_users; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateTeam + * + * Update a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\UpdateTeam|null $update_team update_team (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Team|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse + * @deprecated + */ + public function updateTeam($id, $update_team = null) + { + list($response) = $this->updateTeamWithHttpInfo($id, $update_team); + return $response; + } + + /** + * Operation updateTeamWithHttpInfo + * + * Update a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\UpdateTeam|null $update_team (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Team|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function updateTeamWithHttpInfo($id, $update_team = null) + { + $request = $this->updateTeamRequest($id, $update_team); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateTeamRequest($id, $update_team); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Team' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Team', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Team' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Team', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Team', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateTeamAsync + * + * Update a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\UpdateTeam|null $update_team (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function updateTeamAsync($id, $update_team = null): PromiseInterface + { + return $this->updateTeamAsyncWithHttpInfo($id, $update_team) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateTeamAsyncWithHttpInfo + * + * Update a team + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\UpdateTeam|null $update_team (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + * @deprecated + */ + public function updateTeamAsyncWithHttpInfo($id, $update_team = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Team'; + $request = $this->updateTeamRequest($id, $update_team); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateTeam' + * + * @param int $id The ID of the team (required) + * @param \Pipedrive\Model\UpdateTeam|null $update_team (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + * @deprecated + */ + public function updateTeamRequest($id, $update_team = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateTeam' + ); + } + + $resourcePath = '/legacyTeams/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_team)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_team)); + } else { + $httpBody = $update_team; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/MailboxApi.php b/lib/Api/MailboxApi.php new file mode 100644 index 00000000..09952715 --- /dev/null +++ b/lib/Api/MailboxApi.php @@ -0,0 +1,2003 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 deleteMailThread + * + * Delete mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MailThreadDelete + */ + public function deleteMailThread($id) + { + list($response) = $this->deleteMailThreadWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteMailThreadWithHttpInfo + * + * Delete mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MailThreadDelete, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteMailThreadWithHttpInfo($id) + { + $request = $this->deleteMailThreadRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteMailThreadRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadDelete' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadDelete', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadDelete' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadDelete', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MailThreadDelete', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteMailThreadAsync + * + * Delete mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteMailThreadAsync($id): PromiseInterface + { + return $this->deleteMailThreadAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteMailThreadAsyncWithHttpInfo + * + * Delete mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteMailThreadAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\MailThreadDelete'; + $request = $this->deleteMailThreadRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteMailThread' + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteMailThreadRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteMailThread' + ); + } + + $resourcePath = '/mailbox/mailThreads/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMailMessage + * + * Get one mail message + * + * @param int $id The ID of the mail message to fetch (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $include_body Whether to include the full message body or not. `0` = Don't include, `1` = Include (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MailMessage + */ + public function getMailMessage($id, $include_body = null) + { + list($response) = $this->getMailMessageWithHttpInfo($id, $include_body); + return $response; + } + + /** + * Operation getMailMessageWithHttpInfo + * + * Get one mail message + * + * @param int $id The ID of the mail message to fetch (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $include_body Whether to include the full message body or not. `0` = Don't include, `1` = Include (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MailMessage, HTTP status code, HTTP response headers (array of strings) + */ + public function getMailMessageWithHttpInfo($id, $include_body = null) + { + $request = $this->getMailMessageRequest($id, $include_body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getMailMessageRequest($id, $include_body); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailMessage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailMessage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailMessage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailMessage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MailMessage', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMailMessageAsync + * + * Get one mail message + * + * @param int $id The ID of the mail message to fetch (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $include_body Whether to include the full message body or not. `0` = Don't include, `1` = Include (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailMessageAsync($id, $include_body = null): PromiseInterface + { + return $this->getMailMessageAsyncWithHttpInfo($id, $include_body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMailMessageAsyncWithHttpInfo + * + * Get one mail message + * + * @param int $id The ID of the mail message to fetch (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $include_body Whether to include the full message body or not. `0` = Don't include, `1` = Include (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailMessageAsyncWithHttpInfo($id, $include_body = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\MailMessage'; + $request = $this->getMailMessageRequest($id, $include_body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMailMessage' + * + * @param int $id The ID of the mail message to fetch (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $include_body Whether to include the full message body or not. `0` = Don't include, `1` = Include (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getMailMessageRequest($id, $include_body = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMailMessage' + ); + } + + $resourcePath = '/mailbox/mailMessages/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_body)) { + $include_body = ObjectSerializer::serializeCollection($include_body, '', true); + } + if ($include_body !== null) { + $queryParams['include_body'] = $include_body; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMailThread + * + * Get one mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MailThreadOne + */ + public function getMailThread($id) + { + list($response) = $this->getMailThreadWithHttpInfo($id); + return $response; + } + + /** + * Operation getMailThreadWithHttpInfo + * + * Get one mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MailThreadOne, HTTP status code, HTTP response headers (array of strings) + */ + public function getMailThreadWithHttpInfo($id) + { + $request = $this->getMailThreadRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getMailThreadRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadOne' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadOne', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadOne' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadOne', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MailThreadOne', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMailThreadAsync + * + * Get one mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailThreadAsync($id): PromiseInterface + { + return $this->getMailThreadAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMailThreadAsyncWithHttpInfo + * + * Get one mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailThreadAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\MailThreadOne'; + $request = $this->getMailThreadRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMailThread' + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getMailThreadRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMailThread' + ); + } + + $resourcePath = '/mailbox/mailThreads/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMailThreadMessages + * + * Get all mail messages of mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MailThreadMessages + */ + public function getMailThreadMessages($id) + { + list($response) = $this->getMailThreadMessagesWithHttpInfo($id); + return $response; + } + + /** + * Operation getMailThreadMessagesWithHttpInfo + * + * Get all mail messages of mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MailThreadMessages, HTTP status code, HTTP response headers (array of strings) + */ + public function getMailThreadMessagesWithHttpInfo($id) + { + $request = $this->getMailThreadMessagesRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getMailThreadMessagesRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadMessages' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadMessages', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadMessages' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadMessages', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MailThreadMessages', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMailThreadMessagesAsync + * + * Get all mail messages of mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailThreadMessagesAsync($id): PromiseInterface + { + return $this->getMailThreadMessagesAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMailThreadMessagesAsyncWithHttpInfo + * + * Get all mail messages of mail thread + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailThreadMessagesAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\MailThreadMessages'; + $request = $this->getMailThreadMessagesRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMailThreadMessages' + * + * @param int $id The ID of the mail thread (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getMailThreadMessagesRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getMailThreadMessages' + ); + } + + $resourcePath = '/mailbox/mailThreads/{id}/mailMessages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getMailThreads + * + * Get mail threads + * + * @param string $folder The type of folder to fetch (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MailThread + */ + public function getMailThreads($folder, $start = 0, $limit = null) + { + list($response) = $this->getMailThreadsWithHttpInfo($folder, $start, $limit); + return $response; + } + + /** + * Operation getMailThreadsWithHttpInfo + * + * Get mail threads + * + * @param string $folder The type of folder to fetch (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MailThread, HTTP status code, HTTP response headers (array of strings) + */ + public function getMailThreadsWithHttpInfo($folder, $start = 0, $limit = null) + { + $request = $this->getMailThreadsRequest($folder, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getMailThreadsRequest($folder, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThread' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThread', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThread' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThread', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MailThread', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMailThreadsAsync + * + * Get mail threads + * + * @param string $folder The type of folder to fetch (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailThreadsAsync($folder, $start = 0, $limit = null): PromiseInterface + { + return $this->getMailThreadsAsyncWithHttpInfo($folder, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMailThreadsAsyncWithHttpInfo + * + * Get mail threads + * + * @param string $folder The type of folder to fetch (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getMailThreadsAsyncWithHttpInfo($folder, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\MailThread'; + $request = $this->getMailThreadsRequest($folder, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMailThreads' + * + * @param string $folder The type of folder to fetch (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getMailThreadsRequest($folder, $start = 0, $limit = null): Request + { + // verify the required parameter 'folder' is set + /* @phpstan-ignore-next-line */ + if ($folder === null || (is_array($folder) && count($folder) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folder when calling getMailThreads' + ); + } + + $resourcePath = '/mailbox/mailThreads'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($folder)) { + $folder = ObjectSerializer::serializeCollection($folder, '', true); + } + if ($folder !== null) { + $queryParams['folder'] = $folder; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateMailThreadDetails + * + * Update mail thread details + * + * @param int $id The ID of the mail thread (required) + * @param int|null $deal_id The ID of the deal this thread is associated with (optional) + * @param string|null $lead_id The ID of the lead this thread is associated with (optional) + * @param \Pipedrive\Model\NumberBoolean|null $shared_flag Whether this thread is shared with other users in your company (optional) + * @param \Pipedrive\Model\NumberBoolean|null $read_flag Whether this thread is read or unread (optional) + * @param \Pipedrive\Model\NumberBoolean|null $archived_flag Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MailThreadPut + */ + public function updateMailThreadDetails($id, $deal_id = null, $lead_id = null, $shared_flag = null, $read_flag = null, $archived_flag = null) + { + list($response) = $this->updateMailThreadDetailsWithHttpInfo($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag); + return $response; + } + + /** + * Operation updateMailThreadDetailsWithHttpInfo + * + * Update mail thread details + * + * @param int $id The ID of the mail thread (required) + * @param int|null $deal_id The ID of the deal this thread is associated with (optional) + * @param string|null $lead_id The ID of the lead this thread is associated with (optional) + * @param \Pipedrive\Model\NumberBoolean|null $shared_flag Whether this thread is shared with other users in your company (optional) + * @param \Pipedrive\Model\NumberBoolean|null $read_flag Whether this thread is read or unread (optional) + * @param \Pipedrive\Model\NumberBoolean|null $archived_flag Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MailThreadPut, HTTP status code, HTTP response headers (array of strings) + */ + public function updateMailThreadDetailsWithHttpInfo($id, $deal_id = null, $lead_id = null, $shared_flag = null, $read_flag = null, $archived_flag = null) + { + $request = $this->updateMailThreadDetailsRequest($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateMailThreadDetailsRequest($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadPut' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadPut', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MailThreadPut' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MailThreadPut', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MailThreadPut', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateMailThreadDetailsAsync + * + * Update mail thread details + * + * @param int $id The ID of the mail thread (required) + * @param int|null $deal_id The ID of the deal this thread is associated with (optional) + * @param string|null $lead_id The ID of the lead this thread is associated with (optional) + * @param \Pipedrive\Model\NumberBoolean|null $shared_flag Whether this thread is shared with other users in your company (optional) + * @param \Pipedrive\Model\NumberBoolean|null $read_flag Whether this thread is read or unread (optional) + * @param \Pipedrive\Model\NumberBoolean|null $archived_flag Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateMailThreadDetailsAsync($id, $deal_id = null, $lead_id = null, $shared_flag = null, $read_flag = null, $archived_flag = null): PromiseInterface + { + return $this->updateMailThreadDetailsAsyncWithHttpInfo($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateMailThreadDetailsAsyncWithHttpInfo + * + * Update mail thread details + * + * @param int $id The ID of the mail thread (required) + * @param int|null $deal_id The ID of the deal this thread is associated with (optional) + * @param string|null $lead_id The ID of the lead this thread is associated with (optional) + * @param \Pipedrive\Model\NumberBoolean|null $shared_flag Whether this thread is shared with other users in your company (optional) + * @param \Pipedrive\Model\NumberBoolean|null $read_flag Whether this thread is read or unread (optional) + * @param \Pipedrive\Model\NumberBoolean|null $archived_flag Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateMailThreadDetailsAsyncWithHttpInfo($id, $deal_id = null, $lead_id = null, $shared_flag = null, $read_flag = null, $archived_flag = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\MailThreadPut'; + $request = $this->updateMailThreadDetailsRequest($id, $deal_id, $lead_id, $shared_flag, $read_flag, $archived_flag); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateMailThreadDetails' + * + * @param int $id The ID of the mail thread (required) + * @param int|null $deal_id The ID of the deal this thread is associated with (optional) + * @param string|null $lead_id The ID of the lead this thread is associated with (optional) + * @param \Pipedrive\Model\NumberBoolean|null $shared_flag Whether this thread is shared with other users in your company (optional) + * @param \Pipedrive\Model\NumberBoolean|null $read_flag Whether this thread is read or unread (optional) + * @param \Pipedrive\Model\NumberBoolean|null $archived_flag Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateMailThreadDetailsRequest($id, $deal_id = null, $lead_id = null, $shared_flag = null, $read_flag = null, $archived_flag = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateMailThreadDetails' + ); + } + + $resourcePath = '/mailbox/mailThreads/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // form params + if ($deal_id !== null) { + $formParams['deal_id'] = ObjectSerializer::toFormValue($deal_id); + } + // form params + if ($lead_id !== null) { + $formParams['lead_id'] = ObjectSerializer::toFormValue($lead_id); + } + // form params + if ($shared_flag !== null) { + $formParams['shared_flag'] = ObjectSerializer::toFormValue($shared_flag); + } + // form params + if ($read_flag !== null) { + $formParams['read_flag'] = ObjectSerializer::toFormValue($read_flag); + } + // form params + if ($archived_flag !== null) { + $formParams['archived_flag'] = ObjectSerializer::toFormValue($archived_flag); + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/x-www-form-urlencoded'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/NoteFieldsApi.php b/lib/Api/NoteFieldsApi.php new file mode 100644 index 00000000..b34b687b --- /dev/null +++ b/lib/Api/NoteFieldsApi.php @@ -0,0 +1,419 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getNoteFields + * + * Get all note fields + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\NoteFieldsResponse + */ + public function getNoteFields() + { + list($response) = $this->getNoteFieldsWithHttpInfo(); + return $response; + } + + /** + * Operation getNoteFieldsWithHttpInfo + * + * Get all note fields + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\NoteFieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getNoteFieldsWithHttpInfo() + { + $request = $this->getNoteFieldsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getNoteFieldsRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\NoteFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\NoteFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\NoteFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\NoteFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\NoteFieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNoteFieldsAsync + * + * Get all note fields + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNoteFieldsAsync(): PromiseInterface + { + return $this->getNoteFieldsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNoteFieldsAsyncWithHttpInfo + * + * Get all note fields + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNoteFieldsAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\NoteFieldsResponse'; + $request = $this->getNoteFieldsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNoteFields' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getNoteFieldsRequest(): Request + { + + $resourcePath = '/noteFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/NotesApi.php b/lib/Api/NotesApi.php new file mode 100644 index 00000000..44862cad --- /dev/null +++ b/lib/Api/NotesApi.php @@ -0,0 +1,3375 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addNote + * + * Add a note + * + * @param \Pipedrive\Model\AddNoteRequest|null $add_note_request add_note_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostNote + */ + public function addNote($add_note_request = null) + { + list($response) = $this->addNoteWithHttpInfo($add_note_request); + return $response; + } + + /** + * Operation addNoteWithHttpInfo + * + * Add a note + * + * @param \Pipedrive\Model\AddNoteRequest|null $add_note_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostNote, HTTP status code, HTTP response headers (array of strings) + */ + public function addNoteWithHttpInfo($add_note_request = null) + { + $request = $this->addNoteRequest($add_note_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addNoteRequest($add_note_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addNoteAsync + * + * Add a note + * + * @param \Pipedrive\Model\AddNoteRequest|null $add_note_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addNoteAsync($add_note_request = null): PromiseInterface + { + return $this->addNoteAsyncWithHttpInfo($add_note_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addNoteAsyncWithHttpInfo + * + * Add a note + * + * @param \Pipedrive\Model\AddNoteRequest|null $add_note_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addNoteAsyncWithHttpInfo($add_note_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostNote'; + $request = $this->addNoteRequest($add_note_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addNote' + * + * @param \Pipedrive\Model\AddNoteRequest|null $add_note_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addNoteRequest($add_note_request = null): Request + { + + $resourcePath = '/notes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_note_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_note_request)); + } else { + $httpBody = $add_note_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addNoteComment + * + * Add a comment to a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object comment_post_put_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostComment + */ + public function addNoteComment($id, $comment_post_put_object = null) + { + list($response) = $this->addNoteCommentWithHttpInfo($id, $comment_post_put_object); + return $response; + } + + /** + * Operation addNoteCommentWithHttpInfo + * + * Add a comment to a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostComment, HTTP status code, HTTP response headers (array of strings) + */ + public function addNoteCommentWithHttpInfo($id, $comment_post_put_object = null) + { + $request = $this->addNoteCommentRequest($id, $comment_post_put_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addNoteCommentRequest($id, $comment_post_put_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addNoteCommentAsync + * + * Add a comment to a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addNoteCommentAsync($id, $comment_post_put_object = null): PromiseInterface + { + return $this->addNoteCommentAsyncWithHttpInfo($id, $comment_post_put_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addNoteCommentAsyncWithHttpInfo + * + * Add a comment to a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addNoteCommentAsyncWithHttpInfo($id, $comment_post_put_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostComment'; + $request = $this->addNoteCommentRequest($id, $comment_post_put_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addNoteComment' + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addNoteCommentRequest($id, $comment_post_put_object = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addNoteComment' + ); + } + + $resourcePath = '/notes/{id}/comments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($comment_post_put_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($comment_post_put_object)); + } else { + $httpBody = $comment_post_put_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteComment + * + * Delete a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteComment + */ + public function deleteComment($id, $comment_id) + { + list($response) = $this->deleteCommentWithHttpInfo($id, $comment_id); + return $response; + } + + /** + * Operation deleteCommentWithHttpInfo + * + * Delete a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteComment, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteCommentWithHttpInfo($id, $comment_id) + { + $request = $this->deleteCommentRequest($id, $comment_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteCommentRequest($id, $comment_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteCommentAsync + * + * Delete a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteCommentAsync($id, $comment_id): PromiseInterface + { + return $this->deleteCommentAsyncWithHttpInfo($id, $comment_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteCommentAsyncWithHttpInfo + * + * Delete a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteCommentAsyncWithHttpInfo($id, $comment_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteComment'; + $request = $this->deleteCommentRequest($id, $comment_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteComment' + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteCommentRequest($id, $comment_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteComment' + ); + } + // verify the required parameter 'comment_id' is set + /* @phpstan-ignore-next-line */ + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling deleteComment' + ); + } + + $resourcePath = '/notes/{id}/comments/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteNote + * + * Delete a note + * + * @param int $id The ID of the note (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteNote + */ + public function deleteNote($id) + { + list($response) = $this->deleteNoteWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteNoteWithHttpInfo + * + * Delete a note + * + * @param int $id The ID of the note (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteNote, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteNoteWithHttpInfo($id) + { + $request = $this->deleteNoteRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteNoteRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteNoteAsync + * + * Delete a note + * + * @param int $id The ID of the note (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteNoteAsync($id): PromiseInterface + { + return $this->deleteNoteAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteNoteAsyncWithHttpInfo + * + * Delete a note + * + * @param int $id The ID of the note (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteNoteAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteNote'; + $request = $this->deleteNoteRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw 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 int $id The ID of the note (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteNoteRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteNote' + ); + } + + $resourcePath = '/notes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getComment + * + * Get one comment + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostComment + */ + public function getComment($id, $comment_id) + { + list($response) = $this->getCommentWithHttpInfo($id, $comment_id); + return $response; + } + + /** + * Operation getCommentWithHttpInfo + * + * Get one comment + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostComment, HTTP status code, HTTP response headers (array of strings) + */ + public function getCommentWithHttpInfo($id, $comment_id) + { + $request = $this->getCommentRequest($id, $comment_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getCommentRequest($id, $comment_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCommentAsync + * + * Get one comment + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCommentAsync($id, $comment_id): PromiseInterface + { + return $this->getCommentAsyncWithHttpInfo($id, $comment_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCommentAsyncWithHttpInfo + * + * Get one comment + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCommentAsyncWithHttpInfo($id, $comment_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostComment'; + $request = $this->getCommentRequest($id, $comment_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getComment' + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getCommentRequest($id, $comment_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getComment' + ); + } + // verify the required parameter 'comment_id' is set + /* @phpstan-ignore-next-line */ + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling getComment' + ); + } + + $resourcePath = '/notes/{id}/comments/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNote + * + * Get one note + * + * @param int $id The ID of the note (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostNote + */ + public function getNote($id) + { + list($response) = $this->getNoteWithHttpInfo($id); + return $response; + } + + /** + * Operation getNoteWithHttpInfo + * + * Get one note + * + * @param int $id The ID of the note (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostNote, HTTP status code, HTTP response headers (array of strings) + */ + public function getNoteWithHttpInfo($id) + { + $request = $this->getNoteRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getNoteRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNoteAsync + * + * Get one note + * + * @param int $id The ID of the note (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNoteAsync($id): PromiseInterface + { + return $this->getNoteAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNoteAsyncWithHttpInfo + * + * Get one note + * + * @param int $id The ID of the note (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNoteAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostNote'; + $request = $this->getNoteRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw 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 int $id The ID of the note (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getNoteRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getNote' + ); + } + + $resourcePath = '/notes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNoteComments + * + * Get all comments for a note + * + * @param int $id The ID of the note (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetComments + */ + public function getNoteComments($id, $start = 0, $limit = null) + { + list($response) = $this->getNoteCommentsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getNoteCommentsWithHttpInfo + * + * Get all comments for a note + * + * @param int $id The ID of the note (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetComments, HTTP status code, HTTP response headers (array of strings) + */ + public function getNoteCommentsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getNoteCommentsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getNoteCommentsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetComments' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetComments', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetComments' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetComments', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetComments', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNoteCommentsAsync + * + * Get all comments for a note + * + * @param int $id The ID of the note (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNoteCommentsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getNoteCommentsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNoteCommentsAsyncWithHttpInfo + * + * Get all comments for a note + * + * @param int $id The ID of the note (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNoteCommentsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetComments'; + $request = $this->getNoteCommentsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNoteComments' + * + * @param int $id The ID of the note (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getNoteCommentsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getNoteComments' + ); + } + + $resourcePath = '/notes/{id}/comments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getNotes + * + * Get all notes + * + * @param int|null $user_id The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. (optional) + * @param string|null $lead_id The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. (optional) + * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) + * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) + * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) + * @param \DateTime|null $start_date The date in format of YYYY-MM-DD from which notes to fetch (optional) + * @param \DateTime|null $end_date The date in format of YYYY-MM-DD until which notes to fetch to (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetNotes + */ + public function getNotes($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null) + { + list($response) = $this->getNotesWithHttpInfo($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + return $response; + } + + /** + * Operation getNotesWithHttpInfo + * + * Get all notes + * + * @param int|null $user_id The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. (optional) + * @param string|null $lead_id The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. (optional) + * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) + * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) + * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) + * @param \DateTime|null $start_date The date in format of YYYY-MM-DD from which notes to fetch (optional) + * @param \DateTime|null $end_date The date in format of YYYY-MM-DD until which notes to fetch to (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetNotes, HTTP status code, HTTP response headers (array of strings) + */ + public function getNotesWithHttpInfo($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null) + { + $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetNotes' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetNotes', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetNotes' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetNotes', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetNotes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getNotesAsync + * + * Get all notes + * + * @param int|null $user_id The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. (optional) + * @param string|null $lead_id The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. (optional) + * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) + * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) + * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) + * @param \DateTime|null $start_date The date in format of YYYY-MM-DD from which notes to fetch (optional) + * @param \DateTime|null $end_date The date in format of YYYY-MM-DD until which notes to fetch to (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNotesAsync($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null): PromiseInterface + { + return $this->getNotesAsyncWithHttpInfo($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getNotesAsyncWithHttpInfo + * + * Get all notes + * + * @param int|null $user_id The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. (optional) + * @param string|null $lead_id The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. (optional) + * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) + * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) + * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) + * @param \DateTime|null $start_date The date in format of YYYY-MM-DD from which notes to fetch (optional) + * @param \DateTime|null $end_date The date in format of YYYY-MM-DD until which notes to fetch to (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getNotesAsyncWithHttpInfo($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetNotes'; + $request = $this->getNotesRequest($user_id, $lead_id, $deal_id, $person_id, $org_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getNotes' + * + * @param int|null $user_id The ID of the user whose notes to fetch. If omitted, notes by all users will be returned. (optional) + * @param string|null $lead_id The ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. (optional) + * @param int|null $deal_id The ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. (optional) + * @param int|null $person_id The ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. (optional) + * @param int|null $org_id The ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. (optional) + * @param \DateTime|null $start_date The date in format of YYYY-MM-DD from which notes to fetch (optional) + * @param \DateTime|null $end_date The date in format of YYYY-MM-DD until which notes to fetch to (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (optional) + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getNotesRequest($user_id = null, $lead_id = null, $deal_id = null, $person_id = null, $org_id = null, $start = 0, $limit = null, $sort = null, $start_date = null, $end_date = null, $pinned_to_lead_flag = null, $pinned_to_deal_flag = null, $pinned_to_organization_flag = null, $pinned_to_person_flag = null): Request + { + + $resourcePath = '/notes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($lead_id)) { + $lead_id = ObjectSerializer::serializeCollection($lead_id, '', true); + } + if ($lead_id !== null) { + $queryParams['lead_id'] = $lead_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($deal_id)) { + $deal_id = ObjectSerializer::serializeCollection($deal_id, '', true); + } + if ($deal_id !== null) { + $queryParams['deal_id'] = $deal_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($person_id)) { + $person_id = ObjectSerializer::serializeCollection($person_id, '', true); + } + if ($person_id !== null) { + $queryParams['person_id'] = $person_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($org_id)) { + $org_id = ObjectSerializer::serializeCollection($org_id, '', true); + } + if ($org_id !== null) { + $queryParams['org_id'] = $org_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start_date)) { + $start_date = ObjectSerializer::serializeCollection($start_date, '', true); + } + if ($start_date !== null) { + $queryParams['start_date'] = $start_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($end_date)) { + $end_date = ObjectSerializer::serializeCollection($end_date, '', true); + } + if ($end_date !== null) { + $queryParams['end_date'] = $end_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pinned_to_lead_flag)) { + $pinned_to_lead_flag = ObjectSerializer::serializeCollection($pinned_to_lead_flag, '', true); + } + if ($pinned_to_lead_flag !== null) { + $queryParams['pinned_to_lead_flag'] = $pinned_to_lead_flag; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pinned_to_deal_flag)) { + $pinned_to_deal_flag = ObjectSerializer::serializeCollection($pinned_to_deal_flag, '', true); + } + if ($pinned_to_deal_flag !== null) { + $queryParams['pinned_to_deal_flag'] = $pinned_to_deal_flag; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pinned_to_organization_flag)) { + $pinned_to_organization_flag = ObjectSerializer::serializeCollection($pinned_to_organization_flag, '', true); + } + if ($pinned_to_organization_flag !== null) { + $queryParams['pinned_to_organization_flag'] = $pinned_to_organization_flag; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pinned_to_person_flag)) { + $pinned_to_person_flag = ObjectSerializer::serializeCollection($pinned_to_person_flag, '', true); + } + if ($pinned_to_person_flag !== null) { + $queryParams['pinned_to_person_flag'] = $pinned_to_person_flag; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateCommentForNote + * + * Update a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object comment_post_put_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostComment + */ + public function updateCommentForNote($id, $comment_id, $comment_post_put_object = null) + { + list($response) = $this->updateCommentForNoteWithHttpInfo($id, $comment_id, $comment_post_put_object); + return $response; + } + + /** + * Operation updateCommentForNoteWithHttpInfo + * + * Update a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostComment, HTTP status code, HTTP response headers (array of strings) + */ + public function updateCommentForNoteWithHttpInfo($id, $comment_id, $comment_post_put_object = null) + { + $request = $this->updateCommentForNoteRequest($id, $comment_id, $comment_post_put_object); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateCommentForNoteRequest($id, $comment_id, $comment_post_put_object); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostComment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostComment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostComment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateCommentForNoteAsync + * + * Update a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateCommentForNoteAsync($id, $comment_id, $comment_post_put_object = null): PromiseInterface + { + return $this->updateCommentForNoteAsyncWithHttpInfo($id, $comment_id, $comment_post_put_object) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCommentForNoteAsyncWithHttpInfo + * + * Update a comment related to a note + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateCommentForNoteAsyncWithHttpInfo($id, $comment_id, $comment_post_put_object = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostComment'; + $request = $this->updateCommentForNoteRequest($id, $comment_id, $comment_post_put_object); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateCommentForNote' + * + * @param int $id The ID of the note (required) + * @param string $comment_id The ID of the comment (required) + * @param \Pipedrive\Model\CommentPostPutObject|null $comment_post_put_object (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateCommentForNoteRequest($id, $comment_id, $comment_post_put_object = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateCommentForNote' + ); + } + // verify the required parameter 'comment_id' is set + /* @phpstan-ignore-next-line */ + if ($comment_id === null || (is_array($comment_id) && count($comment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $comment_id when calling updateCommentForNote' + ); + } + + $resourcePath = '/notes/{id}/comments/{commentId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($comment_id !== null) { + $resourcePath = str_replace( + '{' . 'commentId' . '}', + ObjectSerializer::toPathValue($comment_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($comment_post_put_object)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($comment_post_put_object)); + } else { + $httpBody = $comment_post_put_object; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNote + * + * Update a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\Note|null $note note (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostNote + */ + public function updateNote($id, $note = null) + { + list($response) = $this->updateNoteWithHttpInfo($id, $note); + return $response; + } + + /** + * Operation updateNoteWithHttpInfo + * + * Update a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\Note|null $note (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostNote, HTTP status code, HTTP response headers (array of strings) + */ + public function updateNoteWithHttpInfo($id, $note = null) + { + $request = $this->updateNoteRequest($id, $note); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateNoteRequest($id, $note); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostNote' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostNote', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNoteAsync + * + * Update a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\Note|null $note (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateNoteAsync($id, $note = null): PromiseInterface + { + return $this->updateNoteAsyncWithHttpInfo($id, $note) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNoteAsyncWithHttpInfo + * + * Update a note + * + * @param int $id The ID of the note (required) + * @param \Pipedrive\Model\Note|null $note (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateNoteAsyncWithHttpInfo($id, $note = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostNote'; + $request = $this->updateNoteRequest($id, $note); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw 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 int $id The ID of the note (required) + * @param \Pipedrive\Model\Note|null $note (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateNoteRequest($id, $note = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateNote' + ); + } + + $resourcePath = '/notes/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($note)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($note)); + } else { + $httpBody = $note; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/OrganizationFieldsApi.php b/lib/Api/OrganizationFieldsApi.php new file mode 100644 index 00000000..937df1da --- /dev/null +++ b/lib/Api/OrganizationFieldsApi.php @@ -0,0 +1,1927 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addOrganizationField + * + * Add a new organization field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request field_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function addOrganizationField($field_create_request = null) + { + list($response) = $this->addOrganizationFieldWithHttpInfo($field_create_request); + return $response; + } + + /** + * Operation addOrganizationFieldWithHttpInfo + * + * Add a new organization field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addOrganizationFieldWithHttpInfo($field_create_request = null) + { + $request = $this->addOrganizationFieldRequest($field_create_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addOrganizationFieldRequest($field_create_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addOrganizationFieldAsync + * + * Add a new organization field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationFieldAsync($field_create_request = null): PromiseInterface + { + return $this->addOrganizationFieldAsyncWithHttpInfo($field_create_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addOrganizationFieldAsyncWithHttpInfo + * + * Add a new organization field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationFieldAsyncWithHttpInfo($field_create_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->addOrganizationFieldRequest($field_create_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addOrganizationField' + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addOrganizationFieldRequest($field_create_request = null): Request + { + + $resourcePath = '/organizationFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($field_create_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($field_create_request)); + } else { + $httpBody = $field_create_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrganizationField + * + * Delete an organization field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteResponse + */ + public function deleteOrganizationField($id) + { + list($response) = $this->deleteOrganizationFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteOrganizationFieldWithHttpInfo + * + * Delete an organization field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrganizationFieldWithHttpInfo($id) + { + $request = $this->deleteOrganizationFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteOrganizationFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteOrganizationFieldAsync + * + * Delete an organization field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationFieldAsync($id): PromiseInterface + { + return $this->deleteOrganizationFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrganizationFieldAsyncWithHttpInfo + * + * Delete an organization field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteResponse'; + $request = $this->deleteOrganizationFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrganizationField' + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteOrganizationFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteOrganizationField' + ); + } + + $resourcePath = '/organizationFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrganizationFields + * + * Delete multiple organization fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\BulkDeleteResponse + */ + public function deleteOrganizationFields($ids) + { + list($response) = $this->deleteOrganizationFieldsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteOrganizationFieldsWithHttpInfo + * + * Delete multiple organization fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\BulkDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrganizationFieldsWithHttpInfo($ids) + { + $request = $this->deleteOrganizationFieldsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteOrganizationFieldsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\BulkDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteOrganizationFieldsAsync + * + * Delete multiple organization fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationFieldsAsync($ids): PromiseInterface + { + return $this->deleteOrganizationFieldsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrganizationFieldsAsyncWithHttpInfo + * + * Delete multiple organization fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationFieldsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\BulkDeleteResponse'; + $request = $this->deleteOrganizationFieldsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrganizationFields' + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteOrganizationFieldsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteOrganizationFields' + ); + } + + $resourcePath = '/organizationFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationField + * + * Get one organization field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function getOrganizationField($id) + { + list($response) = $this->getOrganizationFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation getOrganizationFieldWithHttpInfo + * + * Get one organization field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationFieldWithHttpInfo($id) + { + $request = $this->getOrganizationFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationFieldAsync + * + * Get one organization field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFieldAsync($id): PromiseInterface + { + return $this->getOrganizationFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationFieldAsyncWithHttpInfo + * + * Get one organization field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->getOrganizationFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationField' + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationField' + ); + } + + $resourcePath = '/organizationFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationFields + * + * Get all organization fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldsResponse + */ + public function getOrganizationFields($start = 0, $limit = null) + { + list($response) = $this->getOrganizationFieldsWithHttpInfo($start, $limit); + return $response; + } + + /** + * Operation getOrganizationFieldsWithHttpInfo + * + * Get all organization fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationFieldsWithHttpInfo($start = 0, $limit = null) + { + $request = $this->getOrganizationFieldsRequest($start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationFieldsRequest($start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationFieldsAsync + * + * Get all organization fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFieldsAsync($start = 0, $limit = null): PromiseInterface + { + return $this->getOrganizationFieldsAsyncWithHttpInfo($start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationFieldsAsyncWithHttpInfo + * + * Get all organization fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFieldsAsyncWithHttpInfo($start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldsResponse'; + $request = $this->getOrganizationFieldsRequest($start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationFields' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationFieldsRequest($start = 0, $limit = null): Request + { + + $resourcePath = '/organizationFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOrganizationField + * + * Update an organization field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request field_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function updateOrganizationField($id, $field_update_request = null) + { + list($response) = $this->updateOrganizationFieldWithHttpInfo($id, $field_update_request); + return $response; + } + + /** + * Operation updateOrganizationFieldWithHttpInfo + * + * Update an organization field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOrganizationFieldWithHttpInfo($id, $field_update_request = null) + { + $request = $this->updateOrganizationFieldRequest($id, $field_update_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateOrganizationFieldRequest($id, $field_update_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOrganizationFieldAsync + * + * Update an organization field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateOrganizationFieldAsync($id, $field_update_request = null): PromiseInterface + { + return $this->updateOrganizationFieldAsyncWithHttpInfo($id, $field_update_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOrganizationFieldAsyncWithHttpInfo + * + * Update an organization field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateOrganizationFieldAsyncWithHttpInfo($id, $field_update_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->updateOrganizationFieldRequest($id, $field_update_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOrganizationField' + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateOrganizationFieldRequest($id, $field_update_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateOrganizationField' + ); + } + + $resourcePath = '/organizationFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($field_update_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($field_update_request)); + } else { + $httpBody = $field_update_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/OrganizationRelationshipsApi.php b/lib/Api/OrganizationRelationshipsApi.php new file mode 100644 index 00000000..95791930 --- /dev/null +++ b/lib/Api/OrganizationRelationshipsApi.php @@ -0,0 +1,1638 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addOrganizationRelationship + * + * Create an organization relationship + * + * @param \Pipedrive\Model\AddOrganizationRelationshipRequest|null $add_organization_relationship_request add_organization_relationship_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationRelationshipPostResponse + */ + public function addOrganizationRelationship($add_organization_relationship_request = null) + { + list($response) = $this->addOrganizationRelationshipWithHttpInfo($add_organization_relationship_request); + return $response; + } + + /** + * Operation addOrganizationRelationshipWithHttpInfo + * + * Create an organization relationship + * + * @param \Pipedrive\Model\AddOrganizationRelationshipRequest|null $add_organization_relationship_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationRelationshipPostResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addOrganizationRelationshipWithHttpInfo($add_organization_relationship_request = null) + { + $request = $this->addOrganizationRelationshipRequest($add_organization_relationship_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addOrganizationRelationshipRequest($add_organization_relationship_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationRelationshipPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addOrganizationRelationshipAsync + * + * Create an organization relationship + * + * @param \Pipedrive\Model\AddOrganizationRelationshipRequest|null $add_organization_relationship_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationRelationshipAsync($add_organization_relationship_request = null): PromiseInterface + { + return $this->addOrganizationRelationshipAsyncWithHttpInfo($add_organization_relationship_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addOrganizationRelationshipAsyncWithHttpInfo + * + * Create an organization relationship + * + * @param \Pipedrive\Model\AddOrganizationRelationshipRequest|null $add_organization_relationship_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationRelationshipAsyncWithHttpInfo($add_organization_relationship_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationRelationshipPostResponse'; + $request = $this->addOrganizationRelationshipRequest($add_organization_relationship_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addOrganizationRelationship' + * + * @param \Pipedrive\Model\AddOrganizationRelationshipRequest|null $add_organization_relationship_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addOrganizationRelationshipRequest($add_organization_relationship_request = null): Request + { + + $resourcePath = '/organizationRelationships'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_organization_relationship_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_organization_relationship_request)); + } else { + $httpBody = $add_organization_relationship_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrganizationRelationship + * + * Delete an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationRelationshipDeleteResponse + */ + public function deleteOrganizationRelationship($id) + { + list($response) = $this->deleteOrganizationRelationshipWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteOrganizationRelationshipWithHttpInfo + * + * Delete an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationRelationshipDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrganizationRelationshipWithHttpInfo($id) + { + $request = $this->deleteOrganizationRelationshipRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteOrganizationRelationshipRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationRelationshipDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteOrganizationRelationshipAsync + * + * Delete an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationRelationshipAsync($id): PromiseInterface + { + return $this->deleteOrganizationRelationshipAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrganizationRelationshipAsyncWithHttpInfo + * + * Delete an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationRelationshipAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationRelationshipDeleteResponse'; + $request = $this->deleteOrganizationRelationshipRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrganizationRelationship' + * + * @param int $id The ID of the organization relationship (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteOrganizationRelationshipRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteOrganizationRelationship' + ); + } + + $resourcePath = '/organizationRelationships/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationRelationship + * + * Get one organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param int|null $org_id The ID of the base organization for the returned calculated values (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationRelationshipGetResponse + */ + public function getOrganizationRelationship($id, $org_id = null) + { + list($response) = $this->getOrganizationRelationshipWithHttpInfo($id, $org_id); + return $response; + } + + /** + * Operation getOrganizationRelationshipWithHttpInfo + * + * Get one organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param int|null $org_id The ID of the base organization for the returned calculated values (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationRelationshipGetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationRelationshipWithHttpInfo($id, $org_id = null) + { + $request = $this->getOrganizationRelationshipRequest($id, $org_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationRelationshipRequest($id, $org_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationRelationshipGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationRelationshipAsync + * + * Get one organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param int|null $org_id The ID of the base organization for the returned calculated values (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationRelationshipAsync($id, $org_id = null): PromiseInterface + { + return $this->getOrganizationRelationshipAsyncWithHttpInfo($id, $org_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationRelationshipAsyncWithHttpInfo + * + * Get one organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param int|null $org_id The ID of the base organization for the returned calculated values (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationRelationshipAsyncWithHttpInfo($id, $org_id = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationRelationshipGetResponse'; + $request = $this->getOrganizationRelationshipRequest($id, $org_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationRelationship' + * + * @param int $id The ID of the organization relationship (required) + * @param int|null $org_id The ID of the base organization for the returned calculated values (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationRelationshipRequest($id, $org_id = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationRelationship' + ); + } + + $resourcePath = '/organizationRelationships/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($org_id)) { + $org_id = ObjectSerializer::serializeCollection($org_id, '', true); + } + if ($org_id !== null) { + $queryParams['org_id'] = $org_id; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationRelationships + * + * Get all relationships for organization + * + * @param int $org_id The ID of the organization to get relationships for (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponse + */ + public function getOrganizationRelationships($org_id) + { + list($response) = $this->getOrganizationRelationshipsWithHttpInfo($org_id); + return $response; + } + + /** + * Operation getOrganizationRelationshipsWithHttpInfo + * + * Get all relationships for organization + * + * @param int $org_id The ID of the organization to get relationships for (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AllOrganizationRelationshipsGetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationRelationshipsWithHttpInfo($org_id) + { + $request = $this->getOrganizationRelationshipsRequest($org_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationRelationshipsRequest($org_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AllOrganizationRelationshipsGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AllOrganizationRelationshipsGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AllOrganizationRelationshipsGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AllOrganizationRelationshipsGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AllOrganizationRelationshipsGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationRelationshipsAsync + * + * Get all relationships for organization + * + * @param int $org_id The ID of the organization to get relationships for (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationRelationshipsAsync($org_id): PromiseInterface + { + return $this->getOrganizationRelationshipsAsyncWithHttpInfo($org_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationRelationshipsAsyncWithHttpInfo + * + * Get all relationships for organization + * + * @param int $org_id The ID of the organization to get relationships for (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationRelationshipsAsyncWithHttpInfo($org_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\AllOrganizationRelationshipsGetResponse'; + $request = $this->getOrganizationRelationshipsRequest($org_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationRelationships' + * + * @param int $org_id The ID of the organization to get relationships for (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationRelationshipsRequest($org_id): Request + { + // verify the required parameter 'org_id' is set + /* @phpstan-ignore-next-line */ + if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $org_id when calling getOrganizationRelationships' + ); + } + + $resourcePath = '/organizationRelationships'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($org_id)) { + $org_id = ObjectSerializer::serializeCollection($org_id, '', true); + } + if ($org_id !== null) { + $queryParams['org_id'] = $org_id; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOrganizationRelationship + * + * Update an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param \Pipedrive\Model\OrganizationRelationship|null $organization_relationship organization_relationship (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationRelationshipUpdateResponse + */ + public function updateOrganizationRelationship($id, $organization_relationship = null) + { + list($response) = $this->updateOrganizationRelationshipWithHttpInfo($id, $organization_relationship); + return $response; + } + + /** + * Operation updateOrganizationRelationshipWithHttpInfo + * + * Update an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param \Pipedrive\Model\OrganizationRelationship|null $organization_relationship (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationRelationshipUpdateResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOrganizationRelationshipWithHttpInfo($id, $organization_relationship = null) + { + $request = $this->updateOrganizationRelationshipRequest($id, $organization_relationship); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateOrganizationRelationshipRequest($id, $organization_relationship); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipUpdateResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipUpdateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationRelationshipUpdateResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationRelationshipUpdateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationRelationshipUpdateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOrganizationRelationshipAsync + * + * Update an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param \Pipedrive\Model\OrganizationRelationship|null $organization_relationship (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateOrganizationRelationshipAsync($id, $organization_relationship = null): PromiseInterface + { + return $this->updateOrganizationRelationshipAsyncWithHttpInfo($id, $organization_relationship) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOrganizationRelationshipAsyncWithHttpInfo + * + * Update an organization relationship + * + * @param int $id The ID of the organization relationship (required) + * @param \Pipedrive\Model\OrganizationRelationship|null $organization_relationship (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateOrganizationRelationshipAsyncWithHttpInfo($id, $organization_relationship = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationRelationshipUpdateResponse'; + $request = $this->updateOrganizationRelationshipRequest($id, $organization_relationship); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOrganizationRelationship' + * + * @param int $id The ID of the organization relationship (required) + * @param \Pipedrive\Model\OrganizationRelationship|null $organization_relationship (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateOrganizationRelationshipRequest($id, $organization_relationship = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateOrganizationRelationship' + ); + } + + $resourcePath = '/organizationRelationships/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($organization_relationship)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($organization_relationship)); + } else { + $httpBody = $organization_relationship; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/OrganizationsApi.php b/lib/Api/OrganizationsApi.php new file mode 100644 index 00000000..fb0ca224 --- /dev/null +++ b/lib/Api/OrganizationsApi.php @@ -0,0 +1,5869 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addOrganization + * + * Add an organization + * + * @param \Pipedrive\Model\NewOrganization|null $new_organization new_organization (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationPostResponse + */ + public function addOrganization($new_organization = null) + { + list($response) = $this->addOrganizationWithHttpInfo($new_organization); + return $response; + } + + /** + * Operation addOrganizationWithHttpInfo + * + * Add an organization + * + * @param \Pipedrive\Model\NewOrganization|null $new_organization (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationPostResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addOrganizationWithHttpInfo($new_organization = null) + { + $request = $this->addOrganizationRequest($new_organization); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addOrganizationRequest($new_organization); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addOrganizationAsync + * + * Add an organization + * + * @param \Pipedrive\Model\NewOrganization|null $new_organization (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationAsync($new_organization = null): PromiseInterface + { + return $this->addOrganizationAsyncWithHttpInfo($new_organization) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addOrganizationAsyncWithHttpInfo + * + * Add an organization + * + * @param \Pipedrive\Model\NewOrganization|null $new_organization (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationAsyncWithHttpInfo($new_organization = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationPostResponse'; + $request = $this->addOrganizationRequest($new_organization); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addOrganization' + * + * @param \Pipedrive\Model\NewOrganization|null $new_organization (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addOrganizationRequest($new_organization = null): Request + { + + $resourcePath = '/organizations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($new_organization)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($new_organization)); + } else { + $httpBody = $new_organization; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addOrganizationFollower + * + * Add a follower to an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\AddOrganizationFollowerRequest|null $add_organization_follower_request add_organization_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationFollowerPostResponse + */ + public function addOrganizationFollower($id, $add_organization_follower_request = null) + { + list($response) = $this->addOrganizationFollowerWithHttpInfo($id, $add_organization_follower_request); + return $response; + } + + /** + * Operation addOrganizationFollowerWithHttpInfo + * + * Add a follower to an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\AddOrganizationFollowerRequest|null $add_organization_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationFollowerPostResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addOrganizationFollowerWithHttpInfo($id, $add_organization_follower_request = null) + { + $request = $this->addOrganizationFollowerRequest($id, $add_organization_follower_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addOrganizationFollowerRequest($id, $add_organization_follower_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFollowerPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFollowerPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFollowerPostResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFollowerPostResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationFollowerPostResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addOrganizationFollowerAsync + * + * Add a follower to an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\AddOrganizationFollowerRequest|null $add_organization_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationFollowerAsync($id, $add_organization_follower_request = null): PromiseInterface + { + return $this->addOrganizationFollowerAsyncWithHttpInfo($id, $add_organization_follower_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addOrganizationFollowerAsyncWithHttpInfo + * + * Add a follower to an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\AddOrganizationFollowerRequest|null $add_organization_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrganizationFollowerAsyncWithHttpInfo($id, $add_organization_follower_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationFollowerPostResponse'; + $request = $this->addOrganizationFollowerRequest($id, $add_organization_follower_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addOrganizationFollower' + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\AddOrganizationFollowerRequest|null $add_organization_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addOrganizationFollowerRequest($id, $add_organization_follower_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addOrganizationFollower' + ); + } + + $resourcePath = '/organizations/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_organization_follower_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_organization_follower_request)); + } else { + $httpBody = $add_organization_follower_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrganization + * + * Delete an organization + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationDeleteResponse + */ + public function deleteOrganization($id) + { + list($response) = $this->deleteOrganizationWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteOrganizationWithHttpInfo + * + * Delete an organization + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrganizationWithHttpInfo($id) + { + $request = $this->deleteOrganizationRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteOrganizationRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteOrganizationAsync + * + * Delete an organization + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationAsync($id): PromiseInterface + { + return $this->deleteOrganizationAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrganizationAsyncWithHttpInfo + * + * Delete an organization + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationDeleteResponse'; + $request = $this->deleteOrganizationRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrganization' + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteOrganizationRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteOrganization' + ); + } + + $resourcePath = '/organizations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrganizationFollower + * + * Delete a follower from an organization + * + * @param int $id The ID of the organization (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationFollowerDeleteResponse + */ + public function deleteOrganizationFollower($id, $follower_id) + { + list($response) = $this->deleteOrganizationFollowerWithHttpInfo($id, $follower_id); + return $response; + } + + /** + * Operation deleteOrganizationFollowerWithHttpInfo + * + * Delete a follower from an organization + * + * @param int $id The ID of the organization (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationFollowerDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrganizationFollowerWithHttpInfo($id, $follower_id) + { + $request = $this->deleteOrganizationFollowerRequest($id, $follower_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteOrganizationFollowerRequest($id, $follower_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFollowerDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFollowerDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFollowerDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFollowerDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationFollowerDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteOrganizationFollowerAsync + * + * Delete a follower from an organization + * + * @param int $id The ID of the organization (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationFollowerAsync($id, $follower_id): PromiseInterface + { + return $this->deleteOrganizationFollowerAsyncWithHttpInfo($id, $follower_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrganizationFollowerAsyncWithHttpInfo + * + * Delete a follower from an organization + * + * @param int $id The ID of the organization (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationFollowerAsyncWithHttpInfo($id, $follower_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationFollowerDeleteResponse'; + $request = $this->deleteOrganizationFollowerRequest($id, $follower_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrganizationFollower' + * + * @param int $id The ID of the organization (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteOrganizationFollowerRequest($id, $follower_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteOrganizationFollower' + ); + } + // verify the required parameter 'follower_id' is set + /* @phpstan-ignore-next-line */ + if ($follower_id === null || (is_array($follower_id) && count($follower_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $follower_id when calling deleteOrganizationFollower' + ); + } + + $resourcePath = '/organizations/{id}/followers/{follower_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($follower_id !== null) { + $resourcePath = str_replace( + '{' . 'follower_id' . '}', + ObjectSerializer::toPathValue($follower_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteOrganizations + * + * Delete multiple organizations in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationsDeleteResponse + */ + public function deleteOrganizations($ids) + { + list($response) = $this->deleteOrganizationsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteOrganizationsWithHttpInfo + * + * Delete multiple organizations in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationsDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteOrganizationsWithHttpInfo($ids) + { + $request = $this->deleteOrganizationsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteOrganizationsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationsDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationsDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationsDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationsDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationsDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteOrganizationsAsync + * + * Delete multiple organizations in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationsAsync($ids): PromiseInterface + { + return $this->deleteOrganizationsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteOrganizationsAsyncWithHttpInfo + * + * Delete multiple organizations in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteOrganizationsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationsDeleteResponse'; + $request = $this->deleteOrganizationsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteOrganizations' + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteOrganizationsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteOrganizations' + ); + } + + $resourcePath = '/organizations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganization + * + * Get details of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationDetailsGetResponse + */ + public function getOrganization($id) + { + list($response) = $this->getOrganizationWithHttpInfo($id); + return $response; + } + + /** + * Operation getOrganizationWithHttpInfo + * + * Get details of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationDetailsGetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationWithHttpInfo($id) + { + $request = $this->getOrganizationRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationDetailsGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationDetailsGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationDetailsGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationDetailsGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationDetailsGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationAsync + * + * Get details of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationAsync($id): PromiseInterface + { + return $this->getOrganizationAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationAsyncWithHttpInfo + * + * Get details of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationDetailsGetResponse'; + $request = $this->getOrganizationRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganization' + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganization' + ); + } + + $resourcePath = '/organizations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationActivities + * + * List activities associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListActivitiesResponse + */ + public function getOrganizationActivities($id, $start = 0, $limit = null, $done = null, $exclude = null) + { + list($response) = $this->getOrganizationActivitiesWithHttpInfo($id, $start, $limit, $done, $exclude); + return $response; + } + + /** + * Operation getOrganizationActivitiesWithHttpInfo + * + * List activities associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationActivitiesWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null) + { + $request = $this->getOrganizationActivitiesRequest($id, $start, $limit, $done, $exclude); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationActivitiesRequest($id, $start, $limit, $done, $exclude); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListActivitiesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListActivitiesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListActivitiesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListActivitiesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListActivitiesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationActivitiesAsync + * + * List activities associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationActivitiesAsync($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface + { + return $this->getOrganizationActivitiesAsyncWithHttpInfo($id, $start, $limit, $done, $exclude) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationActivitiesAsyncWithHttpInfo + * + * List activities associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationActivitiesAsyncWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListActivitiesResponse'; + $request = $this->getOrganizationActivitiesRequest($id, $start, $limit, $done, $exclude); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationActivities' + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationActivitiesRequest($id, $start = 0, $limit = null, $done = null, $exclude = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationActivities' + ); + } + + $resourcePath = '/organizations/{id}/activities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($done)) { + $done = ObjectSerializer::serializeCollection($done, '', true); + } + if ($done !== null) { + $queryParams['done'] = $done; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exclude)) { + $exclude = ObjectSerializer::serializeCollection($exclude, '', true); + } + if ($exclude !== null) { + $queryParams['exclude'] = $exclude; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationDeals + * + * List deals associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListDealsResponse + */ + public function getOrganizationDeals($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null) + { + list($response) = $this->getOrganizationDealsWithHttpInfo($id, $start, $limit, $status, $sort, $only_primary_association); + return $response; + } + + /** + * Operation getOrganizationDealsWithHttpInfo + * + * List deals associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListDealsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationDealsWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null) + { + $request = $this->getOrganizationDealsRequest($id, $start, $limit, $status, $sort, $only_primary_association); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationDealsRequest($id, $start, $limit, $status, $sort, $only_primary_association); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListDealsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListDealsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListDealsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListDealsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListDealsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationDealsAsync + * + * List deals associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationDealsAsync($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null): PromiseInterface + { + return $this->getOrganizationDealsAsyncWithHttpInfo($id, $start, $limit, $status, $sort, $only_primary_association) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationDealsAsyncWithHttpInfo + * + * List deals associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationDealsAsyncWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListDealsResponse'; + $request = $this->getOrganizationDealsRequest($id, $start, $limit, $status, $sort, $only_primary_association); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationDeals' + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * @param \Pipedrive\Model\NumberBoolean|null $only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationDealsRequest($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null, $only_primary_association = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationDeals' + ); + } + + $resourcePath = '/organizations/{id}/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($only_primary_association)) { + $only_primary_association = ObjectSerializer::serializeCollection($only_primary_association, '', true); + } + if ($only_primary_association !== null) { + $queryParams['only_primary_association'] = $only_primary_association; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationFiles + * + * List files attached to an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListFilesResponse + */ + public function getOrganizationFiles($id, $start = 0, $limit = null, $sort = null) + { + list($response) = $this->getOrganizationFilesWithHttpInfo($id, $start, $limit, $sort); + return $response; + } + + /** + * Operation getOrganizationFilesWithHttpInfo + * + * List files attached to an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListFilesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationFilesWithHttpInfo($id, $start = 0, $limit = null, $sort = null) + { + $request = $this->getOrganizationFilesRequest($id, $start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationFilesRequest($id, $start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListFilesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationFilesAsync + * + * List files attached to an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFilesAsync($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getOrganizationFilesAsyncWithHttpInfo($id, $start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationFilesAsyncWithHttpInfo + * + * List files attached to an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFilesAsyncWithHttpInfo($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListFilesResponse'; + $request = $this->getOrganizationFilesRequest($id, $start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationFiles' + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationFilesRequest($id, $start = 0, $limit = null, $sort = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationFiles' + ); + } + + $resourcePath = '/organizations/{id}/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationFollowers + * + * List followers of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationFollowersListResponse + */ + public function getOrganizationFollowers($id) + { + list($response) = $this->getOrganizationFollowersWithHttpInfo($id); + return $response; + } + + /** + * Operation getOrganizationFollowersWithHttpInfo + * + * List followers of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationFollowersListResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationFollowersWithHttpInfo($id) + { + $request = $this->getOrganizationFollowersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationFollowersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFollowersListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFollowersListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFollowersListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFollowersListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationFollowersListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationFollowersAsync + * + * List followers of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFollowersAsync($id): PromiseInterface + { + return $this->getOrganizationFollowersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationFollowersAsyncWithHttpInfo + * + * List followers of an organization + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationFollowersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationFollowersListResponse'; + $request = $this->getOrganizationFollowersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationFollowers' + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationFollowersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationFollowers' + ); + } + + $resourcePath = '/organizations/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationMailMessages + * + * List mail messages associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListMailMessagesResponse + */ + public function getOrganizationMailMessages($id, $start = 0, $limit = null) + { + list($response) = $this->getOrganizationMailMessagesWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getOrganizationMailMessagesWithHttpInfo + * + * List mail messages associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationMailMessagesWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListMailMessagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListMailMessagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListMailMessagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListMailMessagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListMailMessagesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationMailMessagesAsync + * + * List mail messages associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getOrganizationMailMessagesAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationMailMessagesAsyncWithHttpInfo + * + * List mail messages associated with an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListMailMessagesResponse'; + $request = $this->getOrganizationMailMessagesRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationMailMessages' + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationMailMessagesRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationMailMessages' + ); + } + + $resourcePath = '/organizations/{id}/mailMessages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationPersons + * + * List persons of an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListPersonsResponse + */ + public function getOrganizationPersons($id, $start = 0, $limit = null) + { + list($response) = $this->getOrganizationPersonsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getOrganizationPersonsWithHttpInfo + * + * List persons of an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListPersonsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationPersonsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getOrganizationPersonsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationPersonsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListPersonsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationPersonsAsync + * + * List persons of an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationPersonsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getOrganizationPersonsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationPersonsAsyncWithHttpInfo + * + * List persons of an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationPersonsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListPersonsResponse'; + $request = $this->getOrganizationPersonsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationPersons' + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationPersonsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationPersons' + ); + } + + $resourcePath = '/organizations/{id}/persons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationUpdates + * + * List updates about an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationFlowResponse + */ + public function getOrganizationUpdates($id, $start = 0, $limit = null, $all_changes = null, $items = null) + { + list($response) = $this->getOrganizationUpdatesWithHttpInfo($id, $start, $limit, $all_changes, $items); + return $response; + } + + /** + * Operation getOrganizationUpdatesWithHttpInfo + * + * List updates about an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationFlowResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationUpdatesWithHttpInfo($id, $start = 0, $limit = null, $all_changes = null, $items = null) + { + $request = $this->getOrganizationUpdatesRequest($id, $start, $limit, $all_changes, $items); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationUpdatesRequest($id, $start, $limit, $all_changes, $items); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFlowResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFlowResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationFlowResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationFlowResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationFlowResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationUpdatesAsync + * + * List updates about an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationUpdatesAsync($id, $start = 0, $limit = null, $all_changes = null, $items = null): PromiseInterface + { + return $this->getOrganizationUpdatesAsyncWithHttpInfo($id, $start, $limit, $all_changes, $items) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationUpdatesAsyncWithHttpInfo + * + * List updates about an organization + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationUpdatesAsyncWithHttpInfo($id, $start = 0, $limit = null, $all_changes = null, $items = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationFlowResponse'; + $request = $this->getOrganizationUpdatesRequest($id, $start, $limit, $all_changes, $items); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationUpdates' + * + * @param int $id The ID of the organization (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted, returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationUpdatesRequest($id, $start = 0, $limit = null, $all_changes = null, $items = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationUpdates' + ); + } + + $resourcePath = '/organizations/{id}/flow'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($all_changes)) { + $all_changes = ObjectSerializer::serializeCollection($all_changes, '', true); + } + if ($all_changes !== null) { + $queryParams['all_changes'] = $all_changes; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($items)) { + $items = ObjectSerializer::serializeCollection($items, '', true); + } + if ($items !== null) { + $queryParams['items'] = $items; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizationUsers + * + * List permitted users + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListPermittedUsersResponse1 + */ + public function getOrganizationUsers($id) + { + list($response) = $this->getOrganizationUsersWithHttpInfo($id); + return $response; + } + + /** + * Operation getOrganizationUsersWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the organization (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListPermittedUsersResponse1, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationUsersWithHttpInfo($id) + { + $request = $this->getOrganizationUsersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationUsersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPermittedUsersResponse1' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPermittedUsersResponse1', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPermittedUsersResponse1' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPermittedUsersResponse1', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListPermittedUsersResponse1', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationUsersAsync + * + * List permitted users + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationUsersAsync($id): PromiseInterface + { + return $this->getOrganizationUsersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationUsersAsyncWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationUsersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListPermittedUsersResponse1'; + $request = $this->getOrganizationUsersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationUsers' + * + * @param int $id The ID of the organization (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationUsersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOrganizationUsers' + ); + } + + $resourcePath = '/organizations/{id}/permittedUsers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOrganizations + * + * Get all organizations + * + * @param int|null $user_id If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AllOrganizationsGetResponse + */ + public function getOrganizations($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) + { + list($response) = $this->getOrganizationsWithHttpInfo($user_id, $filter_id, $first_char, $start, $limit, $sort); + return $response; + } + + /** + * Operation getOrganizationsWithHttpInfo + * + * Get all organizations + * + * @param int|null $user_id If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AllOrganizationsGetResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationsWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) + { + $request = $this->getOrganizationsRequest($user_id, $filter_id, $first_char, $start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getOrganizationsRequest($user_id, $filter_id, $first_char, $start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AllOrganizationsGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AllOrganizationsGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AllOrganizationsGetResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AllOrganizationsGetResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AllOrganizationsGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationsAsync + * + * Get all organizations + * + * @param int|null $user_id If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationsAsync($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getOrganizationsAsyncWithHttpInfo($user_id, $filter_id, $first_char, $start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationsAsyncWithHttpInfo + * + * Get all organizations + * + * @param int|null $user_id If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getOrganizationsAsyncWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AllOrganizationsGetResponse'; + $request = $this->getOrganizationsRequest($user_id, $filter_id, $first_char, $start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizations' + * + * @param int|null $user_id If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getOrganizationsRequest($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): Request + { + + $resourcePath = '/organizations'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($first_char)) { + $first_char = ObjectSerializer::serializeCollection($first_char, '', true); + } + if ($first_char !== null) { + $queryParams['first_char'] = $first_char; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation mergeOrganizations + * + * Merge two organizations + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\MergeOrganizationsRequest|null $merge_organizations_request merge_organizations_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationsMergeResponse + */ + public function mergeOrganizations($id, $merge_organizations_request = null) + { + list($response) = $this->mergeOrganizationsWithHttpInfo($id, $merge_organizations_request); + return $response; + } + + /** + * Operation mergeOrganizationsWithHttpInfo + * + * Merge two organizations + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\MergeOrganizationsRequest|null $merge_organizations_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationsMergeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function mergeOrganizationsWithHttpInfo($id, $merge_organizations_request = null) + { + $request = $this->mergeOrganizationsRequest($id, $merge_organizations_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->mergeOrganizationsRequest($id, $merge_organizations_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationsMergeResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationsMergeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationsMergeResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationsMergeResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationsMergeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mergeOrganizationsAsync + * + * Merge two organizations + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\MergeOrganizationsRequest|null $merge_organizations_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function mergeOrganizationsAsync($id, $merge_organizations_request = null): PromiseInterface + { + return $this->mergeOrganizationsAsyncWithHttpInfo($id, $merge_organizations_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mergeOrganizationsAsyncWithHttpInfo + * + * Merge two organizations + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\MergeOrganizationsRequest|null $merge_organizations_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function mergeOrganizationsAsyncWithHttpInfo($id, $merge_organizations_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationsMergeResponse'; + $request = $this->mergeOrganizationsRequest($id, $merge_organizations_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'mergeOrganizations' + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\MergeOrganizationsRequest|null $merge_organizations_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function mergeOrganizationsRequest($id, $merge_organizations_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling mergeOrganizations' + ); + } + + $resourcePath = '/organizations/{id}/merge'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($merge_organizations_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($merge_organizations_request)); + } else { + $httpBody = $merge_organizations_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchOrganization + * + * Search organizations + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationSearchResponse + */ + public function searchOrganization($term, $fields = null, $exact_match = null, $start = 0, $limit = null) + { + list($response) = $this->searchOrganizationWithHttpInfo($term, $fields, $exact_match, $start, $limit); + return $response; + } + + /** + * Operation searchOrganizationWithHttpInfo + * + * Search organizations + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationSearchResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchOrganizationWithHttpInfo($term, $fields = null, $exact_match = null, $start = 0, $limit = null) + { + $request = $this->searchOrganizationRequest($term, $fields, $exact_match, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchOrganizationRequest($term, $fields, $exact_match, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchOrganizationAsync + * + * Search organizations + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchOrganizationAsync($term, $fields = null, $exact_match = null, $start = 0, $limit = null): PromiseInterface + { + return $this->searchOrganizationAsyncWithHttpInfo($term, $fields, $exact_match, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchOrganizationAsyncWithHttpInfo + * + * Search organizations + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchOrganizationAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationSearchResponse'; + $request = $this->searchOrganizationRequest($term, $fields, $exact_match, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchOrganization' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchOrganizationRequest($term, $fields = null, $exact_match = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchOrganization' + ); + } + + $resourcePath = '/organizations/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($fields)) { + $fields = ObjectSerializer::serializeCollection($fields, '', true); + } + if ($fields !== null) { + $queryParams['fields'] = $fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateOrganization + * + * Update an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\UpdateOrganization|null $update_organization update_organization (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\OrganizationUpdateResponse + */ + public function updateOrganization($id, $update_organization = null) + { + list($response) = $this->updateOrganizationWithHttpInfo($id, $update_organization); + return $response; + } + + /** + * Operation updateOrganizationWithHttpInfo + * + * Update an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\UpdateOrganization|null $update_organization (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\OrganizationUpdateResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateOrganizationWithHttpInfo($id, $update_organization = null) + { + $request = $this->updateOrganizationRequest($id, $update_organization); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateOrganizationRequest($id, $update_organization); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationUpdateResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationUpdateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\OrganizationUpdateResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\OrganizationUpdateResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\OrganizationUpdateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateOrganizationAsync + * + * Update an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\UpdateOrganization|null $update_organization (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateOrganizationAsync($id, $update_organization = null): PromiseInterface + { + return $this->updateOrganizationAsyncWithHttpInfo($id, $update_organization) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateOrganizationAsyncWithHttpInfo + * + * Update an organization + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\UpdateOrganization|null $update_organization (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateOrganizationAsyncWithHttpInfo($id, $update_organization = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\OrganizationUpdateResponse'; + $request = $this->updateOrganizationRequest($id, $update_organization); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateOrganization' + * + * @param int $id The ID of the organization (required) + * @param \Pipedrive\Model\UpdateOrganization|null $update_organization (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateOrganizationRequest($id, $update_organization = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateOrganization' + ); + } + + $resourcePath = '/organizations/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_organization)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_organization)); + } else { + $httpBody = $update_organization; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/PermissionSetsApi.php b/lib/Api/PermissionSetsApi.php new file mode 100644 index 00000000..5fa46851 --- /dev/null +++ b/lib/Api/PermissionSetsApi.php @@ -0,0 +1,1092 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getPermissionSet + * + * Get one permission set + * + * @param string $id The ID of the permission set (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SinglePermissionSetsItem|object + */ + public function getPermissionSet($id) + { + list($response) = $this->getPermissionSetWithHttpInfo($id); + return $response; + } + + /** + * Operation getPermissionSetWithHttpInfo + * + * Get one permission set + * + * @param string $id The ID of the permission set (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SinglePermissionSetsItem|object, HTTP status code, HTTP response headers (array of strings) + */ + public function getPermissionSetWithHttpInfo($id) + { + $request = $this->getPermissionSetRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPermissionSetRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SinglePermissionSetsItem' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SinglePermissionSetsItem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SinglePermissionSetsItem' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SinglePermissionSetsItem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SinglePermissionSetsItem', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPermissionSetAsync + * + * Get one permission set + * + * @param string $id The ID of the permission set (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPermissionSetAsync($id): PromiseInterface + { + return $this->getPermissionSetAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPermissionSetAsyncWithHttpInfo + * + * Get one permission set + * + * @param string $id The ID of the permission set (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPermissionSetAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\SinglePermissionSetsItem'; + $request = $this->getPermissionSetRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPermissionSet' + * + * @param string $id The ID of the permission set (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPermissionSetRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPermissionSet' + ); + } + + $resourcePath = '/permissionSets/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPermissionSetAssignments + * + * List permission set assignments + * + * @param string $id The ID of the permission set (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserAssignmentsToPermissionSet|object + */ + public function getPermissionSetAssignments($id, $start = 0, $limit = null) + { + list($response) = $this->getPermissionSetAssignmentsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getPermissionSetAssignmentsWithHttpInfo + * + * List permission set assignments + * + * @param string $id The ID of the permission set (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserAssignmentsToPermissionSet|object, HTTP status code, HTTP response headers (array of strings) + */ + public function getPermissionSetAssignmentsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getPermissionSetAssignmentsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPermissionSetAssignmentsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserAssignmentsToPermissionSet' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserAssignmentsToPermissionSet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserAssignmentsToPermissionSet' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserAssignmentsToPermissionSet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserAssignmentsToPermissionSet', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPermissionSetAssignmentsAsync + * + * List permission set assignments + * + * @param string $id The ID of the permission set (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPermissionSetAssignmentsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getPermissionSetAssignmentsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPermissionSetAssignmentsAsyncWithHttpInfo + * + * List permission set assignments + * + * @param string $id The ID of the permission set (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPermissionSetAssignmentsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserAssignmentsToPermissionSet'; + $request = $this->getPermissionSetAssignmentsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPermissionSetAssignments' + * + * @param string $id The ID of the permission set (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPermissionSetAssignmentsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPermissionSetAssignments' + ); + } + + $resourcePath = '/permissionSets/{id}/assignments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPermissionSets + * + * Get all permission sets + * + * @param string|null $app The app to filter the permission sets by (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PermissionSets + */ + public function getPermissionSets($app = null) + { + list($response) = $this->getPermissionSetsWithHttpInfo($app); + return $response; + } + + /** + * Operation getPermissionSetsWithHttpInfo + * + * Get all permission sets + * + * @param string|null $app The app to filter the permission sets by (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PermissionSets, HTTP status code, HTTP response headers (array of strings) + */ + public function getPermissionSetsWithHttpInfo($app = null) + { + $request = $this->getPermissionSetsRequest($app); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPermissionSetsRequest($app); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PermissionSets' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PermissionSets', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PermissionSets' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PermissionSets', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PermissionSets', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPermissionSetsAsync + * + * Get all permission sets + * + * @param string|null $app The app to filter the permission sets by (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPermissionSetsAsync($app = null): PromiseInterface + { + return $this->getPermissionSetsAsyncWithHttpInfo($app) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPermissionSetsAsyncWithHttpInfo + * + * Get all permission sets + * + * @param string|null $app The app to filter the permission sets by (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPermissionSetsAsyncWithHttpInfo($app = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PermissionSets'; + $request = $this->getPermissionSetsRequest($app); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPermissionSets' + * + * @param string|null $app The app to filter the permission sets by (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPermissionSetsRequest($app = null): Request + { + + $resourcePath = '/permissionSets'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($app)) { + $app = ObjectSerializer::serializeCollection($app, '', true); + } + if ($app !== null) { + $queryParams['app'] = $app; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/PersonFieldsApi.php b/lib/Api/PersonFieldsApi.php new file mode 100644 index 00000000..10ad9098 --- /dev/null +++ b/lib/Api/PersonFieldsApi.php @@ -0,0 +1,1927 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addPersonField + * + * Add a new person field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request field_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function addPersonField($field_create_request = null) + { + list($response) = $this->addPersonFieldWithHttpInfo($field_create_request); + return $response; + } + + /** + * Operation addPersonFieldWithHttpInfo + * + * Add a new person field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addPersonFieldWithHttpInfo($field_create_request = null) + { + $request = $this->addPersonFieldRequest($field_create_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addPersonFieldRequest($field_create_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addPersonFieldAsync + * + * Add a new person field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonFieldAsync($field_create_request = null): PromiseInterface + { + return $this->addPersonFieldAsyncWithHttpInfo($field_create_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addPersonFieldAsyncWithHttpInfo + * + * Add a new person field + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonFieldAsyncWithHttpInfo($field_create_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->addPersonFieldRequest($field_create_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addPersonField' + * + * @param \Pipedrive\Model\FieldCreateRequest|null $field_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addPersonFieldRequest($field_create_request = null): Request + { + + $resourcePath = '/personFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($field_create_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($field_create_request)); + } else { + $httpBody = $field_create_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePersonField + * + * Delete a person field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteResponse + */ + public function deletePersonField($id) + { + list($response) = $this->deletePersonFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation deletePersonFieldWithHttpInfo + * + * Delete a person field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePersonFieldWithHttpInfo($id) + { + $request = $this->deletePersonFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePersonFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePersonFieldAsync + * + * Delete a person field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonFieldAsync($id): PromiseInterface + { + return $this->deletePersonFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePersonFieldAsyncWithHttpInfo + * + * Delete a person field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteResponse'; + $request = $this->deletePersonFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePersonField' + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePersonFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePersonField' + ); + } + + $resourcePath = '/personFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePersonFields + * + * Delete multiple person fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\BulkDeleteResponse + */ + public function deletePersonFields($ids) + { + list($response) = $this->deletePersonFieldsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deletePersonFieldsWithHttpInfo + * + * Delete multiple person fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\BulkDeleteResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePersonFieldsWithHttpInfo($ids) + { + $request = $this->deletePersonFieldsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePersonFieldsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BulkDeleteResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BulkDeleteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\BulkDeleteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePersonFieldsAsync + * + * Delete multiple person fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonFieldsAsync($ids): PromiseInterface + { + return $this->deletePersonFieldsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePersonFieldsAsyncWithHttpInfo + * + * Delete multiple person fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonFieldsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\BulkDeleteResponse'; + $request = $this->deletePersonFieldsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePersonFields' + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePersonFieldsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deletePersonFields' + ); + } + + $resourcePath = '/personFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonField + * + * Get one person field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function getPersonField($id) + { + list($response) = $this->getPersonFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation getPersonFieldWithHttpInfo + * + * Get one person field + * + * @param int $id The ID of the field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonFieldWithHttpInfo($id) + { + $request = $this->getPersonFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonFieldAsync + * + * Get one person field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFieldAsync($id): PromiseInterface + { + return $this->getPersonFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonFieldAsyncWithHttpInfo + * + * Get one person field + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->getPersonFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonField' + * + * @param int $id The ID of the field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonField' + ); + } + + $resourcePath = '/personFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonFields + * + * Get all person fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldsResponse + */ + public function getPersonFields($start = 0, $limit = null) + { + list($response) = $this->getPersonFieldsWithHttpInfo($start, $limit); + return $response; + } + + /** + * Operation getPersonFieldsWithHttpInfo + * + * Get all person fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonFieldsWithHttpInfo($start = 0, $limit = null) + { + $request = $this->getPersonFieldsRequest($start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonFieldsRequest($start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonFieldsAsync + * + * Get all person fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFieldsAsync($start = 0, $limit = null): PromiseInterface + { + return $this->getPersonFieldsAsyncWithHttpInfo($start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonFieldsAsyncWithHttpInfo + * + * Get all person fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFieldsAsyncWithHttpInfo($start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldsResponse'; + $request = $this->getPersonFieldsRequest($start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonFields' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonFieldsRequest($start = 0, $limit = null): Request + { + + $resourcePath = '/personFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePersonField + * + * Update a person field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request field_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\FieldResponse + */ + public function updatePersonField($id, $field_update_request = null) + { + list($response) = $this->updatePersonFieldWithHttpInfo($id, $field_update_request); + return $response; + } + + /** + * Operation updatePersonFieldWithHttpInfo + * + * Update a person field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\FieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePersonFieldWithHttpInfo($id, $field_update_request = null) + { + $request = $this->updatePersonFieldRequest($id, $field_update_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updatePersonFieldRequest($id, $field_update_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePersonFieldAsync + * + * Update a person field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updatePersonFieldAsync($id, $field_update_request = null): PromiseInterface + { + return $this->updatePersonFieldAsyncWithHttpInfo($id, $field_update_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePersonFieldAsyncWithHttpInfo + * + * Update a person field + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updatePersonFieldAsyncWithHttpInfo($id, $field_update_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\FieldResponse'; + $request = $this->updatePersonFieldRequest($id, $field_update_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePersonField' + * + * @param int $id The ID of the field (required) + * @param \Pipedrive\Model\FieldUpdateRequest|null $field_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updatePersonFieldRequest($id, $field_update_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updatePersonField' + ); + } + + $resourcePath = '/personFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($field_update_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($field_update_request)); + } else { + $httpBody = $field_update_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/PersonsApi.php b/lib/Api/PersonsApi.php new file mode 100644 index 00000000..2c1544d7 --- /dev/null +++ b/lib/Api/PersonsApi.php @@ -0,0 +1,6527 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addPerson + * + * Add a person + * + * @param \Pipedrive\Model\NewPerson|null $new_person new_person (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddPersonResponse + */ + public function addPerson($new_person = null) + { + list($response) = $this->addPersonWithHttpInfo($new_person); + return $response; + } + + /** + * Operation addPersonWithHttpInfo + * + * Add a person + * + * @param \Pipedrive\Model\NewPerson|null $new_person (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddPersonResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addPersonWithHttpInfo($new_person = null) + { + $request = $this->addPersonRequest($new_person); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addPersonRequest($new_person); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddPersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddPersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddPersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddPersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddPersonResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addPersonAsync + * + * Add a person + * + * @param \Pipedrive\Model\NewPerson|null $new_person (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonAsync($new_person = null): PromiseInterface + { + return $this->addPersonAsyncWithHttpInfo($new_person) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addPersonAsyncWithHttpInfo + * + * Add a person + * + * @param \Pipedrive\Model\NewPerson|null $new_person (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonAsyncWithHttpInfo($new_person = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddPersonResponse'; + $request = $this->addPersonRequest($new_person); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addPerson' + * + * @param \Pipedrive\Model\NewPerson|null $new_person (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addPersonRequest($new_person = null): Request + { + + $resourcePath = '/persons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($new_person)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($new_person)); + } else { + $httpBody = $new_person; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addPersonFollower + * + * Add a follower to a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\AddPersonFollowerRequest|null $add_person_follower_request add_person_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddFollowerToPersonResponse + */ + public function addPersonFollower($id, $add_person_follower_request = null) + { + list($response) = $this->addPersonFollowerWithHttpInfo($id, $add_person_follower_request); + return $response; + } + + /** + * Operation addPersonFollowerWithHttpInfo + * + * Add a follower to a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\AddPersonFollowerRequest|null $add_person_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddFollowerToPersonResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addPersonFollowerWithHttpInfo($id, $add_person_follower_request = null) + { + $request = $this->addPersonFollowerRequest($id, $add_person_follower_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addPersonFollowerRequest($id, $add_person_follower_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddFollowerToPersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddFollowerToPersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddFollowerToPersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddFollowerToPersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddFollowerToPersonResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addPersonFollowerAsync + * + * Add a follower to a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\AddPersonFollowerRequest|null $add_person_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonFollowerAsync($id, $add_person_follower_request = null): PromiseInterface + { + return $this->addPersonFollowerAsyncWithHttpInfo($id, $add_person_follower_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addPersonFollowerAsyncWithHttpInfo + * + * Add a follower to a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\AddPersonFollowerRequest|null $add_person_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonFollowerAsyncWithHttpInfo($id, $add_person_follower_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddFollowerToPersonResponse'; + $request = $this->addPersonFollowerRequest($id, $add_person_follower_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addPersonFollower' + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\AddPersonFollowerRequest|null $add_person_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addPersonFollowerRequest($id, $add_person_follower_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addPersonFollower' + ); + } + + $resourcePath = '/persons/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_person_follower_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_person_follower_request)); + } else { + $httpBody = $add_person_follower_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addPersonPicture + * + * Add person picture + * + * @param int $id The ID of the person (required) + * @param \SplFileObject $file One image supplied in the multipart/form-data encoding (required) + * @param int|null $crop_x X coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_y Y coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_width The width of the cropping area (in pixels) (optional) + * @param int|null $crop_height The height of the cropping area (in pixels) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddPersonPictureResponse + */ + public function addPersonPicture($id, $file, $crop_x = null, $crop_y = null, $crop_width = null, $crop_height = null) + { + list($response) = $this->addPersonPictureWithHttpInfo($id, $file, $crop_x, $crop_y, $crop_width, $crop_height); + return $response; + } + + /** + * Operation addPersonPictureWithHttpInfo + * + * Add person picture + * + * @param int $id The ID of the person (required) + * @param \SplFileObject $file One image supplied in the multipart/form-data encoding (required) + * @param int|null $crop_x X coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_y Y coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_width The width of the cropping area (in pixels) (optional) + * @param int|null $crop_height The height of the cropping area (in pixels) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddPersonPictureResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addPersonPictureWithHttpInfo($id, $file, $crop_x = null, $crop_y = null, $crop_width = null, $crop_height = null) + { + $request = $this->addPersonPictureRequest($id, $file, $crop_x, $crop_y, $crop_width, $crop_height); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addPersonPictureRequest($id, $file, $crop_x, $crop_y, $crop_width, $crop_height); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddPersonPictureResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddPersonPictureResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddPersonPictureResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddPersonPictureResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddPersonPictureResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addPersonPictureAsync + * + * Add person picture + * + * @param int $id The ID of the person (required) + * @param \SplFileObject $file One image supplied in the multipart/form-data encoding (required) + * @param int|null $crop_x X coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_y Y coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_width The width of the cropping area (in pixels) (optional) + * @param int|null $crop_height The height of the cropping area (in pixels) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonPictureAsync($id, $file, $crop_x = null, $crop_y = null, $crop_width = null, $crop_height = null): PromiseInterface + { + return $this->addPersonPictureAsyncWithHttpInfo($id, $file, $crop_x, $crop_y, $crop_width, $crop_height) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addPersonPictureAsyncWithHttpInfo + * + * Add person picture + * + * @param int $id The ID of the person (required) + * @param \SplFileObject $file One image supplied in the multipart/form-data encoding (required) + * @param int|null $crop_x X coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_y Y coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_width The width of the cropping area (in pixels) (optional) + * @param int|null $crop_height The height of the cropping area (in pixels) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPersonPictureAsyncWithHttpInfo($id, $file, $crop_x = null, $crop_y = null, $crop_width = null, $crop_height = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddPersonPictureResponse'; + $request = $this->addPersonPictureRequest($id, $file, $crop_x, $crop_y, $crop_width, $crop_height); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addPersonPicture' + * + * @param int $id The ID of the person (required) + * @param \SplFileObject $file One image supplied in the multipart/form-data encoding (required) + * @param int|null $crop_x X coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_y Y coordinate to where start cropping form (in pixels) (optional) + * @param int|null $crop_width The width of the cropping area (in pixels) (optional) + * @param int|null $crop_height The height of the cropping area (in pixels) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addPersonPictureRequest($id, $file, $crop_x = null, $crop_y = null, $crop_width = null, $crop_height = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addPersonPicture' + ); + } + // verify the required parameter 'file' is set + /* @phpstan-ignore-next-line */ + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling addPersonPicture' + ); + } + + $resourcePath = '/persons/{id}/picture'; + $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'] = []; + /* @phpstan-ignore-next-line */ + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + // form params + if ($crop_x !== null) { + $formParams['crop_x'] = ObjectSerializer::toFormValue($crop_x); + } + // form params + if ($crop_y !== null) { + $formParams['crop_y'] = ObjectSerializer::toFormValue($crop_y); + } + // form params + if ($crop_width !== null) { + $formParams['crop_width'] = ObjectSerializer::toFormValue($crop_width); + } + // form params + if ($crop_height !== null) { + $formParams['crop_height'] = ObjectSerializer::toFormValue($crop_height); + } + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePerson + * + * Delete a person + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeletePersonResponse + */ + public function deletePerson($id) + { + list($response) = $this->deletePersonWithHttpInfo($id); + return $response; + } + + /** + * Operation deletePersonWithHttpInfo + * + * Delete a person + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeletePersonResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePersonWithHttpInfo($id) + { + $request = $this->deletePersonRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePersonRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeletePersonResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePersonAsync + * + * Delete a person + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonAsync($id): PromiseInterface + { + return $this->deletePersonAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePersonAsyncWithHttpInfo + * + * Delete a person + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeletePersonResponse'; + $request = $this->deletePersonRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePerson' + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePersonRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePerson' + ); + } + + $resourcePath = '/persons/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePersonFollower + * + * Delete a follower from a person + * + * @param int $id The ID of the person (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeletePersonResponse + */ + public function deletePersonFollower($id, $follower_id) + { + list($response) = $this->deletePersonFollowerWithHttpInfo($id, $follower_id); + return $response; + } + + /** + * Operation deletePersonFollowerWithHttpInfo + * + * Delete a follower from a person + * + * @param int $id The ID of the person (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeletePersonResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePersonFollowerWithHttpInfo($id, $follower_id) + { + $request = $this->deletePersonFollowerRequest($id, $follower_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePersonFollowerRequest($id, $follower_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeletePersonResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePersonFollowerAsync + * + * Delete a follower from a person + * + * @param int $id The ID of the person (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonFollowerAsync($id, $follower_id): PromiseInterface + { + return $this->deletePersonFollowerAsyncWithHttpInfo($id, $follower_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePersonFollowerAsyncWithHttpInfo + * + * Delete a follower from a person + * + * @param int $id The ID of the person (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonFollowerAsyncWithHttpInfo($id, $follower_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeletePersonResponse'; + $request = $this->deletePersonFollowerRequest($id, $follower_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePersonFollower' + * + * @param int $id The ID of the person (required) + * @param int $follower_id The ID of the follower (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePersonFollowerRequest($id, $follower_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePersonFollower' + ); + } + // verify the required parameter 'follower_id' is set + /* @phpstan-ignore-next-line */ + if ($follower_id === null || (is_array($follower_id) && count($follower_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $follower_id when calling deletePersonFollower' + ); + } + + $resourcePath = '/persons/{id}/followers/{follower_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($follower_id !== null) { + $resourcePath = str_replace( + '{' . 'follower_id' . '}', + ObjectSerializer::toPathValue($follower_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePersonPicture + * + * Delete person picture + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeletePersonResponse + */ + public function deletePersonPicture($id) + { + list($response) = $this->deletePersonPictureWithHttpInfo($id); + return $response; + } + + /** + * Operation deletePersonPictureWithHttpInfo + * + * Delete person picture + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeletePersonResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePersonPictureWithHttpInfo($id) + { + $request = $this->deletePersonPictureRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePersonPictureRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeletePersonResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePersonPictureAsync + * + * Delete person picture + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonPictureAsync($id): PromiseInterface + { + return $this->deletePersonPictureAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePersonPictureAsyncWithHttpInfo + * + * Delete person picture + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonPictureAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeletePersonResponse'; + $request = $this->deletePersonPictureRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePersonPicture' + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePersonPictureRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePersonPicture' + ); + } + + $resourcePath = '/persons/{id}/picture'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePersons + * + * Delete multiple persons in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeletePersonsInBulkResponse + */ + public function deletePersons($ids) + { + list($response) = $this->deletePersonsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deletePersonsWithHttpInfo + * + * Delete multiple persons in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeletePersonsInBulkResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePersonsWithHttpInfo($ids) + { + $request = $this->deletePersonsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePersonsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonsInBulkResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonsInBulkResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePersonsInBulkResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePersonsInBulkResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeletePersonsInBulkResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePersonsAsync + * + * Delete multiple persons in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonsAsync($ids): PromiseInterface + { + return $this->deletePersonsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePersonsAsyncWithHttpInfo + * + * Delete multiple persons in bulk + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePersonsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeletePersonsInBulkResponse'; + $request = $this->deletePersonsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePersons' + * + * @param string $ids The comma-separated IDs that will be deleted (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePersonsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deletePersons' + ); + } + + $resourcePath = '/persons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPerson + * + * Get details of a person + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetPersonDetailsResponse + */ + public function getPerson($id) + { + list($response) = $this->getPersonWithHttpInfo($id); + return $response; + } + + /** + * Operation getPersonWithHttpInfo + * + * Get details of a person + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetPersonDetailsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonWithHttpInfo($id) + { + $request = $this->getPersonRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetPersonDetailsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetPersonDetailsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetPersonDetailsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetPersonDetailsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetPersonDetailsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonAsync + * + * Get details of a person + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonAsync($id): PromiseInterface + { + return $this->getPersonAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonAsyncWithHttpInfo + * + * Get details of a person + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetPersonDetailsResponse'; + $request = $this->getPersonRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPerson' + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPerson' + ); + } + + $resourcePath = '/persons/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonActivities + * + * List activities associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListActivitiesResponse + */ + public function getPersonActivities($id, $start = 0, $limit = null, $done = null, $exclude = null) + { + list($response) = $this->getPersonActivitiesWithHttpInfo($id, $start, $limit, $done, $exclude); + return $response; + } + + /** + * Operation getPersonActivitiesWithHttpInfo + * + * List activities associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListActivitiesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonActivitiesWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null) + { + $request = $this->getPersonActivitiesRequest($id, $start, $limit, $done, $exclude); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonActivitiesRequest($id, $start, $limit, $done, $exclude); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListActivitiesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListActivitiesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListActivitiesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListActivitiesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListActivitiesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonActivitiesAsync + * + * List activities associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonActivitiesAsync($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface + { + return $this->getPersonActivitiesAsyncWithHttpInfo($id, $start, $limit, $done, $exclude) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonActivitiesAsyncWithHttpInfo + * + * List activities associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonActivitiesAsyncWithHttpInfo($id, $start = 0, $limit = null, $done = null, $exclude = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListActivitiesResponse'; + $request = $this->getPersonActivitiesRequest($id, $start, $limit, $done, $exclude); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonActivities' + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both Done and Not done activities. (optional) + * @param string|null $exclude A comma-separated string of activity IDs to exclude from result (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonActivitiesRequest($id, $start = 0, $limit = null, $done = null, $exclude = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonActivities' + ); + } + + $resourcePath = '/persons/{id}/activities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($done)) { + $done = ObjectSerializer::serializeCollection($done, '', true); + } + if ($done !== null) { + $queryParams['done'] = $done; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exclude)) { + $exclude = ObjectSerializer::serializeCollection($exclude, '', true); + } + if ($exclude !== null) { + $queryParams['exclude'] = $exclude; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonDeals + * + * List deals associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListDealsResponse + */ + public function getPersonDeals($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null) + { + list($response) = $this->getPersonDealsWithHttpInfo($id, $start, $limit, $status, $sort); + return $response; + } + + /** + * Operation getPersonDealsWithHttpInfo + * + * List deals associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListDealsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonDealsWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null) + { + $request = $this->getPersonDealsRequest($id, $start, $limit, $status, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonDealsRequest($id, $start, $limit, $status, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListDealsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListDealsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListDealsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListDealsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListDealsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonDealsAsync + * + * List deals associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonDealsAsync($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null): PromiseInterface + { + return $this->getPersonDealsAsyncWithHttpInfo($id, $start, $limit, $status, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonDealsAsyncWithHttpInfo + * + * List deals associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonDealsAsyncWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListDealsResponse'; + $request = $this->getPersonDealsRequest($id, $start, $limit, $status, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonDeals' + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonDealsRequest($id, $start = 0, $limit = null, $status = 'all_not_deleted', $sort = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonDeals' + ); + } + + $resourcePath = '/persons/{id}/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonFiles + * + * List files attached to a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListFilesResponse + */ + public function getPersonFiles($id, $start = 0, $limit = null, $sort = null) + { + list($response) = $this->getPersonFilesWithHttpInfo($id, $start, $limit, $sort); + return $response; + } + + /** + * Operation getPersonFilesWithHttpInfo + * + * List files attached to a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListFilesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonFilesWithHttpInfo($id, $start = 0, $limit = null, $sort = null) + { + $request = $this->getPersonFilesRequest($id, $start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonFilesRequest($id, $start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListFilesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonFilesAsync + * + * List files attached to a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFilesAsync($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getPersonFilesAsyncWithHttpInfo($id, $start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonFilesAsyncWithHttpInfo + * + * List files attached to a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFilesAsyncWithHttpInfo($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListFilesResponse'; + $request = $this->getPersonFilesRequest($id, $start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonFiles' + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `product_id`, `add_time`, `update_time`, `file_name`, `file_type`, `file_size`, `comment`. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonFilesRequest($id, $start = 0, $limit = null, $sort = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonFiles' + ); + } + + $resourcePath = '/persons/{id}/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonFollowers + * + * List followers of a person + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListFollowersResponse + */ + public function getPersonFollowers($id) + { + list($response) = $this->getPersonFollowersWithHttpInfo($id); + return $response; + } + + /** + * Operation getPersonFollowersWithHttpInfo + * + * List followers of a person + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListFollowersResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonFollowersWithHttpInfo($id) + { + $request = $this->getPersonFollowersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonFollowersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFollowersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFollowersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListFollowersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListFollowersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListFollowersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonFollowersAsync + * + * List followers of a person + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFollowersAsync($id): PromiseInterface + { + return $this->getPersonFollowersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonFollowersAsyncWithHttpInfo + * + * List followers of a person + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonFollowersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListFollowersResponse'; + $request = $this->getPersonFollowersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonFollowers' + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonFollowersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonFollowers' + ); + } + + $resourcePath = '/persons/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonMailMessages + * + * List mail messages associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListMailMessagesResponse + */ + public function getPersonMailMessages($id, $start = 0, $limit = null) + { + list($response) = $this->getPersonMailMessagesWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getPersonMailMessagesWithHttpInfo + * + * List mail messages associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonMailMessagesWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getPersonMailMessagesRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonMailMessagesRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListMailMessagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListMailMessagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListMailMessagesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListMailMessagesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListMailMessagesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonMailMessagesAsync + * + * List mail messages associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getPersonMailMessagesAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonMailMessagesAsyncWithHttpInfo + * + * List mail messages associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListMailMessagesResponse'; + $request = $this->getPersonMailMessagesRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonMailMessages' + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonMailMessagesRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonMailMessages' + ); + } + + $resourcePath = '/persons/{id}/mailMessages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonProducts + * + * List products associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListPersonProductsResponse + */ + public function getPersonProducts($id, $start = 0, $limit = null) + { + list($response) = $this->getPersonProductsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getPersonProductsWithHttpInfo + * + * List products associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListPersonProductsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonProductsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getPersonProductsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonProductsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPersonProductsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPersonProductsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPersonProductsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPersonProductsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListPersonProductsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonProductsAsync + * + * List products associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonProductsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getPersonProductsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonProductsAsyncWithHttpInfo + * + * List products associated with a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonProductsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListPersonProductsResponse'; + $request = $this->getPersonProductsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonProducts' + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonProductsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonProducts' + ); + } + + $resourcePath = '/persons/{id}/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonUpdates + * + * List updates about a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PersonFlowResponse + */ + public function getPersonUpdates($id, $start = 0, $limit = null, $all_changes = null, $items = null) + { + list($response) = $this->getPersonUpdatesWithHttpInfo($id, $start, $limit, $all_changes, $items); + return $response; + } + + /** + * Operation getPersonUpdatesWithHttpInfo + * + * List updates about a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PersonFlowResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonUpdatesWithHttpInfo($id, $start = 0, $limit = null, $all_changes = null, $items = null) + { + $request = $this->getPersonUpdatesRequest($id, $start, $limit, $all_changes, $items); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonUpdatesRequest($id, $start, $limit, $all_changes, $items); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PersonFlowResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PersonFlowResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PersonFlowResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PersonFlowResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PersonFlowResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonUpdatesAsync + * + * List updates about a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonUpdatesAsync($id, $start = 0, $limit = null, $all_changes = null, $items = null): PromiseInterface + { + return $this->getPersonUpdatesAsyncWithHttpInfo($id, $start, $limit, $all_changes, $items) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonUpdatesAsyncWithHttpInfo + * + * List updates about a person + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonUpdatesAsyncWithHttpInfo($id, $start = 0, $limit = null, $all_changes = null, $items = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PersonFlowResponse'; + $request = $this->getPersonUpdatesRequest($id, $start, $limit, $all_changes, $items); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonUpdates' + * + * @param int $id The ID of the person (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $all_changes Whether to show custom field updates or not. 1 = Include custom field changes. If omitted returns changes without custom field updates. (optional) + * @param string|null $items A comma-separated string for filtering out item specific updates. (Possible values - call, activity, plannedActivity, change, note, deal, file, dealChange, personChange, organizationChange, follower, dealFollower, personFollower, organizationFollower, participant, comment, mailMessage, mailMessageWithAttachment, invoice, document, marketing_campaign_stat, marketing_status_change) (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonUpdatesRequest($id, $start = 0, $limit = null, $all_changes = null, $items = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonUpdates' + ); + } + + $resourcePath = '/persons/{id}/flow'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($all_changes)) { + $all_changes = ObjectSerializer::serializeCollection($all_changes, '', true); + } + if ($all_changes !== null) { + $queryParams['all_changes'] = $all_changes; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($items)) { + $items = ObjectSerializer::serializeCollection($items, '', true); + } + if ($items !== null) { + $queryParams['items'] = $items; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersonUsers + * + * List permitted users + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListPermittedUsersResponse1 + */ + public function getPersonUsers($id) + { + list($response) = $this->getPersonUsersWithHttpInfo($id); + return $response; + } + + /** + * Operation getPersonUsersWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the person (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListPermittedUsersResponse1, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonUsersWithHttpInfo($id) + { + $request = $this->getPersonUsersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonUsersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPermittedUsersResponse1' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPermittedUsersResponse1', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListPermittedUsersResponse1' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListPermittedUsersResponse1', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListPermittedUsersResponse1', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonUsersAsync + * + * List permitted users + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonUsersAsync($id): PromiseInterface + { + return $this->getPersonUsersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonUsersAsyncWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonUsersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListPermittedUsersResponse1'; + $request = $this->getPersonUsersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersonUsers' + * + * @param int $id The ID of the person (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonUsersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPersonUsers' + ); + } + + $resourcePath = '/persons/{id}/permittedUsers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPersons + * + * Get all persons + * + * @param int|null $user_id If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAllPersonsResponse + */ + public function getPersons($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) + { + list($response) = $this->getPersonsWithHttpInfo($user_id, $filter_id, $first_char, $start, $limit, $sort); + return $response; + } + + /** + * Operation getPersonsWithHttpInfo + * + * Get all persons + * + * @param int|null $user_id If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAllPersonsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPersonsWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null) + { + $request = $this->getPersonsRequest($user_id, $filter_id, $first_char, $start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPersonsRequest($user_id, $filter_id, $first_char, $start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllPersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllPersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllPersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllPersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAllPersonsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPersonsAsync + * + * Get all persons + * + * @param int|null $user_id If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonsAsync($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getPersonsAsyncWithHttpInfo($user_id, $filter_id, $first_char, $start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPersonsAsyncWithHttpInfo + * + * Get all persons + * + * @param int|null $user_id If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPersonsAsyncWithHttpInfo($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAllPersonsResponse'; + $request = $this->getPersonsRequest($user_id, $filter_id, $first_char, $start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPersons' + * + * @param int|null $user_id If supplied, only persons owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied. (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param string|null $first_char If supplied, only persons whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPersonsRequest($user_id = null, $filter_id = null, $first_char = null, $start = 0, $limit = null, $sort = null): Request + { + + $resourcePath = '/persons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($first_char)) { + $first_char = ObjectSerializer::serializeCollection($first_char, '', true); + } + if ($first_char !== null) { + $queryParams['first_char'] = $first_char; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation mergePersons + * + * Merge two persons + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\MergePersonsRequest|null $merge_persons_request merge_persons_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\MergePersonsResponse + */ + public function mergePersons($id, $merge_persons_request = null) + { + list($response) = $this->mergePersonsWithHttpInfo($id, $merge_persons_request); + return $response; + } + + /** + * Operation mergePersonsWithHttpInfo + * + * Merge two persons + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\MergePersonsRequest|null $merge_persons_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\MergePersonsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function mergePersonsWithHttpInfo($id, $merge_persons_request = null) + { + $request = $this->mergePersonsRequest($id, $merge_persons_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->mergePersonsRequest($id, $merge_persons_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MergePersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MergePersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\MergePersonsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\MergePersonsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\MergePersonsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mergePersonsAsync + * + * Merge two persons + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\MergePersonsRequest|null $merge_persons_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function mergePersonsAsync($id, $merge_persons_request = null): PromiseInterface + { + return $this->mergePersonsAsyncWithHttpInfo($id, $merge_persons_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mergePersonsAsyncWithHttpInfo + * + * Merge two persons + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\MergePersonsRequest|null $merge_persons_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function mergePersonsAsyncWithHttpInfo($id, $merge_persons_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\MergePersonsResponse'; + $request = $this->mergePersonsRequest($id, $merge_persons_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'mergePersons' + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\MergePersonsRequest|null $merge_persons_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function mergePersonsRequest($id, $merge_persons_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling mergePersons' + ); + } + + $resourcePath = '/persons/{id}/merge'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($merge_persons_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($merge_persons_request)); + } else { + $httpBody = $merge_persons_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchPersons + * + * Search persons + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $organization_id Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PersonSearchResponse + */ + public function searchPersons($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null) + { + list($response) = $this->searchPersonsWithHttpInfo($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit); + return $response; + } + + /** + * Operation searchPersonsWithHttpInfo + * + * Search persons + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $organization_id Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PersonSearchResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchPersonsWithHttpInfo($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null) + { + $request = $this->searchPersonsRequest($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchPersonsRequest($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PersonSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PersonSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PersonSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PersonSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PersonSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchPersonsAsync + * + * Search persons + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $organization_id Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchPersonsAsync($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + return $this->searchPersonsAsyncWithHttpInfo($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchPersonsAsyncWithHttpInfo + * + * Search persons + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $organization_id Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchPersonsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PersonSearchResponse'; + $request = $this->searchPersonsRequest($term, $fields, $exact_match, $organization_id, $include_fields, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchPersons' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param int|null $organization_id Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchPersonsRequest($term, $fields = null, $exact_match = null, $organization_id = null, $include_fields = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchPersons' + ); + } + + $resourcePath = '/persons/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($fields)) { + $fields = ObjectSerializer::serializeCollection($fields, '', true); + } + if ($fields !== null) { + $queryParams['fields'] = $fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($organization_id)) { + $organization_id = ObjectSerializer::serializeCollection($organization_id, '', true); + } + if ($organization_id !== null) { + $queryParams['organization_id'] = $organization_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_fields)) { + $include_fields = ObjectSerializer::serializeCollection($include_fields, '', true); + } + if ($include_fields !== null) { + $queryParams['include_fields'] = $include_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePerson + * + * Update a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\UpdatePerson|null $update_person update_person (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UpdatePersonResponse + */ + public function updatePerson($id, $update_person = null) + { + list($response) = $this->updatePersonWithHttpInfo($id, $update_person); + return $response; + } + + /** + * Operation updatePersonWithHttpInfo + * + * Update a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\UpdatePerson|null $update_person (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UpdatePersonResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePersonWithHttpInfo($id, $update_person = null) + { + $request = $this->updatePersonRequest($id, $update_person); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updatePersonRequest($id, $update_person); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdatePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdatePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdatePersonResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdatePersonResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UpdatePersonResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePersonAsync + * + * Update a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\UpdatePerson|null $update_person (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updatePersonAsync($id, $update_person = null): PromiseInterface + { + return $this->updatePersonAsyncWithHttpInfo($id, $update_person) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePersonAsyncWithHttpInfo + * + * Update a person + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\UpdatePerson|null $update_person (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updatePersonAsyncWithHttpInfo($id, $update_person = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UpdatePersonResponse'; + $request = $this->updatePersonRequest($id, $update_person); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePerson' + * + * @param int $id The ID of the person (required) + * @param \Pipedrive\Model\UpdatePerson|null $update_person (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updatePersonRequest($id, $update_person = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updatePerson' + ); + } + + $resourcePath = '/persons/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_person)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_person)); + } else { + $httpBody = $update_person; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/PipelinesApi.php b/lib/Api/PipelinesApi.php new file mode 100644 index 00000000..43c2c3ac --- /dev/null +++ b/lib/Api/PipelinesApi.php @@ -0,0 +1,2716 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addPipeline + * + * Add a new pipeline + * + * @param \Pipedrive\Model\Pipeline|null $pipeline pipeline (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\AddNewPipeline + */ + public function addPipeline($pipeline = null) + { + list($response) = $this->addPipelineWithHttpInfo($pipeline); + return $response; + } + + /** + * Operation addPipelineWithHttpInfo + * + * Add a new pipeline + * + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\AddNewPipeline, HTTP status code, HTTP response headers (array of strings) + */ + public function addPipelineWithHttpInfo($pipeline = null) + { + $request = $this->addPipelineRequest($pipeline); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addPipelineRequest($pipeline); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddNewPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddNewPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\AddNewPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\AddNewPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\AddNewPipeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addPipelineAsync + * + * Add a new pipeline + * + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPipelineAsync($pipeline = null): PromiseInterface + { + return $this->addPipelineAsyncWithHttpInfo($pipeline) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addPipelineAsyncWithHttpInfo + * + * Add a new pipeline + * + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addPipelineAsyncWithHttpInfo($pipeline = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\AddNewPipeline'; + $request = $this->addPipelineRequest($pipeline); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addPipeline' + * + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addPipelineRequest($pipeline = null): Request + { + + $resourcePath = '/pipelines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($pipeline)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pipeline)); + } else { + $httpBody = $pipeline; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePipeline + * + * Delete a pipeline + * + * @param int $id The ID of the pipeline (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeletePipelineResponse200 + */ + public function deletePipeline($id) + { + list($response) = $this->deletePipelineWithHttpInfo($id); + return $response; + } + + /** + * Operation deletePipelineWithHttpInfo + * + * Delete a pipeline + * + * @param int $id The ID of the pipeline (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeletePipelineResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePipelineWithHttpInfo($id) + { + $request = $this->deletePipelineRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deletePipelineRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePipelineResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePipelineResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeletePipelineResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeletePipelineResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeletePipelineResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePipelineAsync + * + * Delete a pipeline + * + * @param int $id The ID of the pipeline (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePipelineAsync($id): PromiseInterface + { + return $this->deletePipelineAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePipelineAsyncWithHttpInfo + * + * Delete a pipeline + * + * @param int $id The ID of the pipeline (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deletePipelineAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeletePipelineResponse200'; + $request = $this->deletePipelineRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePipeline' + * + * @param int $id The ID of the pipeline (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deletePipelineRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePipeline' + ); + } + + $resourcePath = '/pipelines/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPipeline + * + * Get one pipeline + * + * @param int $id The ID of the pipeline (required) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetOnePipeline + */ + public function getPipeline($id, $totals_convert_currency = null) + { + list($response) = $this->getPipelineWithHttpInfo($id, $totals_convert_currency); + return $response; + } + + /** + * Operation getPipelineWithHttpInfo + * + * Get one pipeline + * + * @param int $id The ID of the pipeline (required) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetOnePipeline, HTTP status code, HTTP response headers (array of strings) + */ + public function getPipelineWithHttpInfo($id, $totals_convert_currency = null) + { + $request = $this->getPipelineRequest($id, $totals_convert_currency); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPipelineRequest($id, $totals_convert_currency); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetOnePipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetOnePipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetOnePipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetOnePipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetOnePipeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPipelineAsync + * + * Get one pipeline + * + * @param int $id The ID of the pipeline (required) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineAsync($id, $totals_convert_currency = null): PromiseInterface + { + return $this->getPipelineAsyncWithHttpInfo($id, $totals_convert_currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPipelineAsyncWithHttpInfo + * + * Get one pipeline + * + * @param int $id The ID of the pipeline (required) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineAsyncWithHttpInfo($id, $totals_convert_currency = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetOnePipeline'; + $request = $this->getPipelineRequest($id, $totals_convert_currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPipeline' + * + * @param int $id The ID of the pipeline (required) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned in `deals_summary` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPipelineRequest($id, $totals_convert_currency = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPipeline' + ); + } + + $resourcePath = '/pipelines/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($totals_convert_currency)) { + $totals_convert_currency = ObjectSerializer::serializeCollection($totals_convert_currency, '', true); + } + if ($totals_convert_currency !== null) { + $queryParams['totals_convert_currency'] = $totals_convert_currency; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPipelineConversionStatistics + * + * Get deals conversion rates in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDealsConversionRatesInPipeline + */ + public function getPipelineConversionStatistics($id, $start_date, $end_date, $user_id = null) + { + list($response) = $this->getPipelineConversionStatisticsWithHttpInfo($id, $start_date, $end_date, $user_id); + return $response; + } + + /** + * Operation getPipelineConversionStatisticsWithHttpInfo + * + * Get deals conversion rates in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDealsConversionRatesInPipeline, HTTP status code, HTTP response headers (array of strings) + */ + public function getPipelineConversionStatisticsWithHttpInfo($id, $start_date, $end_date, $user_id = null) + { + $request = $this->getPipelineConversionStatisticsRequest($id, $start_date, $end_date, $user_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPipelineConversionStatisticsRequest($id, $start_date, $end_date, $user_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsConversionRatesInPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsConversionRatesInPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsConversionRatesInPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsConversionRatesInPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDealsConversionRatesInPipeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPipelineConversionStatisticsAsync + * + * Get deals conversion rates in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineConversionStatisticsAsync($id, $start_date, $end_date, $user_id = null): PromiseInterface + { + return $this->getPipelineConversionStatisticsAsyncWithHttpInfo($id, $start_date, $end_date, $user_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPipelineConversionStatisticsAsyncWithHttpInfo + * + * Get deals conversion rates in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineConversionStatisticsAsyncWithHttpInfo($id, $start_date, $end_date, $user_id = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDealsConversionRatesInPipeline'; + $request = $this->getPipelineConversionStatisticsRequest($id, $start_date, $end_date, $user_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPipelineConversionStatistics' + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPipelineConversionStatisticsRequest($id, $start_date, $end_date, $user_id = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPipelineConversionStatistics' + ); + } + // verify the required parameter 'start_date' is set + /* @phpstan-ignore-next-line */ + if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_date when calling getPipelineConversionStatistics' + ); + } + // verify the required parameter 'end_date' is set + /* @phpstan-ignore-next-line */ + if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $end_date when calling getPipelineConversionStatistics' + ); + } + + $resourcePath = '/pipelines/{id}/conversion_statistics'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start_date)) { + $start_date = ObjectSerializer::serializeCollection($start_date, '', true); + } + if ($start_date !== null) { + $queryParams['start_date'] = $start_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($end_date)) { + $end_date = ObjectSerializer::serializeCollection($end_date, '', true); + } + if ($end_date !== null) { + $queryParams['end_date'] = $end_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPipelineDeals + * + * Get deals in a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $get_summary Whether to include a summary of the pipeline in the `additional_data` or not (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetStageDeals + */ + public function getPipelineDeals($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null) + { + list($response) = $this->getPipelineDealsWithHttpInfo($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency); + return $response; + } + + /** + * Operation getPipelineDealsWithHttpInfo + * + * Get deals in a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $get_summary Whether to include a summary of the pipeline in the `additional_data` or not (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetStageDeals, HTTP status code, HTTP response headers (array of strings) + */ + public function getPipelineDealsWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null) + { + $request = $this->getPipelineDealsRequest($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPipelineDealsRequest($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetStageDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetStageDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetStageDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetStageDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetStageDeals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPipelineDealsAsync + * + * Get deals in a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $get_summary Whether to include a summary of the pipeline in the `additional_data` or not (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineDealsAsync($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null): PromiseInterface + { + return $this->getPipelineDealsAsyncWithHttpInfo($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPipelineDealsAsyncWithHttpInfo + * + * Get deals in a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $get_summary Whether to include a summary of the pipeline in the `additional_data` or not (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineDealsAsyncWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetStageDeals'; + $request = $this->getPipelineDealsRequest($id, $filter_id, $user_id, $everyone, $stage_id, $start, $limit, $get_summary, $totals_convert_currency); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPipelineDeals' + * + * @param int $id The ID of the pipeline (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|null $stage_id If supplied, only deals within the given stage will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param \Pipedrive\Model\NumberBoolean|null $get_summary Whether to include a summary of the pipeline in the `additional_data` or not (optional) + * @param string|null $totals_convert_currency The 3-letter currency code of any of the supported currencies. When supplied, `per_stages_converted` is returned inside `deals_summary` inside `additional_data` which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to `default_currency` in which case users default currency is used. Only works when `get_summary` parameter flag is enabled. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPipelineDealsRequest($id, $filter_id = null, $user_id = null, $everyone = null, $stage_id = null, $start = 0, $limit = null, $get_summary = null, $totals_convert_currency = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPipelineDeals' + ); + } + + $resourcePath = '/pipelines/{id}/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($everyone)) { + $everyone = ObjectSerializer::serializeCollection($everyone, '', true); + } + if ($everyone !== null) { + $queryParams['everyone'] = $everyone; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($stage_id)) { + $stage_id = ObjectSerializer::serializeCollection($stage_id, '', true); + } + if ($stage_id !== null) { + $queryParams['stage_id'] = $stage_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($get_summary)) { + $get_summary = ObjectSerializer::serializeCollection($get_summary, '', true); + } + if ($get_summary !== null) { + $queryParams['get_summary'] = $get_summary; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($totals_convert_currency)) { + $totals_convert_currency = ObjectSerializer::serializeCollection($totals_convert_currency, '', true); + } + if ($totals_convert_currency !== null) { + $queryParams['totals_convert_currency'] = $totals_convert_currency; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPipelineMovementStatistics + * + * Get deals movements in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetDealsMovementsInPipeline + */ + public function getPipelineMovementStatistics($id, $start_date, $end_date, $user_id = null) + { + list($response) = $this->getPipelineMovementStatisticsWithHttpInfo($id, $start_date, $end_date, $user_id); + return $response; + } + + /** + * Operation getPipelineMovementStatisticsWithHttpInfo + * + * Get deals movements in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetDealsMovementsInPipeline, HTTP status code, HTTP response headers (array of strings) + */ + public function getPipelineMovementStatisticsWithHttpInfo($id, $start_date, $end_date, $user_id = null) + { + $request = $this->getPipelineMovementStatisticsRequest($id, $start_date, $end_date, $user_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPipelineMovementStatisticsRequest($id, $start_date, $end_date, $user_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsMovementsInPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsMovementsInPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetDealsMovementsInPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetDealsMovementsInPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetDealsMovementsInPipeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPipelineMovementStatisticsAsync + * + * Get deals movements in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineMovementStatisticsAsync($id, $start_date, $end_date, $user_id = null): PromiseInterface + { + return $this->getPipelineMovementStatisticsAsyncWithHttpInfo($id, $start_date, $end_date, $user_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPipelineMovementStatisticsAsyncWithHttpInfo + * + * Get deals movements in pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelineMovementStatisticsAsyncWithHttpInfo($id, $start_date, $end_date, $user_id = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetDealsMovementsInPipeline'; + $request = $this->getPipelineMovementStatisticsRequest($id, $start_date, $end_date, $user_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPipelineMovementStatistics' + * + * @param int $id The ID of the pipeline (required) + * @param \DateTime $start_date The start of the period. Date in format of YYYY-MM-DD. (required) + * @param \DateTime $end_date The end of the period. Date in format of YYYY-MM-DD. (required) + * @param int|null $user_id The ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPipelineMovementStatisticsRequest($id, $start_date, $end_date, $user_id = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPipelineMovementStatistics' + ); + } + // verify the required parameter 'start_date' is set + /* @phpstan-ignore-next-line */ + if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_date when calling getPipelineMovementStatistics' + ); + } + // verify the required parameter 'end_date' is set + /* @phpstan-ignore-next-line */ + if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $end_date when calling getPipelineMovementStatistics' + ); + } + + $resourcePath = '/pipelines/{id}/movement_statistics'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start_date)) { + $start_date = ObjectSerializer::serializeCollection($start_date, '', true); + } + if ($start_date !== null) { + $queryParams['start_date'] = $start_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($end_date)) { + $end_date = ObjectSerializer::serializeCollection($end_date, '', true); + } + if ($end_date !== null) { + $queryParams['end_date'] = $end_date; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPipelines + * + * Get all pipelines + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAllPipelines + */ + public function getPipelines() + { + list($response) = $this->getPipelinesWithHttpInfo(); + return $response; + } + + /** + * Operation getPipelinesWithHttpInfo + * + * Get all pipelines + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAllPipelines, HTTP status code, HTTP response headers (array of strings) + */ + public function getPipelinesWithHttpInfo() + { + $request = $this->getPipelinesRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getPipelinesRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllPipelines' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllPipelines', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllPipelines' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllPipelines', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAllPipelines', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPipelinesAsync + * + * Get all pipelines + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelinesAsync(): PromiseInterface + { + return $this->getPipelinesAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPipelinesAsyncWithHttpInfo + * + * Get all pipelines + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getPipelinesAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAllPipelines'; + $request = $this->getPipelinesRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPipelines' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getPipelinesRequest(): Request + { + + $resourcePath = '/pipelines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePipeline + * + * Update a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \Pipedrive\Model\Pipeline|null $pipeline pipeline (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\EditPipeline + */ + public function updatePipeline($id, $pipeline = null) + { + list($response) = $this->updatePipelineWithHttpInfo($id, $pipeline); + return $response; + } + + /** + * Operation updatePipelineWithHttpInfo + * + * Update a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\EditPipeline, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePipelineWithHttpInfo($id, $pipeline = null) + { + $request = $this->updatePipelineRequest($id, $pipeline); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updatePipelineRequest($id, $pipeline); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\EditPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\EditPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\EditPipeline' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\EditPipeline', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\EditPipeline', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePipelineAsync + * + * Update a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updatePipelineAsync($id, $pipeline = null): PromiseInterface + { + return $this->updatePipelineAsyncWithHttpInfo($id, $pipeline) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePipelineAsyncWithHttpInfo + * + * Update a pipeline + * + * @param int $id The ID of the pipeline (required) + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updatePipelineAsyncWithHttpInfo($id, $pipeline = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\EditPipeline'; + $request = $this->updatePipelineRequest($id, $pipeline); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePipeline' + * + * @param int $id The ID of the pipeline (required) + * @param \Pipedrive\Model\Pipeline|null $pipeline (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updatePipelineRequest($id, $pipeline = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updatePipeline' + ); + } + + $resourcePath = '/pipelines/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($pipeline)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pipeline)); + } else { + $httpBody = $pipeline; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/ProductFieldsApi.php b/lib/Api/ProductFieldsApi.php new file mode 100644 index 00000000..b1d331e6 --- /dev/null +++ b/lib/Api/ProductFieldsApi.php @@ -0,0 +1,1969 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addProductField + * + * Add a new product field + * + * @param \Pipedrive\Model\NewProductField|null $new_product_field new_product_field (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetProductFieldResponse + */ + public function addProductField($new_product_field = null) + { + list($response) = $this->addProductFieldWithHttpInfo($new_product_field); + return $response; + } + + /** + * Operation addProductFieldWithHttpInfo + * + * Add a new product field + * + * @param \Pipedrive\Model\NewProductField|null $new_product_field (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetProductFieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addProductFieldWithHttpInfo($new_product_field = null) + { + $request = $this->addProductFieldRequest($new_product_field); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addProductFieldRequest($new_product_field); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetProductFieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addProductFieldAsync + * + * Add a new product field + * + * @param \Pipedrive\Model\NewProductField|null $new_product_field (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addProductFieldAsync($new_product_field = null): PromiseInterface + { + return $this->addProductFieldAsyncWithHttpInfo($new_product_field) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addProductFieldAsyncWithHttpInfo + * + * Add a new product field + * + * @param \Pipedrive\Model\NewProductField|null $new_product_field (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addProductFieldAsyncWithHttpInfo($new_product_field = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetProductFieldResponse'; + $request = $this->addProductFieldRequest($new_product_field); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addProductField' + * + * @param \Pipedrive\Model\NewProductField|null $new_product_field (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addProductFieldRequest($new_product_field = null): Request + { + + $resourcePath = '/productFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($new_product_field)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($new_product_field)); + } else { + $httpBody = $new_product_field; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteProductField + * + * Delete a product field + * + * @param int $id The ID of the product field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteProductFieldResponse|\Pipedrive\Model\FailResponse + */ + public function deleteProductField($id) + { + list($response) = $this->deleteProductFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteProductFieldWithHttpInfo + * + * Delete a product field + * + * @param int $id The ID of the product field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteProductFieldResponse|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteProductFieldWithHttpInfo($id) + { + $request = $this->deleteProductFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteProductFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 410: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteProductFieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 410: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteProductFieldAsync + * + * Delete a product field + * + * @param int $id The ID of the product field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductFieldAsync($id): PromiseInterface + { + return $this->deleteProductFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteProductFieldAsyncWithHttpInfo + * + * Delete a product field + * + * @param int $id The ID of the product field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteProductFieldResponse'; + $request = $this->deleteProductFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteProductField' + * + * @param int $id The ID of the product field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteProductFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteProductField' + ); + } + + $resourcePath = '/productFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteProductFields + * + * Delete multiple product fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteMultipleProductFieldsResponse + */ + public function deleteProductFields($ids) + { + list($response) = $this->deleteProductFieldsWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteProductFieldsWithHttpInfo + * + * Delete multiple product fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteMultipleProductFieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteProductFieldsWithHttpInfo($ids) + { + $request = $this->deleteProductFieldsRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteProductFieldsRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteMultipleProductFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteMultipleProductFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteMultipleProductFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteMultipleProductFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteMultipleProductFieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteProductFieldsAsync + * + * Delete multiple product fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductFieldsAsync($ids): PromiseInterface + { + return $this->deleteProductFieldsAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteProductFieldsAsyncWithHttpInfo + * + * Delete multiple product fields in bulk + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductFieldsAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteMultipleProductFieldsResponse'; + $request = $this->deleteProductFieldsRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteProductFields' + * + * @param string $ids The comma-separated field IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteProductFieldsRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteProductFields' + ); + } + + $resourcePath = '/productFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProductField + * + * Get one product field + * + * @param int $id The ID of the product field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetProductFieldResponse|\Pipedrive\Model\FailResponse + */ + public function getProductField($id) + { + list($response) = $this->getProductFieldWithHttpInfo($id); + return $response; + } + + /** + * Operation getProductFieldWithHttpInfo + * + * Get one product field + * + * @param int $id The ID of the product field (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetProductFieldResponse|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductFieldWithHttpInfo($id) + { + $request = $this->getProductFieldRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductFieldRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 410: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetProductFieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 410: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductFieldAsync + * + * Get one product field + * + * @param int $id The ID of the product field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFieldAsync($id): PromiseInterface + { + return $this->getProductFieldAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductFieldAsyncWithHttpInfo + * + * Get one product field + * + * @param int $id The ID of the product field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFieldAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetProductFieldResponse'; + $request = $this->getProductFieldRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductField' + * + * @param int $id The ID of the product field (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductFieldRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProductField' + ); + } + + $resourcePath = '/productFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProductFields + * + * Get all product fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAllProductFieldsResponse + */ + public function getProductFields($start = 0, $limit = null) + { + list($response) = $this->getProductFieldsWithHttpInfo($start, $limit); + return $response; + } + + /** + * Operation getProductFieldsWithHttpInfo + * + * Get all product fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAllProductFieldsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductFieldsWithHttpInfo($start = 0, $limit = null) + { + $request = $this->getProductFieldsRequest($start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductFieldsRequest($start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllProductFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllProductFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAllProductFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAllProductFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAllProductFieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductFieldsAsync + * + * Get all product fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFieldsAsync($start = 0, $limit = null): PromiseInterface + { + return $this->getProductFieldsAsyncWithHttpInfo($start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductFieldsAsyncWithHttpInfo + * + * Get all product fields + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFieldsAsyncWithHttpInfo($start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAllProductFieldsResponse'; + $request = $this->getProductFieldsRequest($start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductFields' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductFieldsRequest($start = 0, $limit = null): Request + { + + $resourcePath = '/productFields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateProductField + * + * Update a product field + * + * @param int $id The ID of the product field (required) + * @param \Pipedrive\Model\UpdateProductField|null $update_product_field update_product_field (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetProductFieldResponse + */ + public function updateProductField($id, $update_product_field = null) + { + list($response) = $this->updateProductFieldWithHttpInfo($id, $update_product_field); + return $response; + } + + /** + * Operation updateProductFieldWithHttpInfo + * + * Update a product field + * + * @param int $id The ID of the product field (required) + * @param \Pipedrive\Model\UpdateProductField|null $update_product_field (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetProductFieldResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateProductFieldWithHttpInfo($id, $update_product_field = null) + { + $request = $this->updateProductFieldRequest($id, $update_product_field); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateProductFieldRequest($id, $update_product_field); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetProductFieldResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetProductFieldResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetProductFieldResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateProductFieldAsync + * + * Update a product field + * + * @param int $id The ID of the product field (required) + * @param \Pipedrive\Model\UpdateProductField|null $update_product_field (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateProductFieldAsync($id, $update_product_field = null): PromiseInterface + { + return $this->updateProductFieldAsyncWithHttpInfo($id, $update_product_field) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateProductFieldAsyncWithHttpInfo + * + * Update a product field + * + * @param int $id The ID of the product field (required) + * @param \Pipedrive\Model\UpdateProductField|null $update_product_field (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateProductFieldAsyncWithHttpInfo($id, $update_product_field = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetProductFieldResponse'; + $request = $this->updateProductFieldRequest($id, $update_product_field); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateProductField' + * + * @param int $id The ID of the product field (required) + * @param \Pipedrive\Model\UpdateProductField|null $update_product_field (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateProductFieldRequest($id, $update_product_field = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateProductField' + ); + } + + $resourcePath = '/productFields/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_product_field)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_product_field)); + } else { + $httpBody = $update_product_field; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/ProductsApi.php b/lib/Api/ProductsApi.php new file mode 100644 index 00000000..eeec505c --- /dev/null +++ b/lib/Api/ProductsApi.php @@ -0,0 +1,3968 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addProduct + * + * Add a product + * + * @param \Pipedrive\Model\AddProductRequestBody|null $add_product_request_body add_product_request_body (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ProductResponse + */ + public function addProduct($add_product_request_body = null) + { + list($response) = $this->addProductWithHttpInfo($add_product_request_body); + return $response; + } + + /** + * Operation addProductWithHttpInfo + * + * Add a product + * + * @param \Pipedrive\Model\AddProductRequestBody|null $add_product_request_body (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ProductResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addProductWithHttpInfo($add_product_request_body = null) + { + $request = $this->addProductRequest($add_product_request_body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addProductRequest($add_product_request_body); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ProductResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addProductAsync + * + * Add a product + * + * @param \Pipedrive\Model\AddProductRequestBody|null $add_product_request_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addProductAsync($add_product_request_body = null): PromiseInterface + { + return $this->addProductAsyncWithHttpInfo($add_product_request_body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addProductAsyncWithHttpInfo + * + * Add a product + * + * @param \Pipedrive\Model\AddProductRequestBody|null $add_product_request_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addProductAsyncWithHttpInfo($add_product_request_body = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ProductResponse'; + $request = $this->addProductRequest($add_product_request_body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addProduct' + * + * @param \Pipedrive\Model\AddProductRequestBody|null $add_product_request_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addProductRequest($add_product_request_body = null): Request + { + + $resourcePath = '/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_product_request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_product_request_body)); + } else { + $httpBody = $add_product_request_body; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addProductFollower + * + * Add a follower to a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\AddProductFollowerRequest|null $add_product_follower_request add_product_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\NewFollowerResponse + */ + public function addProductFollower($id, $add_product_follower_request = null) + { + list($response) = $this->addProductFollowerWithHttpInfo($id, $add_product_follower_request); + return $response; + } + + /** + * Operation addProductFollowerWithHttpInfo + * + * Add a follower to a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\AddProductFollowerRequest|null $add_product_follower_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\NewFollowerResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addProductFollowerWithHttpInfo($id, $add_product_follower_request = null) + { + $request = $this->addProductFollowerRequest($id, $add_product_follower_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addProductFollowerRequest($id, $add_product_follower_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\NewFollowerResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\NewFollowerResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\NewFollowerResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\NewFollowerResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\NewFollowerResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addProductFollowerAsync + * + * Add a follower to a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\AddProductFollowerRequest|null $add_product_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addProductFollowerAsync($id, $add_product_follower_request = null): PromiseInterface + { + return $this->addProductFollowerAsyncWithHttpInfo($id, $add_product_follower_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addProductFollowerAsyncWithHttpInfo + * + * Add a follower to a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\AddProductFollowerRequest|null $add_product_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addProductFollowerAsyncWithHttpInfo($id, $add_product_follower_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\NewFollowerResponse'; + $request = $this->addProductFollowerRequest($id, $add_product_follower_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addProductFollower' + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\AddProductFollowerRequest|null $add_product_follower_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addProductFollowerRequest($id, $add_product_follower_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addProductFollower' + ); + } + + $resourcePath = '/products/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_product_follower_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_product_follower_request)); + } else { + $httpBody = $add_product_follower_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteProduct + * + * Delete a product + * + * @param int $id The ID of the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteProductResponse + */ + public function deleteProduct($id) + { + list($response) = $this->deleteProductWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteProductWithHttpInfo + * + * Delete a product + * + * @param int $id The ID of the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteProductResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteProductWithHttpInfo($id) + { + $request = $this->deleteProductRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteProductRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteProductResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteProductAsync + * + * Delete a product + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductAsync($id): PromiseInterface + { + return $this->deleteProductAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteProductAsyncWithHttpInfo + * + * Delete a product + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteProductResponse'; + $request = $this->deleteProductRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteProduct' + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteProductRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteProduct' + ); + } + + $resourcePath = '/products/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteProductFollower + * + * Delete a follower from a product + * + * @param int $id The ID of the product (required) + * @param int $follower_id The ID of the relationship between the follower and the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteProductFollowerResponse + */ + public function deleteProductFollower($id, $follower_id) + { + list($response) = $this->deleteProductFollowerWithHttpInfo($id, $follower_id); + return $response; + } + + /** + * Operation deleteProductFollowerWithHttpInfo + * + * Delete a follower from a product + * + * @param int $id The ID of the product (required) + * @param int $follower_id The ID of the relationship between the follower and the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteProductFollowerResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteProductFollowerWithHttpInfo($id, $follower_id) + { + $request = $this->deleteProductFollowerRequest($id, $follower_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteProductFollowerRequest($id, $follower_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteProductFollowerResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteProductFollowerResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteProductFollowerResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteProductFollowerResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteProductFollowerResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteProductFollowerAsync + * + * Delete a follower from a product + * + * @param int $id The ID of the product (required) + * @param int $follower_id The ID of the relationship between the follower and the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductFollowerAsync($id, $follower_id): PromiseInterface + { + return $this->deleteProductFollowerAsyncWithHttpInfo($id, $follower_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteProductFollowerAsyncWithHttpInfo + * + * Delete a follower from a product + * + * @param int $id The ID of the product (required) + * @param int $follower_id The ID of the relationship between the follower and the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteProductFollowerAsyncWithHttpInfo($id, $follower_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteProductFollowerResponse'; + $request = $this->deleteProductFollowerRequest($id, $follower_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteProductFollower' + * + * @param int $id The ID of the product (required) + * @param int $follower_id The ID of the relationship between the follower and the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteProductFollowerRequest($id, $follower_id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteProductFollower' + ); + } + // verify the required parameter 'follower_id' is set + /* @phpstan-ignore-next-line */ + if ($follower_id === null || (is_array($follower_id) && count($follower_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $follower_id when calling deleteProductFollower' + ); + } + + $resourcePath = '/products/{id}/followers/{follower_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($follower_id !== null) { + $resourcePath = str_replace( + '{' . 'follower_id' . '}', + ObjectSerializer::toPathValue($follower_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProduct + * + * Get one product + * + * @param int $id The ID of the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ProductResponse + */ + public function getProduct($id) + { + list($response) = $this->getProductWithHttpInfo($id); + return $response; + } + + /** + * Operation getProductWithHttpInfo + * + * Get one product + * + * @param int $id The ID of the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ProductResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductWithHttpInfo($id) + { + $request = $this->getProductRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ProductResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductAsync + * + * Get one product + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductAsync($id): PromiseInterface + { + return $this->getProductAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductAsyncWithHttpInfo + * + * Get one product + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\ProductResponse'; + $request = $this->getProductRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProduct' + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProduct' + ); + } + + $resourcePath = '/products/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProductDeals + * + * Get deals where a product is attached to + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListDealsResponse + */ + public function getProductDeals($id, $start = 0, $limit = null, $status = 'all_not_deleted') + { + list($response) = $this->getProductDealsWithHttpInfo($id, $start, $limit, $status); + return $response; + } + + /** + * Operation getProductDealsWithHttpInfo + * + * Get deals where a product is attached to + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListDealsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductDealsWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted') + { + $request = $this->getProductDealsRequest($id, $start, $limit, $status); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductDealsRequest($id, $start, $limit, $status); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListDealsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListDealsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListDealsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListDealsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListDealsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductDealsAsync + * + * Get deals where a product is attached to + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductDealsAsync($id, $start = 0, $limit = null, $status = 'all_not_deleted'): PromiseInterface + { + return $this->getProductDealsAsyncWithHttpInfo($id, $start, $limit, $status) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductDealsAsyncWithHttpInfo + * + * Get deals where a product is attached to + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductDealsAsyncWithHttpInfo($id, $start = 0, $limit = null, $status = 'all_not_deleted'): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListDealsResponse'; + $request = $this->getProductDealsRequest($id, $start, $limit, $status); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductDeals' + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|'all_not_deleted' $status Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. (optional, default to 'all_not_deleted') + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductDealsRequest($id, $start = 0, $limit = null, $status = 'all_not_deleted'): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProductDeals' + ); + } + + $resourcePath = '/products/{id}/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($status)) { + $status = ObjectSerializer::serializeCollection($status, '', true); + } + if ($status !== null) { + $queryParams['status'] = $status; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProductFiles + * + * List files attached to a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListProductFilesResponse + */ + public function getProductFiles($id, $start = 0, $limit = null, $sort = null) + { + list($response) = $this->getProductFilesWithHttpInfo($id, $start, $limit, $sort); + return $response; + } + + /** + * Operation getProductFilesWithHttpInfo + * + * List files attached to a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListProductFilesResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductFilesWithHttpInfo($id, $start = 0, $limit = null, $sort = null) + { + $request = $this->getProductFilesRequest($id, $start, $limit, $sort); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductFilesRequest($id, $start, $limit, $sort); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListProductFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListProductFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListProductFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListProductFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListProductFilesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductFilesAsync + * + * List files attached to a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFilesAsync($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + return $this->getProductFilesAsyncWithHttpInfo($id, $start, $limit, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductFilesAsyncWithHttpInfo + * + * List files attached to a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFilesAsyncWithHttpInfo($id, $start = 0, $limit = null, $sort = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListProductFilesResponse'; + $request = $this->getProductFilesRequest($id, $start, $limit, $sort); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductFiles' + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * @param string|null $sort The field name and sorting mode (`field_name_1 ASC` or `field_name_1 DESC`). Supported fields: `update_time`, `id` (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductFilesRequest($id, $start = 0, $limit = null, $sort = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProductFiles' + ); + } + + $resourcePath = '/products/{id}/files'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($sort)) { + $sort = ObjectSerializer::serializeCollection($sort, '', true); + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProductFollowers + * + * List followers of a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ListProductFollowersResponse + */ + public function getProductFollowers($id, $start = 0, $limit = null) + { + list($response) = $this->getProductFollowersWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getProductFollowersWithHttpInfo + * + * List followers of a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ListProductFollowersResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductFollowersWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getProductFollowersRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductFollowersRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListProductFollowersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListProductFollowersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ListProductFollowersResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ListProductFollowersResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ListProductFollowersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductFollowersAsync + * + * List followers of a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFollowersAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getProductFollowersAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductFollowersAsyncWithHttpInfo + * + * List followers of a product + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductFollowersAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ListProductFollowersResponse'; + $request = $this->getProductFollowersRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductFollowers' + * + * @param int $id The ID of the product (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductFollowersRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProductFollowers' + ); + } + + $resourcePath = '/products/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProductUsers + * + * List permitted users + * + * @param int $id The ID of the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserIDs + */ + public function getProductUsers($id) + { + list($response) = $this->getProductUsersWithHttpInfo($id); + return $response; + } + + /** + * Operation getProductUsersWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the product (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserIDs, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductUsersWithHttpInfo($id) + { + $request = $this->getProductUsersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductUsersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserIDs', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductUsersAsync + * + * List permitted users + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductUsersAsync($id): PromiseInterface + { + return $this->getProductUsersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductUsersAsyncWithHttpInfo + * + * List permitted users + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductUsersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserIDs'; + $request = $this->getProductUsersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductUsers' + * + * @param int $id The ID of the product (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductUsersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProductUsers' + ); + } + + $resourcePath = '/products/{id}/permittedUsers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProducts + * + * Get all products + * + * @param int|null $user_id If supplied, only products owned by the given user will be returned (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int[]|null $ids An array of integers with the IDs of the products that should be returned in the response (optional) + * @param string|null $first_char If supplied, only products whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param bool|null $get_summary If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ProductsResponse + */ + public function getProducts($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null) + { + list($response) = $this->getProductsWithHttpInfo($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit); + return $response; + } + + /** + * Operation getProductsWithHttpInfo + * + * Get all products + * + * @param int|null $user_id If supplied, only products owned by the given user will be returned (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int[]|null $ids An array of integers with the IDs of the products that should be returned in the response (optional) + * @param string|null $first_char If supplied, only products whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param bool|null $get_summary If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ProductsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductsWithHttpInfo($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null) + { + $request = $this->getProductsRequest($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getProductsRequest($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ProductsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductsAsync + * + * Get all products + * + * @param int|null $user_id If supplied, only products owned by the given user will be returned (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int[]|null $ids An array of integers with the IDs of the products that should be returned in the response (optional) + * @param string|null $first_char If supplied, only products whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param bool|null $get_summary If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductsAsync($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null): PromiseInterface + { + return $this->getProductsAsyncWithHttpInfo($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductsAsyncWithHttpInfo + * + * Get all products + * + * @param int|null $user_id If supplied, only products owned by the given user will be returned (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int[]|null $ids An array of integers with the IDs of the products that should be returned in the response (optional) + * @param string|null $first_char If supplied, only products whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param bool|null $get_summary If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getProductsAsyncWithHttpInfo($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ProductsResponse'; + $request = $this->getProductsRequest($user_id, $filter_id, $ids, $first_char, $get_summary, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProducts' + * + * @param int|null $user_id If supplied, only products owned by the given user will be returned (optional) + * @param int|null $filter_id The ID of the filter to use (optional) + * @param int[]|null $ids An array of integers with the IDs of the products that should be returned in the response (optional) + * @param string|null $first_char If supplied, only products whose name starts with the specified letter will be returned (case insensitive) (optional) + * @param bool|null $get_summary If supplied, the response will return the total numbers of products in the `additional_data.summary.total_count` property (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getProductsRequest($user_id = null, $filter_id = null, $ids = null, $first_char = null, $get_summary = null, $start = 0, $limit = null): Request + { + + $resourcePath = '/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, 'csv', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($first_char)) { + $first_char = ObjectSerializer::serializeCollection($first_char, '', true); + } + if ($first_char !== null) { + $queryParams['first_char'] = $first_char; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($get_summary)) { + $get_summary = ObjectSerializer::serializeCollection($get_summary, '', true); + } + if ($get_summary !== null) { + $queryParams['get_summary'] = $get_summary; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchProducts + * + * Search products + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\ProductSearchResponse + */ + public function searchProducts($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) + { + list($response) = $this->searchProductsWithHttpInfo($term, $fields, $exact_match, $include_fields, $start, $limit); + return $response; + } + + /** + * Operation searchProductsWithHttpInfo + * + * Search products + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\ProductSearchResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchProductsWithHttpInfo($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null) + { + $request = $this->searchProductsRequest($term, $fields, $exact_match, $include_fields, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->searchProductsRequest($term, $fields, $exact_match, $include_fields, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\ProductSearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\ProductSearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\ProductSearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchProductsAsync + * + * Search products + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchProductsAsync($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + return $this->searchProductsAsyncWithHttpInfo($term, $fields, $exact_match, $include_fields, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchProductsAsyncWithHttpInfo + * + * Search products + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function searchProductsAsyncWithHttpInfo($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\ProductSearchResponse'; + $request = $this->searchProductsRequest($term, $fields, $exact_match, $include_fields, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchProducts' + * + * @param string $term The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. (required) + * @param string|null $fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. (optional) + * @param bool|null $exact_match When enabled, only full exact matches against the given term are returned. It is <b>not</b> case sensitive. (optional) + * @param string|null $include_fields Supports including optional fields in the results which are not provided by default (optional) + * @param int|0 $start Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function searchProductsRequest($term, $fields = null, $exact_match = null, $include_fields = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling searchProducts' + ); + } + + $resourcePath = '/products/search'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($fields)) { + $fields = ObjectSerializer::serializeCollection($fields, '', true); + } + if ($fields !== null) { + $queryParams['fields'] = $fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($exact_match)) { + $exact_match = ObjectSerializer::serializeCollection($exact_match, '', true); + } + if ($exact_match !== null) { + $queryParams['exact_match'] = $exact_match; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($include_fields)) { + $include_fields = ObjectSerializer::serializeCollection($include_fields, '', true); + } + if ($include_fields !== null) { + $queryParams['include_fields'] = $include_fields; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateProduct + * + * Update a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\UpdateProductRequestBody|null $update_product_request_body update_product_request_body (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UpdateProductResponse + */ + public function updateProduct($id, $update_product_request_body = null) + { + list($response) = $this->updateProductWithHttpInfo($id, $update_product_request_body); + return $response; + } + + /** + * Operation updateProductWithHttpInfo + * + * Update a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\UpdateProductRequestBody|null $update_product_request_body (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UpdateProductResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateProductWithHttpInfo($id, $update_product_request_body = null) + { + $request = $this->updateProductRequest($id, $update_product_request_body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateProductRequest($id, $update_product_request_body); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdateProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdateProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UpdateProductResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UpdateProductResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UpdateProductResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateProductAsync + * + * Update a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\UpdateProductRequestBody|null $update_product_request_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateProductAsync($id, $update_product_request_body = null): PromiseInterface + { + return $this->updateProductAsyncWithHttpInfo($id, $update_product_request_body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateProductAsyncWithHttpInfo + * + * Update a product + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\UpdateProductRequestBody|null $update_product_request_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateProductAsyncWithHttpInfo($id, $update_product_request_body = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\UpdateProductResponse'; + $request = $this->updateProductRequest($id, $update_product_request_body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateProduct' + * + * @param int $id The ID of the product (required) + * @param \Pipedrive\Model\UpdateProductRequestBody|null $update_product_request_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateProductRequest($id, $update_product_request_body = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateProduct' + ); + } + + $resourcePath = '/products/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_product_request_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_product_request_body)); + } else { + $httpBody = $update_product_request_body; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/RecentsApi.php b/lib/Api/RecentsApi.php new file mode 100644 index 00000000..8daadeb4 --- /dev/null +++ b/lib/Api/RecentsApi.php @@ -0,0 +1,478 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getRecents + * + * Get recents + * + * @param string $since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS (required) + * @param string|null $items Multiple selection of item types to include in the query (optional) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRecents + */ + public function getRecents($since_timestamp, $items = null, $start = 0, $limit = null) + { + list($response) = $this->getRecentsWithHttpInfo($since_timestamp, $items, $start, $limit); + return $response; + } + + /** + * Operation getRecentsWithHttpInfo + * + * Get recents + * + * @param string $since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS (required) + * @param string|null $items Multiple selection of item types to include in the query (optional) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRecents, HTTP status code, HTTP response headers (array of strings) + */ + public function getRecentsWithHttpInfo($since_timestamp, $items = null, $start = 0, $limit = null) + { + $request = $this->getRecentsRequest($since_timestamp, $items, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getRecentsRequest($since_timestamp, $items, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRecents' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRecents', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRecents' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRecents', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRecents', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRecentsAsync + * + * Get recents + * + * @param string $since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS (required) + * @param string|null $items Multiple selection of item types to include in the query (optional) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRecentsAsync($since_timestamp, $items = null, $start = 0, $limit = null): PromiseInterface + { + return $this->getRecentsAsyncWithHttpInfo($since_timestamp, $items, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRecentsAsyncWithHttpInfo + * + * Get recents + * + * @param string $since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS (required) + * @param string|null $items Multiple selection of item types to include in the query (optional) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRecentsAsyncWithHttpInfo($since_timestamp, $items = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRecents'; + $request = $this->getRecentsRequest($since_timestamp, $items, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRecents' + * + * @param string $since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS (required) + * @param string|null $items Multiple selection of item types to include in the query (optional) (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getRecentsRequest($since_timestamp, $items = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'since_timestamp' is set + /* @phpstan-ignore-next-line */ + if ($since_timestamp === null || (is_array($since_timestamp) && count($since_timestamp) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $since_timestamp when calling getRecents' + ); + } + + $resourcePath = '/recents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($since_timestamp)) { + $since_timestamp = ObjectSerializer::serializeCollection($since_timestamp, '', true); + } + if ($since_timestamp !== null) { + $queryParams['since_timestamp'] = $since_timestamp; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($items)) { + $items = ObjectSerializer::serializeCollection($items, '', true); + } + if ($items !== null) { + $queryParams['items'] = $items; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/RolesApi.php b/lib/Api/RolesApi.php new file mode 100644 index 00000000..4bbf390c --- /dev/null +++ b/lib/Api/RolesApi.php @@ -0,0 +1,3786 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addOrUpdateRoleSetting + * + * Add or update role setting + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddOrUpdateRoleSettingRequest|null $add_or_update_role_setting_request add_or_update_role_setting_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostRoleSettings + */ + public function addOrUpdateRoleSetting($id, $add_or_update_role_setting_request = null) + { + list($response) = $this->addOrUpdateRoleSettingWithHttpInfo($id, $add_or_update_role_setting_request); + return $response; + } + + /** + * Operation addOrUpdateRoleSettingWithHttpInfo + * + * Add or update role setting + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddOrUpdateRoleSettingRequest|null $add_or_update_role_setting_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostRoleSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function addOrUpdateRoleSettingWithHttpInfo($id, $add_or_update_role_setting_request = null) + { + $request = $this->addOrUpdateRoleSettingRequest($id, $add_or_update_role_setting_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addOrUpdateRoleSettingRequest($id, $add_or_update_role_setting_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostRoleSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostRoleSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostRoleSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostRoleSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostRoleSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addOrUpdateRoleSettingAsync + * + * Add or update role setting + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddOrUpdateRoleSettingRequest|null $add_or_update_role_setting_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrUpdateRoleSettingAsync($id, $add_or_update_role_setting_request = null): PromiseInterface + { + return $this->addOrUpdateRoleSettingAsyncWithHttpInfo($id, $add_or_update_role_setting_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addOrUpdateRoleSettingAsyncWithHttpInfo + * + * Add or update role setting + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddOrUpdateRoleSettingRequest|null $add_or_update_role_setting_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addOrUpdateRoleSettingAsyncWithHttpInfo($id, $add_or_update_role_setting_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostRoleSettings'; + $request = $this->addOrUpdateRoleSettingRequest($id, $add_or_update_role_setting_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addOrUpdateRoleSetting' + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddOrUpdateRoleSettingRequest|null $add_or_update_role_setting_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addOrUpdateRoleSettingRequest($id, $add_or_update_role_setting_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addOrUpdateRoleSetting' + ); + } + + $resourcePath = '/roles/{id}/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_or_update_role_setting_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_or_update_role_setting_request)); + } else { + $httpBody = $add_or_update_role_setting_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addRole + * + * Add a role + * + * @param \Pipedrive\Model\AddRole|null $add_role add_role (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostRoles + */ + public function addRole($add_role = null) + { + list($response) = $this->addRoleWithHttpInfo($add_role); + return $response; + } + + /** + * Operation addRoleWithHttpInfo + * + * Add a role + * + * @param \Pipedrive\Model\AddRole|null $add_role (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostRoles, HTTP status code, HTTP response headers (array of strings) + */ + public function addRoleWithHttpInfo($add_role = null) + { + $request = $this->addRoleRequest($add_role); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addRoleRequest($add_role); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostRoles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostRoles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostRoles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostRoles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostRoles', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addRoleAsync + * + * Add a role + * + * @param \Pipedrive\Model\AddRole|null $add_role (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addRoleAsync($add_role = null): PromiseInterface + { + return $this->addRoleAsyncWithHttpInfo($add_role) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addRoleAsyncWithHttpInfo + * + * Add a role + * + * @param \Pipedrive\Model\AddRole|null $add_role (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addRoleAsyncWithHttpInfo($add_role = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostRoles'; + $request = $this->addRoleRequest($add_role); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addRole' + * + * @param \Pipedrive\Model\AddRole|null $add_role (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addRoleRequest($add_role = null): Request + { + + $resourcePath = '/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_role)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_role)); + } else { + $httpBody = $add_role; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addRoleAssignment + * + * Add role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddRoleAssignmentRequest|null $add_role_assignment_request add_role_assignment_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PostRoleAssignment + */ + public function addRoleAssignment($id, $add_role_assignment_request = null) + { + list($response) = $this->addRoleAssignmentWithHttpInfo($id, $add_role_assignment_request); + return $response; + } + + /** + * Operation addRoleAssignmentWithHttpInfo + * + * Add role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddRoleAssignmentRequest|null $add_role_assignment_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PostRoleAssignment, HTTP status code, HTTP response headers (array of strings) + */ + public function addRoleAssignmentWithHttpInfo($id, $add_role_assignment_request = null) + { + $request = $this->addRoleAssignmentRequest($id, $add_role_assignment_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addRoleAssignmentRequest($id, $add_role_assignment_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostRoleAssignment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostRoleAssignment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PostRoleAssignment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PostRoleAssignment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PostRoleAssignment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addRoleAssignmentAsync + * + * Add role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddRoleAssignmentRequest|null $add_role_assignment_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addRoleAssignmentAsync($id, $add_role_assignment_request = null): PromiseInterface + { + return $this->addRoleAssignmentAsyncWithHttpInfo($id, $add_role_assignment_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addRoleAssignmentAsyncWithHttpInfo + * + * Add role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddRoleAssignmentRequest|null $add_role_assignment_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addRoleAssignmentAsyncWithHttpInfo($id, $add_role_assignment_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PostRoleAssignment'; + $request = $this->addRoleAssignmentRequest($id, $add_role_assignment_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addRoleAssignment' + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\AddRoleAssignmentRequest|null $add_role_assignment_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addRoleAssignmentRequest($id, $add_role_assignment_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling addRoleAssignment' + ); + } + + $resourcePath = '/roles/{id}/assignments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_role_assignment_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_role_assignment_request)); + } else { + $httpBody = $add_role_assignment_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteRole + * + * Delete a role + * + * @param int $id The ID of the role (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteRole + */ + public function deleteRole($id) + { + list($response) = $this->deleteRoleWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteRoleWithHttpInfo + * + * Delete a role + * + * @param int $id The ID of the role (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteRole, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteRoleWithHttpInfo($id) + { + $request = $this->deleteRoleRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteRoleRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteRole' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteRole' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteRoleAsync + * + * Delete a role + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteRoleAsync($id): PromiseInterface + { + return $this->deleteRoleAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteRoleAsyncWithHttpInfo + * + * Delete a role + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteRoleAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteRole'; + $request = $this->deleteRoleRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteRole' + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteRoleRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteRole' + ); + } + + $resourcePath = '/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteRoleAssignment + * + * Delete a role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\DeleteRoleAssignmentRequest|null $delete_role_assignment_request delete_role_assignment_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteRoleAssignment + */ + public function deleteRoleAssignment($id, $delete_role_assignment_request = null) + { + list($response) = $this->deleteRoleAssignmentWithHttpInfo($id, $delete_role_assignment_request); + return $response; + } + + /** + * Operation deleteRoleAssignmentWithHttpInfo + * + * Delete a role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\DeleteRoleAssignmentRequest|null $delete_role_assignment_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteRoleAssignment, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteRoleAssignmentWithHttpInfo($id, $delete_role_assignment_request = null) + { + $request = $this->deleteRoleAssignmentRequest($id, $delete_role_assignment_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteRoleAssignmentRequest($id, $delete_role_assignment_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteRoleAssignment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteRoleAssignment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteRoleAssignment' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteRoleAssignment', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteRoleAssignment', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteRoleAssignmentAsync + * + * Delete a role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\DeleteRoleAssignmentRequest|null $delete_role_assignment_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteRoleAssignmentAsync($id, $delete_role_assignment_request = null): PromiseInterface + { + return $this->deleteRoleAssignmentAsyncWithHttpInfo($id, $delete_role_assignment_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteRoleAssignmentAsyncWithHttpInfo + * + * Delete a role assignment + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\DeleteRoleAssignmentRequest|null $delete_role_assignment_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteRoleAssignmentAsyncWithHttpInfo($id, $delete_role_assignment_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteRoleAssignment'; + $request = $this->deleteRoleAssignmentRequest($id, $delete_role_assignment_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteRoleAssignment' + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\DeleteRoleAssignmentRequest|null $delete_role_assignment_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteRoleAssignmentRequest($id, $delete_role_assignment_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteRoleAssignment' + ); + } + + $resourcePath = '/roles/{id}/assignments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($delete_role_assignment_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($delete_role_assignment_request)); + } else { + $httpBody = $delete_role_assignment_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRole + * + * Get one role + * + * @param int $id The ID of the role (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRole + */ + public function getRole($id) + { + list($response) = $this->getRoleWithHttpInfo($id); + return $response; + } + + /** + * Operation getRoleWithHttpInfo + * + * Get one role + * + * @param int $id The ID of the role (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRole, HTTP status code, HTTP response headers (array of strings) + */ + public function getRoleWithHttpInfo($id) + { + $request = $this->getRoleRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getRoleRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRole' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRole' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRoleAsync + * + * Get one role + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRoleAsync($id): PromiseInterface + { + return $this->getRoleAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRoleAsyncWithHttpInfo + * + * Get one role + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRoleAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRole'; + $request = $this->getRoleRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRole' + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getRoleRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getRole' + ); + } + + $resourcePath = '/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRoleAssignments + * + * List role assignments + * + * @param int $id The ID of the role (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRoleAssignments + */ + public function getRoleAssignments($id, $start = 0, $limit = null) + { + list($response) = $this->getRoleAssignmentsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getRoleAssignmentsWithHttpInfo + * + * List role assignments + * + * @param int $id The ID of the role (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRoleAssignments, HTTP status code, HTTP response headers (array of strings) + */ + public function getRoleAssignmentsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getRoleAssignmentsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getRoleAssignmentsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleAssignments' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleAssignments', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleAssignments' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleAssignments', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRoleAssignments', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRoleAssignmentsAsync + * + * List role assignments + * + * @param int $id The ID of the role (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRoleAssignmentsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getRoleAssignmentsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRoleAssignmentsAsyncWithHttpInfo + * + * List role assignments + * + * @param int $id The ID of the role (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRoleAssignmentsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRoleAssignments'; + $request = $this->getRoleAssignmentsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRoleAssignments' + * + * @param int $id The ID of the role (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getRoleAssignmentsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getRoleAssignments' + ); + } + + $resourcePath = '/roles/{id}/assignments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRolePipelines + * + * List pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param bool|true $visible Whether to return the visible or hidden pipelines for the role (optional, default to true) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRolePipelines + */ + public function getRolePipelines($id, $visible = true) + { + list($response) = $this->getRolePipelinesWithHttpInfo($id, $visible); + return $response; + } + + /** + * Operation getRolePipelinesWithHttpInfo + * + * List pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param bool|true $visible Whether to return the visible or hidden pipelines for the role (optional, default to true) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRolePipelines, HTTP status code, HTTP response headers (array of strings) + */ + public function getRolePipelinesWithHttpInfo($id, $visible = true) + { + $request = $this->getRolePipelinesRequest($id, $visible); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getRolePipelinesRequest($id, $visible); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRolePipelines' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRolePipelines', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRolePipelines' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRolePipelines', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRolePipelines', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRolePipelinesAsync + * + * List pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param bool|true $visible Whether to return the visible or hidden pipelines for the role (optional, default to true) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRolePipelinesAsync($id, $visible = true): PromiseInterface + { + return $this->getRolePipelinesAsyncWithHttpInfo($id, $visible) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRolePipelinesAsyncWithHttpInfo + * + * List pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param bool|true $visible Whether to return the visible or hidden pipelines for the role (optional, default to true) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRolePipelinesAsyncWithHttpInfo($id, $visible = true): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRolePipelines'; + $request = $this->getRolePipelinesRequest($id, $visible); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRolePipelines' + * + * @param int $id The ID of the role (required) + * @param bool|true $visible Whether to return the visible or hidden pipelines for the role (optional, default to true) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getRolePipelinesRequest($id, $visible = true): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getRolePipelines' + ); + } + + $resourcePath = '/roles/{id}/pipelines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($visible)) { + $visible = ObjectSerializer::serializeCollection($visible, '', true); + } + if ($visible !== null) { + $queryParams['visible'] = $visible; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRoleSettings + * + * List role settings + * + * @param int $id The ID of the role (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRoleSettings + */ + public function getRoleSettings($id) + { + list($response) = $this->getRoleSettingsWithHttpInfo($id); + return $response; + } + + /** + * Operation getRoleSettingsWithHttpInfo + * + * List role settings + * + * @param int $id The ID of the role (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRoleSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getRoleSettingsWithHttpInfo($id) + { + $request = $this->getRoleSettingsRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getRoleSettingsRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRoleSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRoleSettingsAsync + * + * List role settings + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRoleSettingsAsync($id): PromiseInterface + { + return $this->getRoleSettingsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRoleSettingsAsyncWithHttpInfo + * + * List role settings + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRoleSettingsAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRoleSettings'; + $request = $this->getRoleSettingsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRoleSettings' + * + * @param int $id The ID of the role (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getRoleSettingsRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getRoleSettings' + ); + } + + $resourcePath = '/roles/{id}/settings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getRoles + * + * Get all roles + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRoles + */ + public function getRoles($start = 0, $limit = null) + { + list($response) = $this->getRolesWithHttpInfo($start, $limit); + return $response; + } + + /** + * Operation getRolesWithHttpInfo + * + * Get all roles + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRoles, HTTP status code, HTTP response headers (array of strings) + */ + public function getRolesWithHttpInfo($start = 0, $limit = null) + { + $request = $this->getRolesRequest($start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getRolesRequest($start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoles' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoles', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRoles', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getRolesAsync + * + * Get all roles + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRolesAsync($start = 0, $limit = null): PromiseInterface + { + return $this->getRolesAsyncWithHttpInfo($start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getRolesAsyncWithHttpInfo + * + * Get all roles + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getRolesAsyncWithHttpInfo($start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRoles'; + $request = $this->getRolesRequest($start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getRoles' + * + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getRolesRequest($start = 0, $limit = null): Request + { + + $resourcePath = '/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateRole + * + * Update role details + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\BaseRole|null $base_role base_role (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PutRole + */ + public function updateRole($id, $base_role = null) + { + list($response) = $this->updateRoleWithHttpInfo($id, $base_role); + return $response; + } + + /** + * Operation updateRoleWithHttpInfo + * + * Update role details + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\BaseRole|null $base_role (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PutRole, HTTP status code, HTTP response headers (array of strings) + */ + public function updateRoleWithHttpInfo($id, $base_role = null) + { + $request = $this->updateRoleRequest($id, $base_role); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateRoleRequest($id, $base_role); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PutRole' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PutRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PutRole' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PutRole', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PutRole', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateRoleAsync + * + * Update role details + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\BaseRole|null $base_role (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateRoleAsync($id, $base_role = null): PromiseInterface + { + return $this->updateRoleAsyncWithHttpInfo($id, $base_role) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateRoleAsyncWithHttpInfo + * + * Update role details + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\BaseRole|null $base_role (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateRoleAsyncWithHttpInfo($id, $base_role = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\PutRole'; + $request = $this->updateRoleRequest($id, $base_role); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateRole' + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\BaseRole|null $base_role (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateRoleRequest($id, $base_role = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateRole' + ); + } + + $resourcePath = '/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($base_role)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($base_role)); + } else { + $httpBody = $base_role; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateRolePipelines + * + * Update pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\PutRolePipelinesBody|null $put_role_pipelines_body put_role_pipelines_body (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRolePipelines + */ + public function updateRolePipelines($id, $put_role_pipelines_body = null) + { + list($response) = $this->updateRolePipelinesWithHttpInfo($id, $put_role_pipelines_body); + return $response; + } + + /** + * Operation updateRolePipelinesWithHttpInfo + * + * Update pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\PutRolePipelinesBody|null $put_role_pipelines_body (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRolePipelines, HTTP status code, HTTP response headers (array of strings) + */ + public function updateRolePipelinesWithHttpInfo($id, $put_role_pipelines_body = null) + { + $request = $this->updateRolePipelinesRequest($id, $put_role_pipelines_body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateRolePipelinesRequest($id, $put_role_pipelines_body); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRolePipelines' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRolePipelines', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRolePipelines' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRolePipelines', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRolePipelines', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateRolePipelinesAsync + * + * Update pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\PutRolePipelinesBody|null $put_role_pipelines_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateRolePipelinesAsync($id, $put_role_pipelines_body = null): PromiseInterface + { + return $this->updateRolePipelinesAsyncWithHttpInfo($id, $put_role_pipelines_body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateRolePipelinesAsyncWithHttpInfo + * + * Update pipeline visibility for a role + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\PutRolePipelinesBody|null $put_role_pipelines_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateRolePipelinesAsyncWithHttpInfo($id, $put_role_pipelines_body = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRolePipelines'; + $request = $this->updateRolePipelinesRequest($id, $put_role_pipelines_body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateRolePipelines' + * + * @param int $id The ID of the role (required) + * @param \Pipedrive\Model\PutRolePipelinesBody|null $put_role_pipelines_body (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateRolePipelinesRequest($id, $put_role_pipelines_body = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateRolePipelines' + ); + } + + $resourcePath = '/roles/{id}/pipelines'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($put_role_pipelines_body)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($put_role_pipelines_body)); + } else { + $httpBody = $put_role_pipelines_body; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/StagesApi.php b/lib/Api/StagesApi.php new file mode 100644 index 00000000..4a53e2ee --- /dev/null +++ b/lib/Api/StagesApi.php @@ -0,0 +1,2314 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addStage + * + * Add a new stage + * + * @param \Pipedrive\Model\Stage|null $stage stage (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAddUpdateStage + */ + public function addStage($stage = null) + { + list($response) = $this->addStageWithHttpInfo($stage); + return $response; + } + + /** + * Operation addStageWithHttpInfo + * + * Add a new stage + * + * @param \Pipedrive\Model\Stage|null $stage (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAddUpdateStage, HTTP status code, HTTP response headers (array of strings) + */ + public function addStageWithHttpInfo($stage = null) + { + $request = $this->addStageRequest($stage); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addStageRequest($stage); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddUpdateStage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddUpdateStage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddUpdateStage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddUpdateStage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAddUpdateStage', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addStageAsync + * + * Add a new stage + * + * @param \Pipedrive\Model\Stage|null $stage (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addStageAsync($stage = null): PromiseInterface + { + return $this->addStageAsyncWithHttpInfo($stage) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addStageAsyncWithHttpInfo + * + * Add a new stage + * + * @param \Pipedrive\Model\Stage|null $stage (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addStageAsyncWithHttpInfo($stage = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAddUpdateStage'; + $request = $this->addStageRequest($stage); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addStage' + * + * @param \Pipedrive\Model\Stage|null $stage (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addStageRequest($stage = null): Request + { + + $resourcePath = '/stages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($stage)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($stage)); + } else { + $httpBody = $stage; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteStage + * + * Delete a stage + * + * @param int $id The ID of the stage (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteStageResponse200 + */ + public function deleteStage($id) + { + list($response) = $this->deleteStageWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteStageWithHttpInfo + * + * Delete a stage + * + * @param int $id The ID of the stage (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteStageResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteStageWithHttpInfo($id) + { + $request = $this->deleteStageRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteStageRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteStageResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteStageResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteStageResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteStageResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteStageResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteStageAsync + * + * Delete a stage + * + * @param int $id The ID of the stage (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteStageAsync($id): PromiseInterface + { + return $this->deleteStageAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteStageAsyncWithHttpInfo + * + * Delete a stage + * + * @param int $id The ID of the stage (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteStageAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteStageResponse200'; + $request = $this->deleteStageRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteStage' + * + * @param int $id The ID of the stage (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteStageRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteStage' + ); + } + + $resourcePath = '/stages/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteStages + * + * Delete multiple stages in bulk + * + * @param string $ids The comma-separated stage IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\DeleteStagesResponse200 + */ + public function deleteStages($ids) + { + list($response) = $this->deleteStagesWithHttpInfo($ids); + return $response; + } + + /** + * Operation deleteStagesWithHttpInfo + * + * Delete multiple stages in bulk + * + * @param string $ids The comma-separated stage IDs to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\DeleteStagesResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteStagesWithHttpInfo($ids) + { + $request = $this->deleteStagesRequest($ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteStagesRequest($ids); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteStagesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteStagesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\DeleteStagesResponse200' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\DeleteStagesResponse200', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\DeleteStagesResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteStagesAsync + * + * Delete multiple stages in bulk + * + * @param string $ids The comma-separated stage IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteStagesAsync($ids): PromiseInterface + { + return $this->deleteStagesAsyncWithHttpInfo($ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteStagesAsyncWithHttpInfo + * + * Delete multiple stages in bulk + * + * @param string $ids The comma-separated stage IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteStagesAsyncWithHttpInfo($ids): PromiseInterface + { + $returnType = '\Pipedrive\Model\DeleteStagesResponse200'; + $request = $this->deleteStagesRequest($ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteStages' + * + * @param string $ids The comma-separated stage IDs to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteStagesRequest($ids): Request + { + // verify the required parameter 'ids' is set + /* @phpstan-ignore-next-line */ + if ($ids === null || (is_array($ids) && count($ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ids when calling deleteStages' + ); + } + + $resourcePath = '/stages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($ids)) { + $ids = ObjectSerializer::serializeCollection($ids, '', true); + } + if ($ids !== null) { + $queryParams['ids'] = $ids; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getStage + * + * Get one stage + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If `everyone=1` is provided, deals summary will return deals owned by every user (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetOneStage + */ + public function getStage($id, $everyone = null) + { + list($response) = $this->getStageWithHttpInfo($id, $everyone); + return $response; + } + + /** + * Operation getStageWithHttpInfo + * + * Get one stage + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If `everyone=1` is provided, deals summary will return deals owned by every user (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetOneStage, HTTP status code, HTTP response headers (array of strings) + */ + public function getStageWithHttpInfo($id, $everyone = null) + { + $request = $this->getStageRequest($id, $everyone); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getStageRequest($id, $everyone); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetOneStage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetOneStage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetOneStage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetOneStage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetOneStage', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getStageAsync + * + * Get one stage + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If `everyone=1` is provided, deals summary will return deals owned by every user (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getStageAsync($id, $everyone = null): PromiseInterface + { + return $this->getStageAsyncWithHttpInfo($id, $everyone) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getStageAsyncWithHttpInfo + * + * Get one stage + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If `everyone=1` is provided, deals summary will return deals owned by every user (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getStageAsyncWithHttpInfo($id, $everyone = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetOneStage'; + $request = $this->getStageRequest($id, $everyone); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getStage' + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If `everyone=1` is provided, deals summary will return deals owned by every user (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getStageRequest($id, $everyone = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getStage' + ); + } + + $resourcePath = '/stages/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($everyone)) { + $everyone = ObjectSerializer::serializeCollection($everyone, '', true); + } + if ($everyone !== null) { + $queryParams['everyone'] = $everyone; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getStageDeals + * + * Get deals in a stage + * + * @param int $id The ID of the stage (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetStageDeals + */ + public function getStageDeals($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null) + { + list($response) = $this->getStageDealsWithHttpInfo($id, $filter_id, $user_id, $everyone, $start, $limit); + return $response; + } + + /** + * Operation getStageDealsWithHttpInfo + * + * Get deals in a stage + * + * @param int $id The ID of the stage (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetStageDeals, HTTP status code, HTTP response headers (array of strings) + */ + public function getStageDealsWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null) + { + $request = $this->getStageDealsRequest($id, $filter_id, $user_id, $everyone, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getStageDealsRequest($id, $filter_id, $user_id, $everyone, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetStageDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetStageDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetStageDeals' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetStageDeals', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetStageDeals', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getStageDealsAsync + * + * Get deals in a stage + * + * @param int $id The ID of the stage (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getStageDealsAsync($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null): PromiseInterface + { + return $this->getStageDealsAsyncWithHttpInfo($id, $filter_id, $user_id, $everyone, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getStageDealsAsyncWithHttpInfo + * + * Get deals in a stage + * + * @param int $id The ID of the stage (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getStageDealsAsyncWithHttpInfo($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetStageDeals'; + $request = $this->getStageDealsRequest($id, $filter_id, $user_id, $everyone, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getStageDeals' + * + * @param int $id The ID of the stage (required) + * @param int|null $filter_id If supplied, only deals matching the given filter will be returned (optional) + * @param int|null $user_id If supplied, `filter_id` will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. (optional) + * @param \Pipedrive\Model\NumberBoolean|null $everyone If supplied, `filter_id` and `user_id` will not be considered – instead, deals owned by everyone will be returned (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getStageDealsRequest($id, $filter_id = null, $user_id = null, $everyone = null, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getStageDeals' + ); + } + + $resourcePath = '/stages/{id}/deals'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($filter_id)) { + $filter_id = ObjectSerializer::serializeCollection($filter_id, '', true); + } + if ($filter_id !== null) { + $queryParams['filter_id'] = $filter_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($user_id)) { + $user_id = ObjectSerializer::serializeCollection($user_id, '', true); + } + if ($user_id !== null) { + $queryParams['user_id'] = $user_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($everyone)) { + $everyone = ObjectSerializer::serializeCollection($everyone, '', true); + } + if ($everyone !== null) { + $queryParams['everyone'] = $everyone; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getStages + * + * Get all stages + * + * @param int|null $pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetStages + */ + public function getStages($pipeline_id = null, $start = 0, $limit = null) + { + list($response) = $this->getStagesWithHttpInfo($pipeline_id, $start, $limit); + return $response; + } + + /** + * Operation getStagesWithHttpInfo + * + * Get all stages + * + * @param int|null $pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetStages, HTTP status code, HTTP response headers (array of strings) + */ + public function getStagesWithHttpInfo($pipeline_id = null, $start = 0, $limit = null) + { + $request = $this->getStagesRequest($pipeline_id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getStagesRequest($pipeline_id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetStages' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetStages', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetStages' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetStages', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetStages', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getStagesAsync + * + * Get all stages + * + * @param int|null $pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getStagesAsync($pipeline_id = null, $start = 0, $limit = null): PromiseInterface + { + return $this->getStagesAsyncWithHttpInfo($pipeline_id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getStagesAsyncWithHttpInfo + * + * Get all stages + * + * @param int|null $pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getStagesAsyncWithHttpInfo($pipeline_id = null, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetStages'; + $request = $this->getStagesRequest($pipeline_id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getStages' + * + * @param int|null $pipeline_id The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. (optional) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getStagesRequest($pipeline_id = null, $start = 0, $limit = null): Request + { + + $resourcePath = '/stages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($pipeline_id)) { + $pipeline_id = ObjectSerializer::serializeCollection($pipeline_id, '', true); + } + if ($pipeline_id !== null) { + $queryParams['pipeline_id'] = $pipeline_id; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateStage + * + * Update stage details + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\UpdateStageRequest|null $update_stage_request update_stage_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetAddUpdateStage + */ + public function updateStage($id, $update_stage_request = null) + { + list($response) = $this->updateStageWithHttpInfo($id, $update_stage_request); + return $response; + } + + /** + * Operation updateStageWithHttpInfo + * + * Update stage details + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\UpdateStageRequest|null $update_stage_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetAddUpdateStage, HTTP status code, HTTP response headers (array of strings) + */ + public function updateStageWithHttpInfo($id, $update_stage_request = null) + { + $request = $this->updateStageRequest($id, $update_stage_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateStageRequest($id, $update_stage_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddUpdateStage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddUpdateStage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetAddUpdateStage' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetAddUpdateStage', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetAddUpdateStage', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateStageAsync + * + * Update stage details + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\UpdateStageRequest|null $update_stage_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateStageAsync($id, $update_stage_request = null): PromiseInterface + { + return $this->updateStageAsyncWithHttpInfo($id, $update_stage_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateStageAsyncWithHttpInfo + * + * Update stage details + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\UpdateStageRequest|null $update_stage_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateStageAsyncWithHttpInfo($id, $update_stage_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetAddUpdateStage'; + $request = $this->updateStageRequest($id, $update_stage_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateStage' + * + * @param int $id The ID of the stage (required) + * @param \Pipedrive\Model\UpdateStageRequest|null $update_stage_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateStageRequest($id, $update_stage_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateStage' + ); + } + + $resourcePath = '/stages/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_stage_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_stage_request)); + } else { + $httpBody = $update_stage_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/SubscriptionsApi.php b/lib/Api/SubscriptionsApi.php new file mode 100644 index 00000000..78d6a3dc --- /dev/null +++ b/lib/Api/SubscriptionsApi.php @@ -0,0 +1,2822 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addRecurringSubscription + * + * Add a recurring subscription + * + * @param \Pipedrive\Model\SubscriptionRecurringCreateRequest|null $subscription_recurring_create_request subscription_recurring_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function addRecurringSubscription($subscription_recurring_create_request = null) + { + list($response) = $this->addRecurringSubscriptionWithHttpInfo($subscription_recurring_create_request); + return $response; + } + + /** + * Operation addRecurringSubscriptionWithHttpInfo + * + * Add a recurring subscription + * + * @param \Pipedrive\Model\SubscriptionRecurringCreateRequest|null $subscription_recurring_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addRecurringSubscriptionWithHttpInfo($subscription_recurring_create_request = null) + { + $request = $this->addRecurringSubscriptionRequest($subscription_recurring_create_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addRecurringSubscriptionRequest($subscription_recurring_create_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addRecurringSubscriptionAsync + * + * Add a recurring subscription + * + * @param \Pipedrive\Model\SubscriptionRecurringCreateRequest|null $subscription_recurring_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addRecurringSubscriptionAsync($subscription_recurring_create_request = null): PromiseInterface + { + return $this->addRecurringSubscriptionAsyncWithHttpInfo($subscription_recurring_create_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addRecurringSubscriptionAsyncWithHttpInfo + * + * Add a recurring subscription + * + * @param \Pipedrive\Model\SubscriptionRecurringCreateRequest|null $subscription_recurring_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addRecurringSubscriptionAsyncWithHttpInfo($subscription_recurring_create_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->addRecurringSubscriptionRequest($subscription_recurring_create_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addRecurringSubscription' + * + * @param \Pipedrive\Model\SubscriptionRecurringCreateRequest|null $subscription_recurring_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addRecurringSubscriptionRequest($subscription_recurring_create_request = null): Request + { + + $resourcePath = '/subscriptions/recurring'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($subscription_recurring_create_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subscription_recurring_create_request)); + } else { + $httpBody = $subscription_recurring_create_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation addSubscriptionInstallment + * + * Add an installment subscription + * + * @param \Pipedrive\Model\SubscriptionInstallmentCreateRequest|null $subscription_installment_create_request subscription_installment_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function addSubscriptionInstallment($subscription_installment_create_request = null) + { + list($response) = $this->addSubscriptionInstallmentWithHttpInfo($subscription_installment_create_request); + return $response; + } + + /** + * Operation addSubscriptionInstallmentWithHttpInfo + * + * Add an installment subscription + * + * @param \Pipedrive\Model\SubscriptionInstallmentCreateRequest|null $subscription_installment_create_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addSubscriptionInstallmentWithHttpInfo($subscription_installment_create_request = null) + { + $request = $this->addSubscriptionInstallmentRequest($subscription_installment_create_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addSubscriptionInstallmentRequest($subscription_installment_create_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addSubscriptionInstallmentAsync + * + * Add an installment subscription + * + * @param \Pipedrive\Model\SubscriptionInstallmentCreateRequest|null $subscription_installment_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addSubscriptionInstallmentAsync($subscription_installment_create_request = null): PromiseInterface + { + return $this->addSubscriptionInstallmentAsyncWithHttpInfo($subscription_installment_create_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addSubscriptionInstallmentAsyncWithHttpInfo + * + * Add an installment subscription + * + * @param \Pipedrive\Model\SubscriptionInstallmentCreateRequest|null $subscription_installment_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addSubscriptionInstallmentAsyncWithHttpInfo($subscription_installment_create_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->addSubscriptionInstallmentRequest($subscription_installment_create_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addSubscriptionInstallment' + * + * @param \Pipedrive\Model\SubscriptionInstallmentCreateRequest|null $subscription_installment_create_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addSubscriptionInstallmentRequest($subscription_installment_create_request = null): Request + { + + $resourcePath = '/subscriptions/installment'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($subscription_installment_create_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subscription_installment_create_request)); + } else { + $httpBody = $subscription_installment_create_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cancelRecurringSubscription + * + * Cancel a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringCancelRequest|null $subscription_recurring_cancel_request subscription_recurring_cancel_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function cancelRecurringSubscription($id, $subscription_recurring_cancel_request = null) + { + list($response) = $this->cancelRecurringSubscriptionWithHttpInfo($id, $subscription_recurring_cancel_request); + return $response; + } + + /** + * Operation cancelRecurringSubscriptionWithHttpInfo + * + * Cancel a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringCancelRequest|null $subscription_recurring_cancel_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function cancelRecurringSubscriptionWithHttpInfo($id, $subscription_recurring_cancel_request = null) + { + $request = $this->cancelRecurringSubscriptionRequest($id, $subscription_recurring_cancel_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->cancelRecurringSubscriptionRequest($id, $subscription_recurring_cancel_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cancelRecurringSubscriptionAsync + * + * Cancel a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringCancelRequest|null $subscription_recurring_cancel_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function cancelRecurringSubscriptionAsync($id, $subscription_recurring_cancel_request = null): PromiseInterface + { + return $this->cancelRecurringSubscriptionAsyncWithHttpInfo($id, $subscription_recurring_cancel_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cancelRecurringSubscriptionAsyncWithHttpInfo + * + * Cancel a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringCancelRequest|null $subscription_recurring_cancel_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function cancelRecurringSubscriptionAsyncWithHttpInfo($id, $subscription_recurring_cancel_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->cancelRecurringSubscriptionRequest($id, $subscription_recurring_cancel_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cancelRecurringSubscription' + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringCancelRequest|null $subscription_recurring_cancel_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function cancelRecurringSubscriptionRequest($id, $subscription_recurring_cancel_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling cancelRecurringSubscription' + ); + } + + $resourcePath = '/subscriptions/recurring/{id}/cancel'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($subscription_recurring_cancel_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subscription_recurring_cancel_request)); + } else { + $httpBody = $subscription_recurring_cancel_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteSubscription + * + * Delete a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function deleteSubscription($id) + { + list($response) = $this->deleteSubscriptionWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteSubscriptionWithHttpInfo + * + * Delete a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteSubscriptionWithHttpInfo($id) + { + $request = $this->deleteSubscriptionRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteSubscriptionRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteSubscriptionAsync + * + * Delete a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteSubscriptionAsync($id): PromiseInterface + { + return $this->deleteSubscriptionAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteSubscriptionAsyncWithHttpInfo + * + * Delete a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteSubscriptionAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->deleteSubscriptionRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteSubscription' + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteSubscriptionRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteSubscription' + ); + } + + $resourcePath = '/subscriptions/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation findSubscriptionByDeal + * + * Find subscription by deal + * + * @param int $deal_id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function findSubscriptionByDeal($deal_id) + { + list($response) = $this->findSubscriptionByDealWithHttpInfo($deal_id); + return $response; + } + + /** + * Operation findSubscriptionByDealWithHttpInfo + * + * Find subscription by deal + * + * @param int $deal_id The ID of the deal (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function findSubscriptionByDealWithHttpInfo($deal_id) + { + $request = $this->findSubscriptionByDealRequest($deal_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->findSubscriptionByDealRequest($deal_id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation findSubscriptionByDealAsync + * + * Find subscription by deal + * + * @param int $deal_id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function findSubscriptionByDealAsync($deal_id): PromiseInterface + { + return $this->findSubscriptionByDealAsyncWithHttpInfo($deal_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation findSubscriptionByDealAsyncWithHttpInfo + * + * Find subscription by deal + * + * @param int $deal_id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function findSubscriptionByDealAsyncWithHttpInfo($deal_id): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->findSubscriptionByDealRequest($deal_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'findSubscriptionByDeal' + * + * @param int $deal_id The ID of the deal (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function findSubscriptionByDealRequest($deal_id): Request + { + // verify the required parameter 'deal_id' is set + /* @phpstan-ignore-next-line */ + if ($deal_id === null || (is_array($deal_id) && count($deal_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $deal_id when calling findSubscriptionByDeal' + ); + } + + $resourcePath = '/subscriptions/find/{dealId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($deal_id !== null) { + $resourcePath = str_replace( + '{' . 'dealId' . '}', + ObjectSerializer::toPathValue($deal_id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSubscription + * + * Get details of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function getSubscription($id) + { + list($response) = $this->getSubscriptionWithHttpInfo($id); + return $response; + } + + /** + * Operation getSubscriptionWithHttpInfo + * + * Get details of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSubscriptionWithHttpInfo($id) + { + $request = $this->getSubscriptionRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getSubscriptionRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSubscriptionAsync + * + * Get details of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getSubscriptionAsync($id): PromiseInterface + { + return $this->getSubscriptionAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSubscriptionAsyncWithHttpInfo + * + * Get details of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getSubscriptionAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->getSubscriptionRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSubscription' + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getSubscriptionRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getSubscription' + ); + } + + $resourcePath = '/subscriptions/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSubscriptionPayments + * + * Get all payments of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\PaymentsResponse + */ + public function getSubscriptionPayments($id) + { + list($response) = $this->getSubscriptionPaymentsWithHttpInfo($id); + return $response; + } + + /** + * Operation getSubscriptionPaymentsWithHttpInfo + * + * Get all payments of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\PaymentsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getSubscriptionPaymentsWithHttpInfo($id) + { + $request = $this->getSubscriptionPaymentsRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getSubscriptionPaymentsRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PaymentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PaymentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\PaymentsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\PaymentsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\PaymentsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSubscriptionPaymentsAsync + * + * Get all payments of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getSubscriptionPaymentsAsync($id): PromiseInterface + { + return $this->getSubscriptionPaymentsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSubscriptionPaymentsAsyncWithHttpInfo + * + * Get all payments of a subscription + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getSubscriptionPaymentsAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\PaymentsResponse'; + $request = $this->getSubscriptionPaymentsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSubscriptionPayments' + * + * @param int $id The ID of the subscription (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getSubscriptionPaymentsRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getSubscriptionPayments' + ); + } + + $resourcePath = '/subscriptions/{id}/payments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateRecurringSubscription + * + * Update a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringUpdateRequest|null $subscription_recurring_update_request subscription_recurring_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function updateRecurringSubscription($id, $subscription_recurring_update_request = null) + { + list($response) = $this->updateRecurringSubscriptionWithHttpInfo($id, $subscription_recurring_update_request); + return $response; + } + + /** + * Operation updateRecurringSubscriptionWithHttpInfo + * + * Update a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringUpdateRequest|null $subscription_recurring_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateRecurringSubscriptionWithHttpInfo($id, $subscription_recurring_update_request = null) + { + $request = $this->updateRecurringSubscriptionRequest($id, $subscription_recurring_update_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateRecurringSubscriptionRequest($id, $subscription_recurring_update_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateRecurringSubscriptionAsync + * + * Update a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringUpdateRequest|null $subscription_recurring_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateRecurringSubscriptionAsync($id, $subscription_recurring_update_request = null): PromiseInterface + { + return $this->updateRecurringSubscriptionAsyncWithHttpInfo($id, $subscription_recurring_update_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateRecurringSubscriptionAsyncWithHttpInfo + * + * Update a recurring subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringUpdateRequest|null $subscription_recurring_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateRecurringSubscriptionAsyncWithHttpInfo($id, $subscription_recurring_update_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->updateRecurringSubscriptionRequest($id, $subscription_recurring_update_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateRecurringSubscription' + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionRecurringUpdateRequest|null $subscription_recurring_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateRecurringSubscriptionRequest($id, $subscription_recurring_update_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateRecurringSubscription' + ); + } + + $resourcePath = '/subscriptions/recurring/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($subscription_recurring_update_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subscription_recurring_update_request)); + } else { + $httpBody = $subscription_recurring_update_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSubscriptionInstallment + * + * Update an installment subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionInstallmentUpdateRequest|null $subscription_installment_update_request subscription_installment_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\SubscriptionsIdResponse + */ + public function updateSubscriptionInstallment($id, $subscription_installment_update_request = null) + { + list($response) = $this->updateSubscriptionInstallmentWithHttpInfo($id, $subscription_installment_update_request); + return $response; + } + + /** + * Operation updateSubscriptionInstallmentWithHttpInfo + * + * Update an installment subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionInstallmentUpdateRequest|null $subscription_installment_update_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\SubscriptionsIdResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSubscriptionInstallmentWithHttpInfo($id, $subscription_installment_update_request = null) + { + $request = $this->updateSubscriptionInstallmentRequest($id, $subscription_installment_update_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateSubscriptionInstallmentRequest($id, $subscription_installment_update_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\SubscriptionsIdResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\SubscriptionsIdResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\SubscriptionsIdResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSubscriptionInstallmentAsync + * + * Update an installment subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionInstallmentUpdateRequest|null $subscription_installment_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateSubscriptionInstallmentAsync($id, $subscription_installment_update_request = null): PromiseInterface + { + return $this->updateSubscriptionInstallmentAsyncWithHttpInfo($id, $subscription_installment_update_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSubscriptionInstallmentAsyncWithHttpInfo + * + * Update an installment subscription + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionInstallmentUpdateRequest|null $subscription_installment_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateSubscriptionInstallmentAsyncWithHttpInfo($id, $subscription_installment_update_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\SubscriptionsIdResponse'; + $request = $this->updateSubscriptionInstallmentRequest($id, $subscription_installment_update_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSubscriptionInstallment' + * + * @param int $id The ID of the subscription (required) + * @param \Pipedrive\Model\SubscriptionInstallmentUpdateRequest|null $subscription_installment_update_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateSubscriptionInstallmentRequest($id, $subscription_installment_update_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateSubscriptionInstallment' + ); + } + + $resourcePath = '/subscriptions/installment/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($subscription_installment_update_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subscription_installment_update_request)); + } else { + $httpBody = $subscription_installment_update_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/UserConnectionsApi.php b/lib/Api/UserConnectionsApi.php new file mode 100644 index 00000000..e09ccc72 --- /dev/null +++ b/lib/Api/UserConnectionsApi.php @@ -0,0 +1,440 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getUserConnections + * + * Get all user connections + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserConnections|\Pipedrive\Model\Unauthorized + */ + public function getUserConnections() + { + list($response) = $this->getUserConnectionsWithHttpInfo(); + return $response; + } + + /** + * Operation getUserConnectionsWithHttpInfo + * + * Get all user connections + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserConnections|\Pipedrive\Model\Unauthorized, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserConnectionsWithHttpInfo() + { + $request = $this->getUserConnectionsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserConnectionsRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserConnections' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserConnections', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserConnections' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserConnections', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserConnections', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserConnectionsAsync + * + * Get all user connections + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserConnectionsAsync(): PromiseInterface + { + return $this->getUserConnectionsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserConnectionsAsyncWithHttpInfo + * + * Get all user connections + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserConnectionsAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserConnections'; + $request = $this->getUserConnectionsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserConnections' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserConnectionsRequest(): Request + { + + $resourcePath = '/userConnections'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/UserSettingsApi.php b/lib/Api/UserSettingsApi.php new file mode 100644 index 00000000..f1bad569 --- /dev/null +++ b/lib/Api/UserSettingsApi.php @@ -0,0 +1,440 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 getUserSettings + * + * List settings of an authorized user + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserSettings|\Pipedrive\Model\Unauthorized + */ + public function getUserSettings() + { + list($response) = $this->getUserSettingsWithHttpInfo(); + return $response; + } + + /** + * Operation getUserSettingsWithHttpInfo + * + * List settings of an authorized user + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserSettings|\Pipedrive\Model\Unauthorized, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserSettingsWithHttpInfo() + { + $request = $this->getUserSettingsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserSettingsRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserSettingsAsync + * + * List settings of an authorized user + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserSettingsAsync(): PromiseInterface + { + return $this->getUserSettingsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserSettingsAsyncWithHttpInfo + * + * List settings of an authorized user + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserSettingsAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserSettings'; + $request = $this->getUserSettingsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserSettings' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserSettingsRequest(): Request + { + + $resourcePath = '/userSettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/Api/UsersApi.php b/lib/Api/UsersApi.php new file mode 100644 index 00000000..656d8650 --- /dev/null +++ b/lib/Api/UsersApi.php @@ -0,0 +1,3230 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addUser + * + * Add a new user + * + * @param \Pipedrive\Model\AddUserRequest|null $add_user_request add_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\User|\Pipedrive\Model\FailResponse + */ + public function addUser($add_user_request = null) + { + list($response) = $this->addUserWithHttpInfo($add_user_request); + return $response; + } + + /** + * Operation addUserWithHttpInfo + * + * Add a new user + * + * @param \Pipedrive\Model\AddUserRequest|null $add_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\User|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function addUserWithHttpInfo($add_user_request = null) + { + $request = $this->addUserRequest($add_user_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addUserRequest($add_user_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\User' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\User' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addUserAsync + * + * Add a new user + * + * @param \Pipedrive\Model\AddUserRequest|null $add_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addUserAsync($add_user_request = null): PromiseInterface + { + return $this->addUserAsyncWithHttpInfo($add_user_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addUserAsyncWithHttpInfo + * + * Add a new user + * + * @param \Pipedrive\Model\AddUserRequest|null $add_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addUserAsyncWithHttpInfo($add_user_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\User'; + $request = $this->addUserRequest($add_user_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addUser' + * + * @param \Pipedrive\Model\AddUserRequest|null $add_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addUserRequest($add_user_request = null): Request + { + + $resourcePath = '/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_user_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_user_request)); + } else { + $httpBody = $add_user_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation findUsersByName + * + * Find users by name + * + * @param string $term The search term to look for (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $search_by_email When enabled, the term will only be matched against email addresses of users. Default: `false` (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Users + */ + public function findUsersByName($term, $search_by_email = null) + { + list($response) = $this->findUsersByNameWithHttpInfo($term, $search_by_email); + return $response; + } + + /** + * Operation findUsersByNameWithHttpInfo + * + * Find users by name + * + * @param string $term The search term to look for (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $search_by_email When enabled, the term will only be matched against email addresses of users. Default: `false` (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Users, HTTP status code, HTTP response headers (array of strings) + */ + public function findUsersByNameWithHttpInfo($term, $search_by_email = null) + { + $request = $this->findUsersByNameRequest($term, $search_by_email); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->findUsersByNameRequest($term, $search_by_email); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Users' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Users', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Users' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Users', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Users', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation findUsersByNameAsync + * + * Find users by name + * + * @param string $term The search term to look for (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $search_by_email When enabled, the term will only be matched against email addresses of users. Default: `false` (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function findUsersByNameAsync($term, $search_by_email = null): PromiseInterface + { + return $this->findUsersByNameAsyncWithHttpInfo($term, $search_by_email) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation findUsersByNameAsyncWithHttpInfo + * + * Find users by name + * + * @param string $term The search term to look for (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $search_by_email When enabled, the term will only be matched against email addresses of users. Default: `false` (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function findUsersByNameAsyncWithHttpInfo($term, $search_by_email = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Users'; + $request = $this->findUsersByNameRequest($term, $search_by_email); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'findUsersByName' + * + * @param string $term The search term to look for (required) + * @param \Pipedrive\Model\NumberBooleanDefault0|null $search_by_email When enabled, the term will only be matched against email addresses of users. Default: `false` (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function findUsersByNameRequest($term, $search_by_email = null): Request + { + // verify the required parameter 'term' is set + /* @phpstan-ignore-next-line */ + if ($term === null || (is_array($term) && count($term) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $term when calling findUsersByName' + ); + } + + $resourcePath = '/users/find'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($term)) { + $term = ObjectSerializer::serializeCollection($term, '', true); + } + if ($term !== null) { + $queryParams['term'] = $term; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($search_by_email)) { + $search_by_email = ObjectSerializer::serializeCollection($search_by_email, '', true); + } + if ($search_by_email !== null) { + $queryParams['search_by_email'] = $search_by_email; + } + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getCurrentUser + * + * Get current user data + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserMe|\Pipedrive\Model\Unauthorized + */ + public function getCurrentUser() + { + list($response) = $this->getCurrentUserWithHttpInfo(); + return $response; + } + + /** + * Operation getCurrentUserWithHttpInfo + * + * Get current user data + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserMe|\Pipedrive\Model\Unauthorized, HTTP status code, HTTP response headers (array of strings) + */ + public function getCurrentUserWithHttpInfo() + { + $request = $this->getCurrentUserRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getCurrentUserRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserMe' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserMe', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserMe' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserMe', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserMe', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCurrentUserAsync + * + * Get current user data + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCurrentUserAsync(): PromiseInterface + { + return $this->getCurrentUserAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCurrentUserAsyncWithHttpInfo + * + * Get current user data + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getCurrentUserAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserMe'; + $request = $this->getCurrentUserRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getCurrentUser' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getCurrentUserRequest(): Request + { + + $resourcePath = '/users/me'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUser + * + * Get one user + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\User|\Pipedrive\Model\FailResponse + */ + public function getUser($id) + { + list($response) = $this->getUserWithHttpInfo($id); + return $response; + } + + /** + * Operation getUserWithHttpInfo + * + * Get one user + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\User|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserWithHttpInfo($id) + { + $request = $this->getUserRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\User' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\User' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserAsync + * + * Get one user + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserAsync($id): PromiseInterface + { + return $this->getUserAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserAsyncWithHttpInfo + * + * Get one user + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\User'; + $request = $this->getUserRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUser' + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUser' + ); + } + + $resourcePath = '/users/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserFollowers + * + * List followers of a user + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse + */ + public function getUserFollowers($id) + { + list($response) = $this->getUserFollowersWithHttpInfo($id); + return $response; + } + + /** + * Operation getUserFollowersWithHttpInfo + * + * List followers of a user + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserIDs|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserFollowersWithHttpInfo($id) + { + $request = $this->getUserFollowersRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserFollowersRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserIDs' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserIDs', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserIDs', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserFollowersAsync + * + * List followers of a user + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserFollowersAsync($id): PromiseInterface + { + return $this->getUserFollowersAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserFollowersAsyncWithHttpInfo + * + * List followers of a user + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserFollowersAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserIDs'; + $request = $this->getUserFollowersRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserFollowers' + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserFollowersRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUserFollowers' + ); + } + + $resourcePath = '/users/{id}/followers'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserPermissions + * + * List user permissions + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\UserPermissions + */ + public function getUserPermissions($id) + { + list($response) = $this->getUserPermissionsWithHttpInfo($id); + return $response; + } + + /** + * Operation getUserPermissionsWithHttpInfo + * + * List user permissions + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\UserPermissions, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserPermissionsWithHttpInfo($id) + { + $request = $this->getUserPermissionsRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserPermissionsRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserPermissions' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserPermissions', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\UserPermissions' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\UserPermissions', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\UserPermissions', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserPermissionsAsync + * + * List user permissions + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserPermissionsAsync($id): PromiseInterface + { + return $this->getUserPermissionsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserPermissionsAsyncWithHttpInfo + * + * List user permissions + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserPermissionsAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\UserPermissions'; + $request = $this->getUserPermissionsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserPermissions' + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserPermissionsRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUserPermissions' + ); + } + + $resourcePath = '/users/{id}/permissions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserRoleAssignments + * + * List role assignments + * + * @param int $id The ID of the user (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRoleAssignments + */ + public function getUserRoleAssignments($id, $start = 0, $limit = null) + { + list($response) = $this->getUserRoleAssignmentsWithHttpInfo($id, $start, $limit); + return $response; + } + + /** + * Operation getUserRoleAssignmentsWithHttpInfo + * + * List role assignments + * + * @param int $id The ID of the user (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRoleAssignments, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserRoleAssignmentsWithHttpInfo($id, $start = 0, $limit = null) + { + $request = $this->getUserRoleAssignmentsRequest($id, $start, $limit); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserRoleAssignmentsRequest($id, $start, $limit); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleAssignments' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleAssignments', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleAssignments' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleAssignments', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRoleAssignments', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserRoleAssignmentsAsync + * + * List role assignments + * + * @param int $id The ID of the user (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserRoleAssignmentsAsync($id, $start = 0, $limit = null): PromiseInterface + { + return $this->getUserRoleAssignmentsAsyncWithHttpInfo($id, $start, $limit) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserRoleAssignmentsAsyncWithHttpInfo + * + * List role assignments + * + * @param int $id The ID of the user (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserRoleAssignmentsAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRoleAssignments'; + $request = $this->getUserRoleAssignmentsRequest($id, $start, $limit); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserRoleAssignments' + * + * @param int $id The ID of the user (required) + * @param int|0 $start Pagination start (optional, default to 0) + * @param int|null $limit Items shown per page (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserRoleAssignmentsRequest($id, $start = 0, $limit = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUserRoleAssignments' + ); + } + + $resourcePath = '/users/{id}/roleAssignments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + /* @phpstan-ignore-next-line */ + if (is_array($start)) { + $start = ObjectSerializer::serializeCollection($start, '', true); + } + if ($start !== null) { + $queryParams['start'] = $start; + } + // query params + /* @phpstan-ignore-next-line */ + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUserRoleSettings + * + * List user role settings + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\GetRoleSettings + */ + public function getUserRoleSettings($id) + { + list($response) = $this->getUserRoleSettingsWithHttpInfo($id); + return $response; + } + + /** + * Operation getUserRoleSettingsWithHttpInfo + * + * List user role settings + * + * @param int $id The ID of the user (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\GetRoleSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getUserRoleSettingsWithHttpInfo($id) + { + $request = $this->getUserRoleSettingsRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUserRoleSettingsRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\GetRoleSettings' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\GetRoleSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\GetRoleSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUserRoleSettingsAsync + * + * List user role settings + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserRoleSettingsAsync($id): PromiseInterface + { + return $this->getUserRoleSettingsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUserRoleSettingsAsyncWithHttpInfo + * + * List user role settings + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUserRoleSettingsAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\GetRoleSettings'; + $request = $this->getUserRoleSettingsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUserRoleSettings' + * + * @param int $id The ID of the user (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUserRoleSettingsRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getUserRoleSettings' + ); + } + + $resourcePath = '/users/{id}/roleSettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getUsers + * + * Get all users + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Users + */ + public function getUsers() + { + list($response) = $this->getUsersWithHttpInfo(); + return $response; + } + + /** + * Operation getUsersWithHttpInfo + * + * Get all users + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Users, HTTP status code, HTTP response headers (array of strings) + */ + public function getUsersWithHttpInfo() + { + $request = $this->getUsersRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getUsersRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Users' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Users', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Users' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Users', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Users', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getUsersAsync + * + * Get all users + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUsersAsync(): PromiseInterface + { + return $this->getUsersAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getUsersAsyncWithHttpInfo + * + * Get all users + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getUsersAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\Users'; + $request = $this->getUsersRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getUsers' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getUsersRequest(): Request + { + + $resourcePath = '/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateUser + * + * Update user details + * + * @param int $id The ID of the user (required) + * @param \Pipedrive\Model\UpdateUserRequest|null $update_user_request update_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\User|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse + */ + public function updateUser($id, $update_user_request = null) + { + list($response) = $this->updateUserWithHttpInfo($id, $update_user_request); + return $response; + } + + /** + * Operation updateUserWithHttpInfo + * + * Update user details + * + * @param int $id The ID of the user (required) + * @param \Pipedrive\Model\UpdateUserRequest|null $update_user_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\User|\Pipedrive\Model\FailResponse|\Pipedrive\Model\FailResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateUserWithHttpInfo($id, $update_user_request = null) + { + $request = $this->updateUserRequest($id, $update_user_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->updateUserRequest($id, $update_user_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\User' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\FailResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\FailResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\User' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\User', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\FailResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateUserAsync + * + * Update user details + * + * @param int $id The ID of the user (required) + * @param \Pipedrive\Model\UpdateUserRequest|null $update_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateUserAsync($id, $update_user_request = null): PromiseInterface + { + return $this->updateUserAsyncWithHttpInfo($id, $update_user_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateUserAsyncWithHttpInfo + * + * Update user details + * + * @param int $id The ID of the user (required) + * @param \Pipedrive\Model\UpdateUserRequest|null $update_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function updateUserAsyncWithHttpInfo($id, $update_user_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\User'; + $request = $this->updateUserRequest($id, $update_user_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateUser' + * + * @param int $id The ID of the user (required) + * @param \Pipedrive\Model\UpdateUserRequest|null $update_user_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function updateUserRequest($id, $update_user_request = null): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateUser' + ); + } + + $resourcePath = '/users/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($update_user_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_user_request)); + } else { + $httpBody = $update_user_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $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/lib/Api/WebhooksApi.php b/lib/Api/WebhooksApi.php new file mode 100644 index 00000000..05d7fc4c --- /dev/null +++ b/lib/Api/WebhooksApi.php @@ -0,0 +1,1128 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $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 addWebhook + * + * Create a new Webhook + * + * @param \Pipedrive\Model\AddWebhookRequest|null $add_webhook_request add_webhook_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Webhook|\Pipedrive\Model\WebhookBadRequest|\Pipedrive\Model\Unauthorized + */ + public function addWebhook($add_webhook_request = null) + { + list($response) = $this->addWebhookWithHttpInfo($add_webhook_request); + return $response; + } + + /** + * Operation addWebhookWithHttpInfo + * + * Create a new Webhook + * + * @param \Pipedrive\Model\AddWebhookRequest|null $add_webhook_request (optional) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Webhook|\Pipedrive\Model\WebhookBadRequest|\Pipedrive\Model\Unauthorized, HTTP status code, HTTP response headers (array of strings) + */ + public function addWebhookWithHttpInfo($add_webhook_request = null) + { + $request = $this->addWebhookRequest($add_webhook_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->addWebhookRequest($add_webhook_request); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->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: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Webhook' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Webhook', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\WebhookBadRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\WebhookBadRequest', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Webhook' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Webhook', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Webhook', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\WebhookBadRequest', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation addWebhookAsync + * + * Create a new Webhook + * + * @param \Pipedrive\Model\AddWebhookRequest|null $add_webhook_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addWebhookAsync($add_webhook_request = null): PromiseInterface + { + return $this->addWebhookAsyncWithHttpInfo($add_webhook_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation addWebhookAsyncWithHttpInfo + * + * Create a new Webhook + * + * @param \Pipedrive\Model\AddWebhookRequest|null $add_webhook_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function addWebhookAsyncWithHttpInfo($add_webhook_request = null): PromiseInterface + { + $returnType = '\Pipedrive\Model\Webhook'; + $request = $this->addWebhookRequest($add_webhook_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'addWebhook' + * + * @param \Pipedrive\Model\AddWebhookRequest|null $add_webhook_request (optional) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function addWebhookRequest($add_webhook_request = null): Request + { + + $resourcePath = '/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($add_webhook_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_webhook_request)); + } else { + $httpBody = $add_webhook_request; + } + } elseif (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteWebhook + * + * Delete existing Webhook + * + * @param int $id The ID of the Webhook to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\BaseResponseWithStatus|\Pipedrive\Model\Unauthorized|\Pipedrive\Model\WebhooksDeleteForbiddenSchema|\Pipedrive\Model\WebhookBadRequest + */ + public function deleteWebhook($id) + { + list($response) = $this->deleteWebhookWithHttpInfo($id); + return $response; + } + + /** + * Operation deleteWebhookWithHttpInfo + * + * Delete existing Webhook + * + * @param int $id The ID of the Webhook to delete (required) + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\BaseResponseWithStatus|\Pipedrive\Model\Unauthorized|\Pipedrive\Model\WebhooksDeleteForbiddenSchema|\Pipedrive\Model\WebhookBadRequest, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteWebhookWithHttpInfo($id) + { + $request = $this->deleteWebhookRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->deleteWebhookRequest($id); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BaseResponseWithStatus' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BaseResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\WebhooksDeleteForbiddenSchema' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\WebhooksDeleteForbiddenSchema', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\WebhookBadRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\WebhookBadRequest', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\BaseResponseWithStatus' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\BaseResponseWithStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\BaseResponseWithStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\WebhooksDeleteForbiddenSchema', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\WebhookBadRequest', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteWebhookAsync + * + * Delete existing Webhook + * + * @param int $id The ID of the Webhook to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteWebhookAsync($id): PromiseInterface + { + return $this->deleteWebhookAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteWebhookAsyncWithHttpInfo + * + * Delete existing Webhook + * + * @param int $id The ID of the Webhook to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function deleteWebhookAsyncWithHttpInfo($id): PromiseInterface + { + $returnType = '\Pipedrive\Model\BaseResponseWithStatus'; + $request = $this->deleteWebhookRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw 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 int $id The ID of the Webhook to delete (required) + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function deleteWebhookRequest($id): Request + { + // verify the required parameter 'id' is set + /* @phpstan-ignore-next-line */ + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteWebhook' + ); + } + + $resourcePath = '/webhooks/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getWebhooks + * + * Get all Webhooks + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return \Pipedrive\Model\Webhooks|\Pipedrive\Model\Unauthorized + */ + public function getWebhooks() + { + list($response) = $this->getWebhooksWithHttpInfo(); + return $response; + } + + /** + * Operation getWebhooksWithHttpInfo + * + * Get all Webhooks + * + * + * @throws ApiException on non-2xx response + * @throws InvalidArgumentException|GuzzleException + * @return array of \Pipedrive\Model\Webhooks|\Pipedrive\Model\Unauthorized, HTTP status code, HTTP response headers (array of strings) + */ + public function getWebhooksWithHttpInfo() + { + $request = $this->getWebhooksRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + if ($e->getCode() === 401 && $this->config->isRefreshPossible()) { + $this->config->refreshToken(); + $request = $this->getWebhooksRequest(); + $response = $this->client->send($request, $options); + } else { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Webhooks' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Webhooks', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Unauthorized' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Unauthorized', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + /* @phpstan-ignore-next-line */ + if ('\Pipedrive\Model\Webhooks' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Pipedrive\Model\Webhooks', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Webhooks', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Pipedrive\Model\Unauthorized', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getWebhooksAsync + * + * Get all Webhooks + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getWebhooksAsync(): PromiseInterface + { + return $this->getWebhooksAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getWebhooksAsyncWithHttpInfo + * + * Get all Webhooks + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return PromiseInterface + */ + public function getWebhooksAsyncWithHttpInfo(): PromiseInterface + { + $returnType = '\Pipedrive\Model\Webhooks'; + $request = $this->getWebhooksRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + /* @phpstan-ignore-next-line */ + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getWebhooks' + * + * + * @throws InvalidArgumentException|OAuthProviderException + * @return Request + */ + public function getWebhooksRequest(): Request + { + + $resourcePath = '/webhooks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + /* @phpstan-ignore-next-line */ + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (count($formParams) > 0) { + /* @phpstan-ignore-next-line */ + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = Utils::jsonEncode($formParams); + + } else { + // for HTTP post (form) + $httpBody = Query::build($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_token'); + if ($apiKey !== null) { + $queryParams['api_token'] = $apiKey; + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + // If access token is expired + if ($this->config->isRefreshPossible() && $this->config->getExpiresAt() <= time()) { + $this->config->refreshToken(); + } + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/lib/ApiException.php b/lib/ApiException.php new file mode 100644 index 00000000..b5a386a6 --- /dev/null +++ b/lib/ApiException.php @@ -0,0 +1,121 @@ +|null + */ + protected ?array $responseHeaders; + + /** + * The deserialized response object + * + * @var stdClass|string|null + */ + protected $responseObject; + + /** + * Constructor + * + * @param string $message Error message + * @param int $code HTTP status code + * @param array|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string + */ + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + { + parent::__construct($message, $code); + $this->responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return array|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() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return stdClass|string|null the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/lib/Configuration.php b/lib/Configuration.php new file mode 100644 index 00000000..14f817ac --- /dev/null +++ b/lib/Configuration.php @@ -0,0 +1,855 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration(): Configuration + { + if (!isset(self::$defaultConfiguration)) { + 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) + { + self::$defaultConfiguration = $config; + } + + /** + * @return callable + */ + public function getOAuthTokenUpdateCallback(): callable + { + return $this->oAuthTokenUpdateCallback; + } + + /** + * @param callable $oAuthTokenUpdateCallback + * @return Configuration + */ + public function setOAuthTokenUpdateCallback(callable $oAuthTokenUpdateCallback): Configuration + { + $this->oAuthTokenUpdateCallback = $oAuthTokenUpdateCallback; + return $this; + } + + /** + * @return string + */ + public function getAuthorizationPageUrl(): string + { + $oauthHost = $this->getOAuthHost(); + $clientId = $this->getClientId(); + $oauthRedirectUri = $this->getOauthRedirectUri(); + + return "{$oauthHost}/oauth/authorize?client_id={$clientId}&redirect_uri={$oauthRedirectUri}"; + } + + /** + * @param string $authorizationPageUrl + * @return Configuration + */ + public function setAuthorizationPageUrl(string $authorizationPageUrl): Configuration + { + $this->authorizationPageUrl = $authorizationPageUrl; + return $this; + } + + /** + * Gets the client ID for OAuth + * + * @return string client ID for OAuth + */ + public function getClientId(): string + { + return $this->clientId; + } + + /** + * Sets the client ID for OAuth + * + * @param string $clientId for OAuth + * + * @return Configuration + */ + public function setClientId(string $clientId): Configuration + { + $this->clientId = $clientId; + return $this; + } + + /** + * Gets the client secret for OAuth + * + * @return string client secret for OAuth + */ + public function getClientSecret(): string + { + return $this->clientSecret; + } + + /** + * Sets the client secret for OAuth + * + * @param string $clientSecret for OAuth + * + * @return Configuration + */ + public function setClientSecret(string $clientSecret): Configuration + { + $this->clientSecret = $clientSecret; + return $this; + } + + /** + * @return string + */ + public function getOauthRedirectUri(): string + { + return $this->oauthRedirectUri; + } + + /** + * @param string $oauthRedirectUri + * @return Configuration + */ + public function setOauthRedirectUri(string $oauthRedirectUri): Configuration + { + $this->oauthRedirectUri = $oauthRedirectUri; + 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 API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return Configuration + */ + public function setApiKey(string $apiKeyIdentifier, string $key): Configuration + { + $this->apiKeys[$apiKeyIdentifier] = $key; + 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 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 Configuration + */ + public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): Configuration + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken(): string + { + return $this->accessToken; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return Configuration + */ + public function setAccessToken(string $accessToken): Configuration + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * @return string + */ + public function getOAuthHost(): string + { + return $this->oAuthHost; + } + + /** + * @param string $oAuthHost + * + * @return Configuration + */ + public function setOAuthHost(string $oAuthHost): Configuration + { + $this->oAuthHost = $oAuthHost; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost(): string + { + return $this->host; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return Configuration + */ + public function setHost(string $host): Configuration + { + $this->host = $host; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent(): string + { + return $this->userAgent; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws InvalidArgumentException + * @return Configuration + */ + public function setUserAgent(string $userAgent): Configuration + { + if (!is_string($userAgent)) { + throw new InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug(): bool + { + return $this->debug; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return Configuration + */ + public function setDebug(bool $debug): Configuration + { + $this->debug = $debug; + return $this; + } + + /** + * @return int + */ + public function getExpiresAt(): int + { + return $this->expiresAt; + } + + /** + * @param int $expiresAt + * + * @return Configuration + */ + public function setExpiresAt(int $expiresAt): Configuration + { + $this->expiresAt = $expiresAt; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile(): string + { + return $this->debugFile; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return Configuration + */ + public function setDebugFile(string $debugFile): Configuration + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath(): string + { + return $this->tempFolderPath; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return Configuration + */ + public function setTempFolderPath(string $tempFolderPath): Configuration + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * @return int + */ + public function getExpiresIn(): int + { + return $this->expiresIn; + } + + /** + * @param int $expiresIn + * @return Configuration + */ + public function setExpiresIn(int $expiresIn): Configuration + { + $this->expiresIn = $expiresIn; + return $this; + } + + /** + * @return string + */ + public function getRefreshToken(): string + { + return $this->refreshToken; + } + + /** + * @param string $refreshToken + * @return Configuration + */ + public function setRefreshToken(string $refreshToken): Configuration + { + $this->refreshToken = $refreshToken; + return $this; + } + + /** + * @return string + */ + public function getScope(): string + { + return $this->scope; + } + + /** + * @param string $scope + * @return Configuration + */ + public function setScope(string $scope): Configuration + { + $this->scope = $scope; + return $this; + } + + /** + * @return bool + */ + public function isRefreshPossible(): bool + { + if ($this->getClientId() === '' || + $this->getClientSecret() === '' || + $this->getOauthRedirectUri() === '' || + $this->getRefreshToken() === '') { + return false; + } + return true; + } + + /** + * Refreshes the OAuth 2 access token + * @return object The OAuth 2 token + * @throws OAuthProviderException + */ + public function refreshToken(): object + { + $client = new Client(); + + try { + $response = $client->request('POST', $this->getOAuthHost().'/oauth/token', [ + 'form_params' => [ + 'client_id' => $this->getClientId(), + 'client_secret' => $this->getClientSecret(), + 'redirect_uri' => $this->getOauthRedirectUri(), + 'grant_type' => 'refresh_token', + 'refresh_token' => $this->getRefreshToken(), + ] + ]); + + $oauthToken = (object) Utils::jsonDecode($response->getBody()->getContents()); + + $this->updateOAuthRelatedFields($oauthToken); + + return $oauthToken; + } catch (RequestException $e) { + throw new OAuthProviderException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (GuzzleException | Exception $e) { + throw new OAuthProviderException($e->getMessage(), (int) $e->getCode()); + } + } + + /** + * A utility function to set the OAuth2 relevant fields using data from the response of the token endpoint + * The fields set in $this of they exist in the passed in object: + * $this->expiresIn, $this->expiresAt, $this->accessToken, $this->refreshToken, $this->scope, $this->host + * + * The passed in oAuthToken should have the following structure + * + * $access_token + * $expires_in + * $refresh_token + * $scope + * $api_domain + * + * + * @param object $oAuthToken The token returned by the /token endpoint (See above) + * @return Configuration + */ + public function updateOAuthRelatedFields(object $oAuthToken): Configuration + { + if (property_exists($oAuthToken, 'expires_in') && $oAuthToken->expires_in !== null && $oAuthToken->expires_in != 0) { + $this->setExpiresAt(time() + $oAuthToken->expires_in); + $this->setExpiresIn($oAuthToken->expires_in); + } + + if (property_exists($oAuthToken, 'access_token') && $oAuthToken->access_token !== null) { + $this->setAccessToken($oAuthToken->access_token); + } + + if (property_exists($oAuthToken, 'refresh_token') && $oAuthToken->refresh_token !== null) { + $this->setRefreshToken($oAuthToken->refresh_token); + } + + if (property_exists($oAuthToken, 'scope') && $oAuthToken->scope !== null) { + $this->setScope($oAuthToken->scope); + } + + if (property_exists($oAuthToken, 'api_domain') && $oAuthToken->api_domain !== null) { + $this->setHost($oAuthToken->api_domain.'/v1'); + } + + if (is_callable($this->getOAuthTokenUpdateCallback())) { + call_user_func($this->getOAuthTokenUpdateCallback(), $oAuthToken); + } + + return $this; + } + + /** + * Authorizes the authorization code sent by the server and returns OAuth 2 token + * @param string $code Authorization code for the OAuth token + * @return object + * @throws OAuthProviderException + */ + public function authorize(string $code): object + { + $client = new Client(); + + try { + $response = $client->request('POST', $this->getOAuthHost() . '/oauth/token', [ + 'form_params' => [ + 'code' => $code, + 'client_id' => $this->getClientId(), + 'client_secret' => $this->getClientSecret(), + 'redirect_uri' => $this->getOauthRedirectUri(), + 'grant_type' => 'authorization_code' + ] + ]); + + $oAuthToken = (object) Utils::jsonDecode($response->getBody()->getContents()); + + $this->updateOAuthRelatedFields($oAuthToken); + + return $oAuthToken; + } catch (RequestException $e) { + throw new OAuthProviderException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (GuzzleException | Exception $e) { + throw new OAuthProviderException($e->getMessage(), (int) $e->getCode()); + } + } + + /** + * Revoke the Refresh Token aka marking an app as uninstalled, or revoke the Access Token + * @param string $tokenTypeHint optional token type to be revoked, values can be 'access_token' or 'refresh_token' + * @return void + * @throws OAuthProviderException + */ + public function revokeToken(string $tokenTypeHint = 'access_token'): void + { + $token = $tokenTypeHint === 'refresh_token' ? $this->getRefreshToken() : $this->getAccessToken(); + + $client = new Client(); + + try { + $client->request('POST', $this->getOAuthHost() . '/oauth/revoke', [ + 'form_params' => [ + 'client_id' => $this->getClientId(), + 'client_secret' => $this->getClientSecret(), + 'token_type_hint' => $tokenTypeHint, + 'token' => $token + ] + ]); + } catch (RequestException $e) { + throw new OAuthProviderException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (GuzzleException | Exception $e) { + throw new OAuthProviderException($e->getMessage(), (int) $e->getCode()); + } + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport(): string + { + $report = 'PHP SDK (Pipedrive) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 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 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 + { + if (null === $variables) { + $variables = []; + } + + $hosts = $this->getHostSettings(); + + // check array index out of bound + if ($index < 0 || $index >= sizeof($hosts)) { + throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + } + + $host = $hosts[$index]; + $url = $host["url"]; + + if (is_array($host["variables"])) { + // 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 (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 an array of host settings + * + * @return array> of host settings + */ + public function getHostSettings(): array + { + return [ + [ + "url" => "https://api.pipedrive.com/v1", + "description" => "No description provided", + ] + ]; + } +} \ No newline at end of file diff --git a/lib/Exceptions/OAuthProviderException.php b/lib/Exceptions/OAuthProviderException.php new file mode 100644 index 00000000..a9791873 --- /dev/null +++ b/lib/Exceptions/OAuthProviderException.php @@ -0,0 +1,40 @@ + + */ + public function selectHeaders(array $accept, array $contentTypes): array + { + $headers = []; + + $accept = $this->selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart(array $accept): array + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + 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 + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { + return implode(',', $jsonAccept); + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader(array $contentType): string + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} diff --git a/lib/Model/ActivityCollectionResponseObject.php b/lib/Model/ActivityCollectionResponseObject.php new file mode 100644 index 00000000..1551c9ea --- /dev/null +++ b/lib/Model/ActivityCollectionResponseObject.php @@ -0,0 +1,1392 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityCollectionResponseObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityCollectionResponseObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'due_date' => '\DateTime', + 'due_time' => 'string', + 'duration' => 'string', + 'deal_id' => 'int', + 'lead_id' => 'string', + 'person_id' => 'int', + 'project_id' => 'int', + 'org_id' => 'int', + 'location' => 'string', + 'public_description' => 'string', + 'id' => 'int', + 'done' => 'bool', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'busy_flag' => 'bool', + 'company_id' => 'int', + 'conference_meeting_client' => 'string', + 'conference_meeting_url' => 'string', + 'conference_meeting_id' => 'string', + 'add_time' => 'string', + 'marked_as_done_time' => 'string', + 'active_flag' => 'bool', + 'update_time' => 'string', + 'update_user_id' => 'int', + 'source_timezone' => 'string', + 'location_subpremise' => 'string', + 'location_street_number' => 'string', + 'location_route' => 'string', + 'location_sublocality' => 'string', + 'location_locality' => 'string', + 'location_admin_area_level_1' => 'string', + 'location_admin_area_level_2' => 'string', + 'location_country' => 'string', + 'location_postal_code' => 'string', + 'location_formatted_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'due_date' => 'date', + 'due_time' => null, + 'duration' => null, + 'deal_id' => null, + 'lead_id' => 'uuid', + 'person_id' => null, + 'project_id' => null, + 'org_id' => null, + 'location' => null, + 'public_description' => null, + 'id' => null, + 'done' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'busy_flag' => null, + 'company_id' => null, + 'conference_meeting_client' => null, + 'conference_meeting_url' => null, + 'conference_meeting_id' => null, + 'add_time' => null, + 'marked_as_done_time' => null, + 'active_flag' => null, + 'update_time' => null, + 'update_user_id' => null, + 'source_timezone' => null, + 'location_subpremise' => null, + 'location_street_number' => null, + 'location_route' => null, + 'location_sublocality' => null, + 'location_locality' => null, + 'location_admin_area_level_1' => null, + 'location_admin_area_level_2' => null, + 'location_country' => null, + 'location_postal_code' => null, + 'location_formatted_address' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'due_date' => 'due_date', + 'due_time' => 'due_time', + 'duration' => 'duration', + 'deal_id' => 'deal_id', + 'lead_id' => 'lead_id', + 'person_id' => 'person_id', + 'project_id' => 'project_id', + 'org_id' => 'org_id', + 'location' => 'location', + 'public_description' => 'public_description', + 'id' => 'id', + 'done' => 'done', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'busy_flag' => 'busy_flag', + 'company_id' => 'company_id', + 'conference_meeting_client' => 'conference_meeting_client', + 'conference_meeting_url' => 'conference_meeting_url', + 'conference_meeting_id' => 'conference_meeting_id', + 'add_time' => 'add_time', + 'marked_as_done_time' => 'marked_as_done_time', + 'active_flag' => 'active_flag', + 'update_time' => 'update_time', + 'update_user_id' => 'update_user_id', + 'source_timezone' => 'source_timezone', + 'location_subpremise' => 'location_subpremise', + 'location_street_number' => 'location_street_number', + 'location_route' => 'location_route', + 'location_sublocality' => 'location_sublocality', + 'location_locality' => 'location_locality', + 'location_admin_area_level_1' => 'location_admin_area_level_1', + 'location_admin_area_level_2' => 'location_admin_area_level_2', + 'location_country' => 'location_country', + 'location_postal_code' => 'location_postal_code', + 'location_formatted_address' => 'location_formatted_address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'due_date' => 'setDueDate', + 'due_time' => 'setDueTime', + 'duration' => 'setDuration', + 'deal_id' => 'setDealId', + 'lead_id' => 'setLeadId', + 'person_id' => 'setPersonId', + 'project_id' => 'setProjectId', + 'org_id' => 'setOrgId', + 'location' => 'setLocation', + 'public_description' => 'setPublicDescription', + 'id' => 'setId', + 'done' => 'setDone', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'busy_flag' => 'setBusyFlag', + 'company_id' => 'setCompanyId', + 'conference_meeting_client' => 'setConferenceMeetingClient', + 'conference_meeting_url' => 'setConferenceMeetingUrl', + 'conference_meeting_id' => 'setConferenceMeetingId', + 'add_time' => 'setAddTime', + 'marked_as_done_time' => 'setMarkedAsDoneTime', + 'active_flag' => 'setActiveFlag', + 'update_time' => 'setUpdateTime', + 'update_user_id' => 'setUpdateUserId', + 'source_timezone' => 'setSourceTimezone', + 'location_subpremise' => 'setLocationSubpremise', + 'location_street_number' => 'setLocationStreetNumber', + 'location_route' => 'setLocationRoute', + 'location_sublocality' => 'setLocationSublocality', + 'location_locality' => 'setLocationLocality', + 'location_admin_area_level_1' => 'setLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'setLocationAdminAreaLevel2', + 'location_country' => 'setLocationCountry', + 'location_postal_code' => 'setLocationPostalCode', + 'location_formatted_address' => 'setLocationFormattedAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'due_date' => 'getDueDate', + 'due_time' => 'getDueTime', + 'duration' => 'getDuration', + 'deal_id' => 'getDealId', + 'lead_id' => 'getLeadId', + 'person_id' => 'getPersonId', + 'project_id' => 'getProjectId', + 'org_id' => 'getOrgId', + 'location' => 'getLocation', + 'public_description' => 'getPublicDescription', + 'id' => 'getId', + 'done' => 'getDone', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'busy_flag' => 'getBusyFlag', + 'company_id' => 'getCompanyId', + 'conference_meeting_client' => 'getConferenceMeetingClient', + 'conference_meeting_url' => 'getConferenceMeetingUrl', + 'conference_meeting_id' => 'getConferenceMeetingId', + 'add_time' => 'getAddTime', + 'marked_as_done_time' => 'getMarkedAsDoneTime', + 'active_flag' => 'getActiveFlag', + 'update_time' => 'getUpdateTime', + 'update_user_id' => 'getUpdateUserId', + 'source_timezone' => 'getSourceTimezone', + 'location_subpremise' => 'getLocationSubpremise', + 'location_street_number' => 'getLocationStreetNumber', + 'location_route' => 'getLocationRoute', + 'location_sublocality' => 'getLocationSublocality', + 'location_locality' => 'getLocationLocality', + 'location_admin_area_level_1' => 'getLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'getLocationAdminAreaLevel2', + 'location_country' => 'getLocationCountry', + 'location_postal_code' => 'getLocationPostalCode', + 'location_formatted_address' => 'getLocationFormattedAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['due_date'] = $data['due_date'] ?? null; + $this->container['due_time'] = $data['due_time'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['location'] = $data['location'] ?? null; + $this->container['public_description'] = $data['public_description'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['done'] = $data['done'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['conference_meeting_client'] = $data['conference_meeting_client'] ?? null; + $this->container['conference_meeting_url'] = $data['conference_meeting_url'] ?? null; + $this->container['conference_meeting_id'] = $data['conference_meeting_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['marked_as_done_time'] = $data['marked_as_done_time'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['update_user_id'] = $data['update_user_id'] ?? null; + $this->container['source_timezone'] = $data['source_timezone'] ?? null; + $this->container['location_subpremise'] = $data['location_subpremise'] ?? null; + $this->container['location_street_number'] = $data['location_street_number'] ?? null; + $this->container['location_route'] = $data['location_route'] ?? null; + $this->container['location_sublocality'] = $data['location_sublocality'] ?? null; + $this->container['location_locality'] = $data['location_locality'] ?? null; + $this->container['location_admin_area_level_1'] = $data['location_admin_area_level_1'] ?? null; + $this->container['location_admin_area_level_2'] = $data['location_admin_area_level_2'] ?? null; + $this->container['location_country'] = $data['location_country'] ?? null; + $this->container['location_postal_code'] = $data['location_postal_code'] ?? null; + $this->container['location_formatted_address'] = $data['location_formatted_address'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date The due date of the activity. Format: YYYY-MM-DD + * + * @return self + */ + public function setDueDate($due_date): self + { + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets due_time + * + * @return string|null + */ + public function getDueTime() + { + return $this->container['due_time']; + } + + /** + * Sets due_time + * + * @param string|null $due_time The due time of the activity in UTC. Format: HH:MM + * + * @return self + */ + public function setDueTime($due_time): self + { + $this->container['due_time'] = $due_time; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the activity. Format: HH:MM + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this activity is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead in the UUID format this activity is associated with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this activity is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project this activity is associated with + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this activity is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. + * + * @return self + */ + public function setLocation($location): self + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets public_description + * + * @return string|null + */ + public function getPublicDescription() + { + return $this->container['public_description']; + } + + /** + * Sets public_description + * + * @param string|null $public_description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. + * + * @return self + */ + public function setPublicDescription($public_description): self + { + $this->container['public_description'] = $public_description; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the activity, generated when the activity was created + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets done + * + * @return bool|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param bool|null $done Whether the activity is done or not + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The user's company ID + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets conference_meeting_client + * + * @return string|null + */ + public function getConferenceMeetingClient() + { + return $this->container['conference_meeting_client']; + } + + /** + * Sets conference_meeting_client + * + * @param string|null $conference_meeting_client The ID of the Marketplace app, which is connected to this activity + * + * @return self + */ + public function setConferenceMeetingClient($conference_meeting_client): self + { + $this->container['conference_meeting_client'] = $conference_meeting_client; + + return $this; + } + + /** + * Gets conference_meeting_url + * + * @return string|null + */ + public function getConferenceMeetingUrl() + { + return $this->container['conference_meeting_url']; + } + + /** + * Sets conference_meeting_url + * + * @param string|null $conference_meeting_url The link to join the meeting which is associated with this activity + * + * @return self + */ + public function setConferenceMeetingUrl($conference_meeting_url): self + { + $this->container['conference_meeting_url'] = $conference_meeting_url; + + return $this; + } + + /** + * Gets conference_meeting_id + * + * @return string|null + */ + public function getConferenceMeetingId() + { + return $this->container['conference_meeting_id']; + } + + /** + * Sets conference_meeting_id + * + * @param string|null $conference_meeting_id The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity + * + * @return self + */ + public function setConferenceMeetingId($conference_meeting_id): self + { + $this->container['conference_meeting_id'] = $conference_meeting_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets marked_as_done_time + * + * @return string|null + */ + public function getMarkedAsDoneTime() + { + return $this->container['marked_as_done_time']; + } + + /** + * Sets marked_as_done_time + * + * @param string|null $marked_as_done_time The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setMarkedAsDoneTime($marked_as_done_time): self + { + $this->container['marked_as_done_time'] = $marked_as_done_time; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the activity is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets update_user_id + * + * @return int|null + */ + public function getUpdateUserId() + { + return $this->container['update_user_id']; + } + + /** + * Sets update_user_id + * + * @param int|null $update_user_id The ID of the user who was the last to update this activity + * + * @return self + */ + public function setUpdateUserId($update_user_id): self + { + $this->container['update_user_id'] = $update_user_id; + + return $this; + } + + /** + * Gets source_timezone + * + * @return string|null + */ + public function getSourceTimezone() + { + return $this->container['source_timezone']; + } + + /** + * Sets source_timezone + * + * @param string|null $source_timezone The timezone the activity was created in an external calendar + * + * @return self + */ + public function setSourceTimezone($source_timezone): self + { + $this->container['source_timezone'] = $source_timezone; + + return $this; + } + + /** + * Gets location_subpremise + * + * @return string|null + */ + public function getLocationSubpremise() + { + return $this->container['location_subpremise']; + } + + /** + * Sets location_subpremise + * + * @param string|null $location_subpremise A subfield of the location field. Indicates apartment/suite number. + * + * @return self + */ + public function setLocationSubpremise($location_subpremise): self + { + $this->container['location_subpremise'] = $location_subpremise; + + return $this; + } + + /** + * Gets location_street_number + * + * @return string|null + */ + public function getLocationStreetNumber() + { + return $this->container['location_street_number']; + } + + /** + * Sets location_street_number + * + * @param string|null $location_street_number A subfield of the location field. Indicates house number. + * + * @return self + */ + public function setLocationStreetNumber($location_street_number): self + { + $this->container['location_street_number'] = $location_street_number; + + return $this; + } + + /** + * Gets location_route + * + * @return string|null + */ + public function getLocationRoute() + { + return $this->container['location_route']; + } + + /** + * Sets location_route + * + * @param string|null $location_route A subfield of the location field. Indicates street name. + * + * @return self + */ + public function setLocationRoute($location_route): self + { + $this->container['location_route'] = $location_route; + + return $this; + } + + /** + * Gets location_sublocality + * + * @return string|null + */ + public function getLocationSublocality() + { + return $this->container['location_sublocality']; + } + + /** + * Sets location_sublocality + * + * @param string|null $location_sublocality A subfield of the location field. Indicates district/sublocality. + * + * @return self + */ + public function setLocationSublocality($location_sublocality): self + { + $this->container['location_sublocality'] = $location_sublocality; + + return $this; + } + + /** + * Gets location_locality + * + * @return string|null + */ + public function getLocationLocality() + { + return $this->container['location_locality']; + } + + /** + * Sets location_locality + * + * @param string|null $location_locality A subfield of the location field. Indicates city/town/village/locality. + * + * @return self + */ + public function setLocationLocality($location_locality): self + { + $this->container['location_locality'] = $location_locality; + + return $this; + } + + /** + * Gets location_admin_area_level_1 + * + * @return string|null + */ + public function getLocationAdminAreaLevel1() + { + return $this->container['location_admin_area_level_1']; + } + + /** + * Sets location_admin_area_level_1 + * + * @param string|null $location_admin_area_level_1 A subfield of the location field. Indicates state/county. + * + * @return self + */ + public function setLocationAdminAreaLevel1($location_admin_area_level_1): self + { + $this->container['location_admin_area_level_1'] = $location_admin_area_level_1; + + return $this; + } + + /** + * Gets location_admin_area_level_2 + * + * @return string|null + */ + public function getLocationAdminAreaLevel2() + { + return $this->container['location_admin_area_level_2']; + } + + /** + * Sets location_admin_area_level_2 + * + * @param string|null $location_admin_area_level_2 A subfield of the location field. Indicates region. + * + * @return self + */ + public function setLocationAdminAreaLevel2($location_admin_area_level_2): self + { + $this->container['location_admin_area_level_2'] = $location_admin_area_level_2; + + return $this; + } + + /** + * Gets location_country + * + * @return string|null + */ + public function getLocationCountry() + { + return $this->container['location_country']; + } + + /** + * Sets location_country + * + * @param string|null $location_country A subfield of the location field. Indicates country. + * + * @return self + */ + public function setLocationCountry($location_country): self + { + $this->container['location_country'] = $location_country; + + return $this; + } + + /** + * Gets location_postal_code + * + * @return string|null + */ + public function getLocationPostalCode() + { + return $this->container['location_postal_code']; + } + + /** + * Sets location_postal_code + * + * @param string|null $location_postal_code A subfield of the location field. Indicates ZIP/postal code. + * + * @return self + */ + public function setLocationPostalCode($location_postal_code): self + { + $this->container['location_postal_code'] = $location_postal_code; + + return $this; + } + + /** + * Gets location_formatted_address + * + * @return string|null + */ + public function getLocationFormattedAddress() + { + return $this->container['location_formatted_address']; + } + + /** + * Sets location_formatted_address + * + * @param string|null $location_formatted_address A subfield of the location field. Indicates full/combined address. + * + * @return self + */ + public function setLocationFormattedAddress($location_formatted_address): self + { + $this->container['location_formatted_address'] = $location_formatted_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityCollectionResponseObjectAllOf.php b/lib/Model/ActivityCollectionResponseObjectAllOf.php new file mode 100644 index 00000000..6960cdef --- /dev/null +++ b/lib/Model/ActivityCollectionResponseObjectAllOf.php @@ -0,0 +1,1092 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityCollectionResponseObjectAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityCollectionResponseObject_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'done' => 'bool', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'busy_flag' => 'bool', + 'company_id' => 'int', + 'conference_meeting_client' => 'string', + 'conference_meeting_url' => 'string', + 'conference_meeting_id' => 'string', + 'add_time' => 'string', + 'marked_as_done_time' => 'string', + 'active_flag' => 'bool', + 'update_time' => 'string', + 'update_user_id' => 'int', + 'source_timezone' => 'string', + 'location_subpremise' => 'string', + 'location_street_number' => 'string', + 'location_route' => 'string', + 'location_sublocality' => 'string', + 'location_locality' => 'string', + 'location_admin_area_level_1' => 'string', + 'location_admin_area_level_2' => 'string', + 'location_country' => 'string', + 'location_postal_code' => 'string', + 'location_formatted_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'done' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'busy_flag' => null, + 'company_id' => null, + 'conference_meeting_client' => null, + 'conference_meeting_url' => null, + 'conference_meeting_id' => null, + 'add_time' => null, + 'marked_as_done_time' => null, + 'active_flag' => null, + 'update_time' => null, + 'update_user_id' => null, + 'source_timezone' => null, + 'location_subpremise' => null, + 'location_street_number' => null, + 'location_route' => null, + 'location_sublocality' => null, + 'location_locality' => null, + 'location_admin_area_level_1' => null, + 'location_admin_area_level_2' => null, + 'location_country' => null, + 'location_postal_code' => null, + 'location_formatted_address' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'done' => 'done', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'busy_flag' => 'busy_flag', + 'company_id' => 'company_id', + 'conference_meeting_client' => 'conference_meeting_client', + 'conference_meeting_url' => 'conference_meeting_url', + 'conference_meeting_id' => 'conference_meeting_id', + 'add_time' => 'add_time', + 'marked_as_done_time' => 'marked_as_done_time', + 'active_flag' => 'active_flag', + 'update_time' => 'update_time', + 'update_user_id' => 'update_user_id', + 'source_timezone' => 'source_timezone', + 'location_subpremise' => 'location_subpremise', + 'location_street_number' => 'location_street_number', + 'location_route' => 'location_route', + 'location_sublocality' => 'location_sublocality', + 'location_locality' => 'location_locality', + 'location_admin_area_level_1' => 'location_admin_area_level_1', + 'location_admin_area_level_2' => 'location_admin_area_level_2', + 'location_country' => 'location_country', + 'location_postal_code' => 'location_postal_code', + 'location_formatted_address' => 'location_formatted_address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'done' => 'setDone', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'busy_flag' => 'setBusyFlag', + 'company_id' => 'setCompanyId', + 'conference_meeting_client' => 'setConferenceMeetingClient', + 'conference_meeting_url' => 'setConferenceMeetingUrl', + 'conference_meeting_id' => 'setConferenceMeetingId', + 'add_time' => 'setAddTime', + 'marked_as_done_time' => 'setMarkedAsDoneTime', + 'active_flag' => 'setActiveFlag', + 'update_time' => 'setUpdateTime', + 'update_user_id' => 'setUpdateUserId', + 'source_timezone' => 'setSourceTimezone', + 'location_subpremise' => 'setLocationSubpremise', + 'location_street_number' => 'setLocationStreetNumber', + 'location_route' => 'setLocationRoute', + 'location_sublocality' => 'setLocationSublocality', + 'location_locality' => 'setLocationLocality', + 'location_admin_area_level_1' => 'setLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'setLocationAdminAreaLevel2', + 'location_country' => 'setLocationCountry', + 'location_postal_code' => 'setLocationPostalCode', + 'location_formatted_address' => 'setLocationFormattedAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'done' => 'getDone', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'busy_flag' => 'getBusyFlag', + 'company_id' => 'getCompanyId', + 'conference_meeting_client' => 'getConferenceMeetingClient', + 'conference_meeting_url' => 'getConferenceMeetingUrl', + 'conference_meeting_id' => 'getConferenceMeetingId', + 'add_time' => 'getAddTime', + 'marked_as_done_time' => 'getMarkedAsDoneTime', + 'active_flag' => 'getActiveFlag', + 'update_time' => 'getUpdateTime', + 'update_user_id' => 'getUpdateUserId', + 'source_timezone' => 'getSourceTimezone', + 'location_subpremise' => 'getLocationSubpremise', + 'location_street_number' => 'getLocationStreetNumber', + 'location_route' => 'getLocationRoute', + 'location_sublocality' => 'getLocationSublocality', + 'location_locality' => 'getLocationLocality', + 'location_admin_area_level_1' => 'getLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'getLocationAdminAreaLevel2', + 'location_country' => 'getLocationCountry', + 'location_postal_code' => 'getLocationPostalCode', + 'location_formatted_address' => 'getLocationFormattedAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['done'] = $data['done'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['conference_meeting_client'] = $data['conference_meeting_client'] ?? null; + $this->container['conference_meeting_url'] = $data['conference_meeting_url'] ?? null; + $this->container['conference_meeting_id'] = $data['conference_meeting_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['marked_as_done_time'] = $data['marked_as_done_time'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['update_user_id'] = $data['update_user_id'] ?? null; + $this->container['source_timezone'] = $data['source_timezone'] ?? null; + $this->container['location_subpremise'] = $data['location_subpremise'] ?? null; + $this->container['location_street_number'] = $data['location_street_number'] ?? null; + $this->container['location_route'] = $data['location_route'] ?? null; + $this->container['location_sublocality'] = $data['location_sublocality'] ?? null; + $this->container['location_locality'] = $data['location_locality'] ?? null; + $this->container['location_admin_area_level_1'] = $data['location_admin_area_level_1'] ?? null; + $this->container['location_admin_area_level_2'] = $data['location_admin_area_level_2'] ?? null; + $this->container['location_country'] = $data['location_country'] ?? null; + $this->container['location_postal_code'] = $data['location_postal_code'] ?? null; + $this->container['location_formatted_address'] = $data['location_formatted_address'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the activity, generated when the activity was created + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets done + * + * @return bool|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param bool|null $done Whether the activity is done or not + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The user's company ID + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets conference_meeting_client + * + * @return string|null + */ + public function getConferenceMeetingClient() + { + return $this->container['conference_meeting_client']; + } + + /** + * Sets conference_meeting_client + * + * @param string|null $conference_meeting_client The ID of the Marketplace app, which is connected to this activity + * + * @return self + */ + public function setConferenceMeetingClient($conference_meeting_client): self + { + $this->container['conference_meeting_client'] = $conference_meeting_client; + + return $this; + } + + /** + * Gets conference_meeting_url + * + * @return string|null + */ + public function getConferenceMeetingUrl() + { + return $this->container['conference_meeting_url']; + } + + /** + * Sets conference_meeting_url + * + * @param string|null $conference_meeting_url The link to join the meeting which is associated with this activity + * + * @return self + */ + public function setConferenceMeetingUrl($conference_meeting_url): self + { + $this->container['conference_meeting_url'] = $conference_meeting_url; + + return $this; + } + + /** + * Gets conference_meeting_id + * + * @return string|null + */ + public function getConferenceMeetingId() + { + return $this->container['conference_meeting_id']; + } + + /** + * Sets conference_meeting_id + * + * @param string|null $conference_meeting_id The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity + * + * @return self + */ + public function setConferenceMeetingId($conference_meeting_id): self + { + $this->container['conference_meeting_id'] = $conference_meeting_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets marked_as_done_time + * + * @return string|null + */ + public function getMarkedAsDoneTime() + { + return $this->container['marked_as_done_time']; + } + + /** + * Sets marked_as_done_time + * + * @param string|null $marked_as_done_time The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setMarkedAsDoneTime($marked_as_done_time): self + { + $this->container['marked_as_done_time'] = $marked_as_done_time; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the activity is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets update_user_id + * + * @return int|null + */ + public function getUpdateUserId() + { + return $this->container['update_user_id']; + } + + /** + * Sets update_user_id + * + * @param int|null $update_user_id The ID of the user who was the last to update this activity + * + * @return self + */ + public function setUpdateUserId($update_user_id): self + { + $this->container['update_user_id'] = $update_user_id; + + return $this; + } + + /** + * Gets source_timezone + * + * @return string|null + */ + public function getSourceTimezone() + { + return $this->container['source_timezone']; + } + + /** + * Sets source_timezone + * + * @param string|null $source_timezone The timezone the activity was created in an external calendar + * + * @return self + */ + public function setSourceTimezone($source_timezone): self + { + $this->container['source_timezone'] = $source_timezone; + + return $this; + } + + /** + * Gets location_subpremise + * + * @return string|null + */ + public function getLocationSubpremise() + { + return $this->container['location_subpremise']; + } + + /** + * Sets location_subpremise + * + * @param string|null $location_subpremise A subfield of the location field. Indicates apartment/suite number. + * + * @return self + */ + public function setLocationSubpremise($location_subpremise): self + { + $this->container['location_subpremise'] = $location_subpremise; + + return $this; + } + + /** + * Gets location_street_number + * + * @return string|null + */ + public function getLocationStreetNumber() + { + return $this->container['location_street_number']; + } + + /** + * Sets location_street_number + * + * @param string|null $location_street_number A subfield of the location field. Indicates house number. + * + * @return self + */ + public function setLocationStreetNumber($location_street_number): self + { + $this->container['location_street_number'] = $location_street_number; + + return $this; + } + + /** + * Gets location_route + * + * @return string|null + */ + public function getLocationRoute() + { + return $this->container['location_route']; + } + + /** + * Sets location_route + * + * @param string|null $location_route A subfield of the location field. Indicates street name. + * + * @return self + */ + public function setLocationRoute($location_route): self + { + $this->container['location_route'] = $location_route; + + return $this; + } + + /** + * Gets location_sublocality + * + * @return string|null + */ + public function getLocationSublocality() + { + return $this->container['location_sublocality']; + } + + /** + * Sets location_sublocality + * + * @param string|null $location_sublocality A subfield of the location field. Indicates district/sublocality. + * + * @return self + */ + public function setLocationSublocality($location_sublocality): self + { + $this->container['location_sublocality'] = $location_sublocality; + + return $this; + } + + /** + * Gets location_locality + * + * @return string|null + */ + public function getLocationLocality() + { + return $this->container['location_locality']; + } + + /** + * Sets location_locality + * + * @param string|null $location_locality A subfield of the location field. Indicates city/town/village/locality. + * + * @return self + */ + public function setLocationLocality($location_locality): self + { + $this->container['location_locality'] = $location_locality; + + return $this; + } + + /** + * Gets location_admin_area_level_1 + * + * @return string|null + */ + public function getLocationAdminAreaLevel1() + { + return $this->container['location_admin_area_level_1']; + } + + /** + * Sets location_admin_area_level_1 + * + * @param string|null $location_admin_area_level_1 A subfield of the location field. Indicates state/county. + * + * @return self + */ + public function setLocationAdminAreaLevel1($location_admin_area_level_1): self + { + $this->container['location_admin_area_level_1'] = $location_admin_area_level_1; + + return $this; + } + + /** + * Gets location_admin_area_level_2 + * + * @return string|null + */ + public function getLocationAdminAreaLevel2() + { + return $this->container['location_admin_area_level_2']; + } + + /** + * Sets location_admin_area_level_2 + * + * @param string|null $location_admin_area_level_2 A subfield of the location field. Indicates region. + * + * @return self + */ + public function setLocationAdminAreaLevel2($location_admin_area_level_2): self + { + $this->container['location_admin_area_level_2'] = $location_admin_area_level_2; + + return $this; + } + + /** + * Gets location_country + * + * @return string|null + */ + public function getLocationCountry() + { + return $this->container['location_country']; + } + + /** + * Sets location_country + * + * @param string|null $location_country A subfield of the location field. Indicates country. + * + * @return self + */ + public function setLocationCountry($location_country): self + { + $this->container['location_country'] = $location_country; + + return $this; + } + + /** + * Gets location_postal_code + * + * @return string|null + */ + public function getLocationPostalCode() + { + return $this->container['location_postal_code']; + } + + /** + * Sets location_postal_code + * + * @param string|null $location_postal_code A subfield of the location field. Indicates ZIP/postal code. + * + * @return self + */ + public function setLocationPostalCode($location_postal_code): self + { + $this->container['location_postal_code'] = $location_postal_code; + + return $this; + } + + /** + * Gets location_formatted_address + * + * @return string|null + */ + public function getLocationFormattedAddress() + { + return $this->container['location_formatted_address']; + } + + /** + * Sets location_formatted_address + * + * @param string|null $location_formatted_address A subfield of the location field. Indicates full/combined address. + * + * @return self + */ + public function setLocationFormattedAddress($location_formatted_address): self + { + $this->container['location_formatted_address'] = $location_formatted_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityDistributionData.php b/lib/Model/ActivityDistributionData.php new file mode 100644 index 00000000..337b62ae --- /dev/null +++ b/lib/Model/ActivityDistributionData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityDistributionData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityDistributionData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'activity_distribution' => '\Pipedrive\Model\ActivityDistributionDataActivityDistribution' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'activity_distribution' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activity_distribution' => 'activity_distribution' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activity_distribution' => 'setActivityDistribution' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activity_distribution' => 'getActivityDistribution' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['activity_distribution'] = $data['activity_distribution'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets activity_distribution + * + * @return \Pipedrive\Model\ActivityDistributionDataActivityDistribution|null + */ + public function getActivityDistribution() + { + return $this->container['activity_distribution']; + } + + /** + * Sets activity_distribution + * + * @param \Pipedrive\Model\ActivityDistributionDataActivityDistribution|null $activity_distribution activity_distribution + * + * @return self + */ + public function setActivityDistribution($activity_distribution): self + { + $this->container['activity_distribution'] = $activity_distribution; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityDistributionDataActivityDistribution.php b/lib/Model/ActivityDistributionDataActivityDistribution.php new file mode 100644 index 00000000..6b19f919 --- /dev/null +++ b/lib/Model/ActivityDistributionDataActivityDistribution.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityDistributionDataActivityDistribution implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityDistributionData_activity_distribution'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'assigned_to_user_id' => '\Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'assigned_to_user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'assigned_to_user_id' => 'ASSIGNED_TO_USER_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'assigned_to_user_id' => 'setAssignedToUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'assigned_to_user_id' => 'getAssignedToUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['assigned_to_user_id'] = $data['assigned_to_user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets assigned_to_user_id + * + * @return \Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID|null + */ + public function getAssignedToUserId() + { + return $this->container['assigned_to_user_id']; + } + + /** + * Sets assigned_to_user_id + * + * @param \Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID|null $assigned_to_user_id assigned_to_user_id + * + * @return self + */ + public function setAssignedToUserId($assigned_to_user_id): self + { + $this->container['assigned_to_user_id'] = $assigned_to_user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.php b/lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.php new file mode 100644 index 00000000..d5f536d1 --- /dev/null +++ b/lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityDistributionDataActivityDistributionASSIGNEDTOUSERID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityDistributionData_activity_distribution_ASSIGNED_TO_USER_ID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'activities' => '\Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities', + 'name' => 'string', + 'activity_count' => 'int', + 'share' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'activities' => null, + 'name' => null, + 'activity_count' => null, + 'share' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activities' => 'activities', + 'name' => 'name', + 'activity_count' => 'activity_count', + 'share' => 'share' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activities' => 'setActivities', + 'name' => 'setName', + 'activity_count' => 'setActivityCount', + 'share' => 'setShare' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activities' => 'getActivities', + 'name' => 'getName', + 'activity_count' => 'getActivityCount', + 'share' => 'getShare' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['activities'] = $data['activities'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['activity_count'] = $data['activity_count'] ?? null; + $this->container['share'] = $data['share'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets activities + * + * @return \Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities|null + */ + public function getActivities() + { + return $this->container['activities']; + } + + /** + * Sets activities + * + * @param \Pipedrive\Model\ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities|null $activities activities + * + * @return self + */ + public function setActivities($activities): self + { + $this->container['activities'] = $activities; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the user + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets activity_count + * + * @return int|null + */ + public function getActivityCount() + { + return $this->container['activity_count']; + } + + /** + * Sets activity_count + * + * @param int|null $activity_count The overall count of activities for the user + * + * @return self + */ + public function setActivityCount($activity_count): self + { + $this->container['activity_count'] = $activity_count; + + return $this; + } + + /** + * Gets share + * + * @return int|null + */ + public function getShare() + { + return $this->container['share']; + } + + /** + * Sets share + * + * @param int|null $share The percentage of activities belongs to the user + * + * @return self + */ + public function setShare($share): self + { + $this->container['share'] = $share; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.php b/lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.php new file mode 100644 index 00000000..7a25fd36 --- /dev/null +++ b/lib/Model/ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityDistributionDataActivityDistributionASSIGNEDTOUSERIDActivities implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityDistributionData_activity_distribution_ASSIGNED_TO_USER_ID_activities'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'activity_type_name' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'activity_type_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activity_type_name' => 'ACTIVITY_TYPE_NAME' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activity_type_name' => 'setActivityTypeName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activity_type_name' => 'getActivityTypeName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['activity_type_name'] = $data['activity_type_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets activity_type_name + * + * @return int|null + */ + public function getActivityTypeName() + { + return $this->container['activity_type_name']; + } + + /** + * Sets activity_type_name + * + * @param int|null $activity_type_name The count of activities related to a specific type + * + * @return self + */ + public function setActivityTypeName($activity_type_name): self + { + $this->container['activity_type_name'] = $activity_type_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityDistributionDataWithAdditionalData.php b/lib/Model/ActivityDistributionDataWithAdditionalData.php new file mode 100644 index 00000000..49b279b4 --- /dev/null +++ b/lib/Model/ActivityDistributionDataWithAdditionalData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityDistributionDataWithAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityDistributionDataWithAdditionalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'activity_distribution' => '\Pipedrive\Model\ActivityDistributionDataActivityDistribution', + 'start' => 'int', + 'limit' => 'int', + 'more_items_in_collection' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'activity_distribution' => null, + 'start' => null, + 'limit' => null, + 'more_items_in_collection' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activity_distribution' => 'activity_distribution', + 'start' => 'start', + 'limit' => 'limit', + 'more_items_in_collection' => 'more_items_in_collection' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activity_distribution' => 'setActivityDistribution', + 'start' => 'setStart', + 'limit' => 'setLimit', + 'more_items_in_collection' => 'setMoreItemsInCollection' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activity_distribution' => 'getActivityDistribution', + 'start' => 'getStart', + 'limit' => 'getLimit', + 'more_items_in_collection' => 'getMoreItemsInCollection' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['activity_distribution'] = $data['activity_distribution'] ?? null; + $this->container['start'] = $data['start'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['more_items_in_collection'] = $data['more_items_in_collection'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets activity_distribution + * + * @return \Pipedrive\Model\ActivityDistributionDataActivityDistribution|null + */ + public function getActivityDistribution() + { + return $this->container['activity_distribution']; + } + + /** + * Sets activity_distribution + * + * @param \Pipedrive\Model\ActivityDistributionDataActivityDistribution|null $activity_distribution activity_distribution + * + * @return self + */ + public function setActivityDistribution($activity_distribution): self + { + $this->container['activity_distribution'] = $activity_distribution; + + return $this; + } + + /** + * Gets start + * + * @return int|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param int|null $start Pagination start + * + * @return self + */ + public function setStart($start): self + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit Items shown per page + * + * @return self + */ + public function setLimit($limit): self + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets more_items_in_collection + * + * @return bool|null + */ + public function getMoreItemsInCollection() + { + return $this->container['more_items_in_collection']; + } + + /** + * Sets more_items_in_collection + * + * @param bool|null $more_items_in_collection If there are more list items in the collection than displayed or not + * + * @return self + */ + public function setMoreItemsInCollection($more_items_in_collection): self + { + $this->container['more_items_in_collection'] = $more_items_in_collection; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityInfo.php b/lib/Model/ActivityInfo.php new file mode 100644 index 00000000..59bd7d4b --- /dev/null +++ b/lib/Model/ActivityInfo.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityObjectFragment.php b/lib/Model/ActivityObjectFragment.php new file mode 100644 index 00000000..1db00344 --- /dev/null +++ b/lib/Model/ActivityObjectFragment.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityObjectFragment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityObjectFragment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'due_date' => '\DateTime', + 'due_time' => 'string', + 'duration' => 'string', + 'deal_id' => 'int', + 'lead_id' => 'string', + 'person_id' => 'int', + 'project_id' => 'int', + 'org_id' => 'int', + 'location' => 'string', + 'public_description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'due_date' => 'date', + 'due_time' => null, + 'duration' => null, + 'deal_id' => null, + 'lead_id' => 'uuid', + 'person_id' => null, + 'project_id' => null, + 'org_id' => null, + 'location' => null, + 'public_description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'due_date' => 'due_date', + 'due_time' => 'due_time', + 'duration' => 'duration', + 'deal_id' => 'deal_id', + 'lead_id' => 'lead_id', + 'person_id' => 'person_id', + 'project_id' => 'project_id', + 'org_id' => 'org_id', + 'location' => 'location', + 'public_description' => 'public_description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'due_date' => 'setDueDate', + 'due_time' => 'setDueTime', + 'duration' => 'setDuration', + 'deal_id' => 'setDealId', + 'lead_id' => 'setLeadId', + 'person_id' => 'setPersonId', + 'project_id' => 'setProjectId', + 'org_id' => 'setOrgId', + 'location' => 'setLocation', + 'public_description' => 'setPublicDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'due_date' => 'getDueDate', + 'due_time' => 'getDueTime', + 'duration' => 'getDuration', + 'deal_id' => 'getDealId', + 'lead_id' => 'getLeadId', + 'person_id' => 'getPersonId', + 'project_id' => 'getProjectId', + 'org_id' => 'getOrgId', + 'location' => 'getLocation', + 'public_description' => 'getPublicDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['due_date'] = $data['due_date'] ?? null; + $this->container['due_time'] = $data['due_time'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['location'] = $data['location'] ?? null; + $this->container['public_description'] = $data['public_description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date The due date of the activity. Format: YYYY-MM-DD + * + * @return self + */ + public function setDueDate($due_date): self + { + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets due_time + * + * @return string|null + */ + public function getDueTime() + { + return $this->container['due_time']; + } + + /** + * Sets due_time + * + * @param string|null $due_time The due time of the activity in UTC. Format: HH:MM + * + * @return self + */ + public function setDueTime($due_time): self + { + $this->container['due_time'] = $due_time; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the activity. Format: HH:MM + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this activity is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead in the UUID format this activity is associated with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this activity is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project this activity is associated with + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this activity is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. + * + * @return self + */ + public function setLocation($location): self + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets public_description + * + * @return string|null + */ + public function getPublicDescription() + { + return $this->container['public_description']; + } + + /** + * Sets public_description + * + * @param string|null $public_description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. + * + * @return self + */ + public function setPublicDescription($public_description): self + { + $this->container['public_description'] = $public_description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityPostObject.php b/lib/Model/ActivityPostObject.php new file mode 100644 index 00000000..dc2da7ef --- /dev/null +++ b/lib/Model/ActivityPostObject.php @@ -0,0 +1,852 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityPostObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityPostObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'due_date' => '\DateTime', + 'due_time' => 'string', + 'duration' => 'string', + 'deal_id' => 'int', + 'lead_id' => 'string', + 'person_id' => 'int', + 'project_id' => 'int', + 'org_id' => 'int', + 'location' => 'string', + 'public_description' => 'string', + 'note' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'participants' => 'object[]', + 'busy_flag' => 'bool', + 'attendees' => 'object[]', + 'done' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'due_date' => 'date', + 'due_time' => null, + 'duration' => null, + 'deal_id' => null, + 'lead_id' => 'uuid', + 'person_id' => null, + 'project_id' => null, + 'org_id' => null, + 'location' => null, + 'public_description' => null, + 'note' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'participants' => null, + 'busy_flag' => null, + 'attendees' => null, + 'done' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'due_date' => 'due_date', + 'due_time' => 'due_time', + 'duration' => 'duration', + 'deal_id' => 'deal_id', + 'lead_id' => 'lead_id', + 'person_id' => 'person_id', + 'project_id' => 'project_id', + 'org_id' => 'org_id', + 'location' => 'location', + 'public_description' => 'public_description', + 'note' => 'note', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'participants' => 'participants', + 'busy_flag' => 'busy_flag', + 'attendees' => 'attendees', + 'done' => 'done' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'due_date' => 'setDueDate', + 'due_time' => 'setDueTime', + 'duration' => 'setDuration', + 'deal_id' => 'setDealId', + 'lead_id' => 'setLeadId', + 'person_id' => 'setPersonId', + 'project_id' => 'setProjectId', + 'org_id' => 'setOrgId', + 'location' => 'setLocation', + 'public_description' => 'setPublicDescription', + 'note' => 'setNote', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'participants' => 'setParticipants', + 'busy_flag' => 'setBusyFlag', + 'attendees' => 'setAttendees', + 'done' => 'setDone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'due_date' => 'getDueDate', + 'due_time' => 'getDueTime', + 'duration' => 'getDuration', + 'deal_id' => 'getDealId', + 'lead_id' => 'getLeadId', + 'person_id' => 'getPersonId', + 'project_id' => 'getProjectId', + 'org_id' => 'getOrgId', + 'location' => 'getLocation', + 'public_description' => 'getPublicDescription', + 'note' => 'getNote', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'participants' => 'getParticipants', + 'busy_flag' => 'getBusyFlag', + 'attendees' => 'getAttendees', + 'done' => 'getDone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['due_date'] = $data['due_date'] ?? null; + $this->container['due_time'] = $data['due_time'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['location'] = $data['location'] ?? null; + $this->container['public_description'] = $data['public_description'] ?? null; + $this->container['note'] = $data['note'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['participants'] = $data['participants'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['attendees'] = $data['attendees'] ?? null; + $this->container['done'] = $data['done'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date The due date of the activity. Format: YYYY-MM-DD + * + * @return self + */ + public function setDueDate($due_date): self + { + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets due_time + * + * @return string|null + */ + public function getDueTime() + { + return $this->container['due_time']; + } + + /** + * Sets due_time + * + * @param string|null $due_time The due time of the activity in UTC. Format: HH:MM + * + * @return self + */ + public function setDueTime($due_time): self + { + $this->container['due_time'] = $due_time; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the activity. Format: HH:MM + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this activity is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead in the UUID format this activity is associated with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this activity is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project this activity is associated with + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this activity is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. + * + * @return self + */ + public function setLocation($location): self + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets public_description + * + * @return string|null + */ + public function getPublicDescription() + { + return $this->container['public_description']; + } + + /** + * Sets public_description + * + * @param string|null $public_description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. + * + * @return self + */ + public function setPublicDescription($public_description): self + { + $this->container['public_description'] = $public_description; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note of the activity (HTML format) + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity. When value for subject is not set, it will be given a default value `Call`. + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to. If omitted, the activity is assigned to the authorized user. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets participants + * + * @return object[]|null + */ + public function getParticipants() + { + return $this->container['participants']; + } + + /** + * Sets participants + * + * @param object[]|null $participants List of multiple persons (participants) this activity is associated with. If omitted, single participant from `person_id` field is used. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` + * + * @return self + */ + public function setParticipants($participants): self + { + $this->container['participants'] = $participants; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets attendees + * + * @return object[]|null + */ + public function getAttendees() + { + return $this->container['attendees']; + } + + /** + * Sets attendees + * + * @param object[]|null $attendees The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` + * + * @return self + */ + public function setAttendees($attendees): self + { + $this->container['attendees'] = $attendees; + + return $this; + } + + /** + * Gets done + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityPostObjectAllOf.php b/lib/Model/ActivityPostObjectAllOf.php new file mode 100644 index 00000000..3f9bf36f --- /dev/null +++ b/lib/Model/ActivityPostObjectAllOf.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityPostObjectAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityPostObject_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'note' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'participants' => 'object[]', + 'busy_flag' => 'bool', + 'attendees' => 'object[]', + 'done' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'note' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'participants' => null, + 'busy_flag' => null, + 'attendees' => null, + 'done' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'note' => 'note', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'participants' => 'participants', + 'busy_flag' => 'busy_flag', + 'attendees' => 'attendees', + 'done' => 'done' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'note' => 'setNote', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'participants' => 'setParticipants', + 'busy_flag' => 'setBusyFlag', + 'attendees' => 'setAttendees', + 'done' => 'setDone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'note' => 'getNote', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'participants' => 'getParticipants', + 'busy_flag' => 'getBusyFlag', + 'attendees' => 'getAttendees', + 'done' => 'getDone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['note'] = $data['note'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['participants'] = $data['participants'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['attendees'] = $data['attendees'] ?? null; + $this->container['done'] = $data['done'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note of the activity (HTML format) + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity. When value for subject is not set, it will be given a default value `Call`. + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to. If omitted, the activity is assigned to the authorized user. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets participants + * + * @return object[]|null + */ + public function getParticipants() + { + return $this->container['participants']; + } + + /** + * Sets participants + * + * @param object[]|null $participants List of multiple persons (participants) this activity is associated with. If omitted, single participant from `person_id` field is used. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` + * + * @return self + */ + public function setParticipants($participants): self + { + $this->container['participants'] = $participants; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets attendees + * + * @return object[]|null + */ + public function getAttendees() + { + return $this->container['attendees']; + } + + /** + * Sets attendees + * + * @param object[]|null $attendees The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` + * + * @return self + */ + public function setAttendees($attendees): self + { + $this->container['attendees'] = $attendees; + + return $this; + } + + /** + * Gets done + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityPutObject.php b/lib/Model/ActivityPutObject.php new file mode 100644 index 00000000..779ed2be --- /dev/null +++ b/lib/Model/ActivityPutObject.php @@ -0,0 +1,852 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityPutObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityPutObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'due_date' => '\DateTime', + 'due_time' => 'string', + 'duration' => 'string', + 'deal_id' => 'int', + 'lead_id' => 'string', + 'person_id' => 'int', + 'project_id' => 'int', + 'org_id' => 'int', + 'location' => 'string', + 'public_description' => 'string', + 'note' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'participants' => 'object[]', + 'busy_flag' => 'bool', + 'attendees' => 'object[]', + 'done' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'due_date' => 'date', + 'due_time' => null, + 'duration' => null, + 'deal_id' => null, + 'lead_id' => 'uuid', + 'person_id' => null, + 'project_id' => null, + 'org_id' => null, + 'location' => null, + 'public_description' => null, + 'note' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'participants' => null, + 'busy_flag' => null, + 'attendees' => null, + 'done' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'due_date' => 'due_date', + 'due_time' => 'due_time', + 'duration' => 'duration', + 'deal_id' => 'deal_id', + 'lead_id' => 'lead_id', + 'person_id' => 'person_id', + 'project_id' => 'project_id', + 'org_id' => 'org_id', + 'location' => 'location', + 'public_description' => 'public_description', + 'note' => 'note', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'participants' => 'participants', + 'busy_flag' => 'busy_flag', + 'attendees' => 'attendees', + 'done' => 'done' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'due_date' => 'setDueDate', + 'due_time' => 'setDueTime', + 'duration' => 'setDuration', + 'deal_id' => 'setDealId', + 'lead_id' => 'setLeadId', + 'person_id' => 'setPersonId', + 'project_id' => 'setProjectId', + 'org_id' => 'setOrgId', + 'location' => 'setLocation', + 'public_description' => 'setPublicDescription', + 'note' => 'setNote', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'participants' => 'setParticipants', + 'busy_flag' => 'setBusyFlag', + 'attendees' => 'setAttendees', + 'done' => 'setDone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'due_date' => 'getDueDate', + 'due_time' => 'getDueTime', + 'duration' => 'getDuration', + 'deal_id' => 'getDealId', + 'lead_id' => 'getLeadId', + 'person_id' => 'getPersonId', + 'project_id' => 'getProjectId', + 'org_id' => 'getOrgId', + 'location' => 'getLocation', + 'public_description' => 'getPublicDescription', + 'note' => 'getNote', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'participants' => 'getParticipants', + 'busy_flag' => 'getBusyFlag', + 'attendees' => 'getAttendees', + 'done' => 'getDone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['due_date'] = $data['due_date'] ?? null; + $this->container['due_time'] = $data['due_time'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['location'] = $data['location'] ?? null; + $this->container['public_description'] = $data['public_description'] ?? null; + $this->container['note'] = $data['note'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['participants'] = $data['participants'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['attendees'] = $data['attendees'] ?? null; + $this->container['done'] = $data['done'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date The due date of the activity. Format: YYYY-MM-DD + * + * @return self + */ + public function setDueDate($due_date): self + { + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets due_time + * + * @return string|null + */ + public function getDueTime() + { + return $this->container['due_time']; + } + + /** + * Sets due_time + * + * @param string|null $due_time The due time of the activity in UTC. Format: HH:MM + * + * @return self + */ + public function setDueTime($due_time): self + { + $this->container['due_time'] = $due_time; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the activity. Format: HH:MM + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this activity is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead in the UUID format this activity is associated with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this activity is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project this activity is associated with + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this activity is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. + * + * @return self + */ + public function setLocation($location): self + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets public_description + * + * @return string|null + */ + public function getPublicDescription() + { + return $this->container['public_description']; + } + + /** + * Sets public_description + * + * @param string|null $public_description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. + * + * @return self + */ + public function setPublicDescription($public_description): self + { + $this->container['public_description'] = $public_description; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note of the activity (HTML format) + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets participants + * + * @return object[]|null + */ + public function getParticipants() + { + return $this->container['participants']; + } + + /** + * Sets participants + * + * @param object[]|null $participants List of multiple persons (participants) this activity is associated with. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` + * + * @return self + */ + public function setParticipants($participants): self + { + $this->container['participants'] = $participants; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets attendees + * + * @return object[]|null + */ + public function getAttendees() + { + return $this->container['attendees']; + } + + /** + * Sets attendees + * + * @param object[]|null $attendees The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` + * + * @return self + */ + public function setAttendees($attendees): self + { + $this->container['attendees'] = $attendees; + + return $this; + } + + /** + * Gets done + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityPutObjectAllOf.php b/lib/Model/ActivityPutObjectAllOf.php new file mode 100644 index 00000000..e90c1a37 --- /dev/null +++ b/lib/Model/ActivityPutObjectAllOf.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityPutObjectAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityPutObject_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'note' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'participants' => 'object[]', + 'busy_flag' => 'bool', + 'attendees' => 'object[]', + 'done' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'note' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'participants' => null, + 'busy_flag' => null, + 'attendees' => null, + 'done' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'note' => 'note', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'participants' => 'participants', + 'busy_flag' => 'busy_flag', + 'attendees' => 'attendees', + 'done' => 'done' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'note' => 'setNote', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'participants' => 'setParticipants', + 'busy_flag' => 'setBusyFlag', + 'attendees' => 'setAttendees', + 'done' => 'setDone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'note' => 'getNote', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'participants' => 'getParticipants', + 'busy_flag' => 'getBusyFlag', + 'attendees' => 'getAttendees', + 'done' => 'getDone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['note'] = $data['note'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['participants'] = $data['participants'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['attendees'] = $data['attendees'] ?? null; + $this->container['done'] = $data['done'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note of the activity (HTML format) + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets participants + * + * @return object[]|null + */ + public function getParticipants() + { + return $this->container['participants']; + } + + /** + * Sets participants + * + * @param object[]|null $participants List of multiple persons (participants) this activity is associated with. It requires a structure as follows: `[{\"person_id\":1,\"primary_flag\":true}]` + * + * @return self + */ + public function setParticipants($participants): self + { + $this->container['participants'] = $participants; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Set the activity as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with `null`. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets attendees + * + * @return object[]|null + */ + public function getAttendees() + { + return $this->container['attendees']; + } + + /** + * Sets attendees + * + * @param object[]|null $attendees The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. It requires a structure as follows: `[{\"email_address\":\"mail@example.org\"}]` or `[{\"person_id\":1, \"email_address\":\"mail@example.org\"}]` + * + * @return self + */ + public function setAttendees($attendees): self + { + $this->container['attendees'] = $attendees; + + return $this; + } + + /** + * Gets done + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param \Pipedrive\Model\NumberBoolean|null $done Whether the activity is done or not. 0 = Not done, 1 = Done + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityRecordAdditionalData.php b/lib/Model/ActivityRecordAdditionalData.php new file mode 100644 index 00000000..c5376e36 --- /dev/null +++ b/lib/Model/ActivityRecordAdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityRecordAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityRecordAdditionalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'updates_story_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'updates_story_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'updates_story_id' => 'updates_story_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updates_story_id' => 'setUpdatesStoryId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updates_story_id' => 'getUpdatesStoryId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['updates_story_id'] = $data['updates_story_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets updates_story_id + * + * @return int|null + */ + public function getUpdatesStoryId() + { + return $this->container['updates_story_id']; + } + + /** + * Sets updates_story_id + * + * @param int|null $updates_story_id This field will be deprecated + * + * @return self + */ + public function setUpdatesStoryId($updates_story_id): self + { + $this->container['updates_story_id'] = $updates_story_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityResponseObject.php b/lib/Model/ActivityResponseObject.php new file mode 100644 index 00000000..7bc310ed --- /dev/null +++ b/lib/Model/ActivityResponseObject.php @@ -0,0 +1,2142 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityResponseObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityResponseObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'due_date' => '\DateTime', + 'due_time' => 'string', + 'duration' => 'string', + 'deal_id' => 'int', + 'lead_id' => 'string', + 'person_id' => 'int', + 'project_id' => 'int', + 'org_id' => 'int', + 'location' => 'string', + 'public_description' => 'string', + 'id' => 'int', + 'note' => 'string', + 'done' => 'bool', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'participants' => 'object[]', + 'busy_flag' => 'bool', + 'attendees' => 'object[]', + 'company_id' => 'int', + 'reference_type' => 'string', + 'reference_id' => 'int', + 'conference_meeting_client' => 'string', + 'conference_meeting_url' => 'string', + 'conference_meeting_id' => 'string', + 'add_time' => 'string', + 'marked_as_done_time' => 'string', + 'last_notification_time' => 'string', + 'last_notification_user_id' => 'int', + 'notification_language_id' => 'int', + 'active_flag' => 'bool', + 'update_time' => 'string', + 'update_user_id' => 'int', + 'gcal_event_id' => 'string', + 'google_calendar_id' => 'string', + 'google_calendar_etag' => 'string', + 'calendar_sync_include_context' => 'string', + 'source_timezone' => 'string', + 'rec_rule' => 'string', + 'rec_rule_extension' => 'string', + 'rec_master_activity_id' => 'int', + 'series' => 'object[]', + 'created_by_user_id' => 'int', + 'location_subpremise' => 'string', + 'location_street_number' => 'string', + 'location_route' => 'string', + 'location_sublocality' => 'string', + 'location_locality' => 'string', + 'location_admin_area_level_1' => 'string', + 'location_admin_area_level_2' => 'string', + 'location_country' => 'string', + 'location_postal_code' => 'string', + 'location_formatted_address' => 'string', + 'org_name' => 'string', + 'person_name' => 'string', + 'deal_title' => 'string', + 'owner_name' => 'string', + 'person_dropbox_bcc' => 'string', + 'deal_dropbox_bcc' => 'string', + 'assigned_to_user_id' => 'int', + 'file' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'due_date' => 'date', + 'due_time' => null, + 'duration' => null, + 'deal_id' => null, + 'lead_id' => 'uuid', + 'person_id' => null, + 'project_id' => null, + 'org_id' => null, + 'location' => null, + 'public_description' => null, + 'id' => null, + 'note' => null, + 'done' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'participants' => null, + 'busy_flag' => null, + 'attendees' => null, + 'company_id' => null, + 'reference_type' => null, + 'reference_id' => null, + 'conference_meeting_client' => null, + 'conference_meeting_url' => null, + 'conference_meeting_id' => null, + 'add_time' => null, + 'marked_as_done_time' => null, + 'last_notification_time' => null, + 'last_notification_user_id' => null, + 'notification_language_id' => null, + 'active_flag' => null, + 'update_time' => null, + 'update_user_id' => null, + 'gcal_event_id' => null, + 'google_calendar_id' => null, + 'google_calendar_etag' => null, + 'calendar_sync_include_context' => null, + 'source_timezone' => null, + 'rec_rule' => null, + 'rec_rule_extension' => null, + 'rec_master_activity_id' => null, + 'series' => null, + 'created_by_user_id' => null, + 'location_subpremise' => null, + 'location_street_number' => null, + 'location_route' => null, + 'location_sublocality' => null, + 'location_locality' => null, + 'location_admin_area_level_1' => null, + 'location_admin_area_level_2' => null, + 'location_country' => null, + 'location_postal_code' => null, + 'location_formatted_address' => null, + 'org_name' => null, + 'person_name' => null, + 'deal_title' => null, + 'owner_name' => null, + 'person_dropbox_bcc' => null, + 'deal_dropbox_bcc' => null, + 'assigned_to_user_id' => null, + 'file' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'due_date' => 'due_date', + 'due_time' => 'due_time', + 'duration' => 'duration', + 'deal_id' => 'deal_id', + 'lead_id' => 'lead_id', + 'person_id' => 'person_id', + 'project_id' => 'project_id', + 'org_id' => 'org_id', + 'location' => 'location', + 'public_description' => 'public_description', + 'id' => 'id', + 'note' => 'note', + 'done' => 'done', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'participants' => 'participants', + 'busy_flag' => 'busy_flag', + 'attendees' => 'attendees', + 'company_id' => 'company_id', + 'reference_type' => 'reference_type', + 'reference_id' => 'reference_id', + 'conference_meeting_client' => 'conference_meeting_client', + 'conference_meeting_url' => 'conference_meeting_url', + 'conference_meeting_id' => 'conference_meeting_id', + 'add_time' => 'add_time', + 'marked_as_done_time' => 'marked_as_done_time', + 'last_notification_time' => 'last_notification_time', + 'last_notification_user_id' => 'last_notification_user_id', + 'notification_language_id' => 'notification_language_id', + 'active_flag' => 'active_flag', + 'update_time' => 'update_time', + 'update_user_id' => 'update_user_id', + 'gcal_event_id' => 'gcal_event_id', + 'google_calendar_id' => 'google_calendar_id', + 'google_calendar_etag' => 'google_calendar_etag', + 'calendar_sync_include_context' => 'calendar_sync_include_context', + 'source_timezone' => 'source_timezone', + 'rec_rule' => 'rec_rule', + 'rec_rule_extension' => 'rec_rule_extension', + 'rec_master_activity_id' => 'rec_master_activity_id', + 'series' => 'series', + 'created_by_user_id' => 'created_by_user_id', + 'location_subpremise' => 'location_subpremise', + 'location_street_number' => 'location_street_number', + 'location_route' => 'location_route', + 'location_sublocality' => 'location_sublocality', + 'location_locality' => 'location_locality', + 'location_admin_area_level_1' => 'location_admin_area_level_1', + 'location_admin_area_level_2' => 'location_admin_area_level_2', + 'location_country' => 'location_country', + 'location_postal_code' => 'location_postal_code', + 'location_formatted_address' => 'location_formatted_address', + 'org_name' => 'org_name', + 'person_name' => 'person_name', + 'deal_title' => 'deal_title', + 'owner_name' => 'owner_name', + 'person_dropbox_bcc' => 'person_dropbox_bcc', + 'deal_dropbox_bcc' => 'deal_dropbox_bcc', + 'assigned_to_user_id' => 'assigned_to_user_id', + 'file' => 'file' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'due_date' => 'setDueDate', + 'due_time' => 'setDueTime', + 'duration' => 'setDuration', + 'deal_id' => 'setDealId', + 'lead_id' => 'setLeadId', + 'person_id' => 'setPersonId', + 'project_id' => 'setProjectId', + 'org_id' => 'setOrgId', + 'location' => 'setLocation', + 'public_description' => 'setPublicDescription', + 'id' => 'setId', + 'note' => 'setNote', + 'done' => 'setDone', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'participants' => 'setParticipants', + 'busy_flag' => 'setBusyFlag', + 'attendees' => 'setAttendees', + 'company_id' => 'setCompanyId', + 'reference_type' => 'setReferenceType', + 'reference_id' => 'setReferenceId', + 'conference_meeting_client' => 'setConferenceMeetingClient', + 'conference_meeting_url' => 'setConferenceMeetingUrl', + 'conference_meeting_id' => 'setConferenceMeetingId', + 'add_time' => 'setAddTime', + 'marked_as_done_time' => 'setMarkedAsDoneTime', + 'last_notification_time' => 'setLastNotificationTime', + 'last_notification_user_id' => 'setLastNotificationUserId', + 'notification_language_id' => 'setNotificationLanguageId', + 'active_flag' => 'setActiveFlag', + 'update_time' => 'setUpdateTime', + 'update_user_id' => 'setUpdateUserId', + 'gcal_event_id' => 'setGcalEventId', + 'google_calendar_id' => 'setGoogleCalendarId', + 'google_calendar_etag' => 'setGoogleCalendarEtag', + 'calendar_sync_include_context' => 'setCalendarSyncIncludeContext', + 'source_timezone' => 'setSourceTimezone', + 'rec_rule' => 'setRecRule', + 'rec_rule_extension' => 'setRecRuleExtension', + 'rec_master_activity_id' => 'setRecMasterActivityId', + 'series' => 'setSeries', + 'created_by_user_id' => 'setCreatedByUserId', + 'location_subpremise' => 'setLocationSubpremise', + 'location_street_number' => 'setLocationStreetNumber', + 'location_route' => 'setLocationRoute', + 'location_sublocality' => 'setLocationSublocality', + 'location_locality' => 'setLocationLocality', + 'location_admin_area_level_1' => 'setLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'setLocationAdminAreaLevel2', + 'location_country' => 'setLocationCountry', + 'location_postal_code' => 'setLocationPostalCode', + 'location_formatted_address' => 'setLocationFormattedAddress', + 'org_name' => 'setOrgName', + 'person_name' => 'setPersonName', + 'deal_title' => 'setDealTitle', + 'owner_name' => 'setOwnerName', + 'person_dropbox_bcc' => 'setPersonDropboxBcc', + 'deal_dropbox_bcc' => 'setDealDropboxBcc', + 'assigned_to_user_id' => 'setAssignedToUserId', + 'file' => 'setFile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'due_date' => 'getDueDate', + 'due_time' => 'getDueTime', + 'duration' => 'getDuration', + 'deal_id' => 'getDealId', + 'lead_id' => 'getLeadId', + 'person_id' => 'getPersonId', + 'project_id' => 'getProjectId', + 'org_id' => 'getOrgId', + 'location' => 'getLocation', + 'public_description' => 'getPublicDescription', + 'id' => 'getId', + 'note' => 'getNote', + 'done' => 'getDone', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'participants' => 'getParticipants', + 'busy_flag' => 'getBusyFlag', + 'attendees' => 'getAttendees', + 'company_id' => 'getCompanyId', + 'reference_type' => 'getReferenceType', + 'reference_id' => 'getReferenceId', + 'conference_meeting_client' => 'getConferenceMeetingClient', + 'conference_meeting_url' => 'getConferenceMeetingUrl', + 'conference_meeting_id' => 'getConferenceMeetingId', + 'add_time' => 'getAddTime', + 'marked_as_done_time' => 'getMarkedAsDoneTime', + 'last_notification_time' => 'getLastNotificationTime', + 'last_notification_user_id' => 'getLastNotificationUserId', + 'notification_language_id' => 'getNotificationLanguageId', + 'active_flag' => 'getActiveFlag', + 'update_time' => 'getUpdateTime', + 'update_user_id' => 'getUpdateUserId', + 'gcal_event_id' => 'getGcalEventId', + 'google_calendar_id' => 'getGoogleCalendarId', + 'google_calendar_etag' => 'getGoogleCalendarEtag', + 'calendar_sync_include_context' => 'getCalendarSyncIncludeContext', + 'source_timezone' => 'getSourceTimezone', + 'rec_rule' => 'getRecRule', + 'rec_rule_extension' => 'getRecRuleExtension', + 'rec_master_activity_id' => 'getRecMasterActivityId', + 'series' => 'getSeries', + 'created_by_user_id' => 'getCreatedByUserId', + 'location_subpremise' => 'getLocationSubpremise', + 'location_street_number' => 'getLocationStreetNumber', + 'location_route' => 'getLocationRoute', + 'location_sublocality' => 'getLocationSublocality', + 'location_locality' => 'getLocationLocality', + 'location_admin_area_level_1' => 'getLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'getLocationAdminAreaLevel2', + 'location_country' => 'getLocationCountry', + 'location_postal_code' => 'getLocationPostalCode', + 'location_formatted_address' => 'getLocationFormattedAddress', + 'org_name' => 'getOrgName', + 'person_name' => 'getPersonName', + 'deal_title' => 'getDealTitle', + 'owner_name' => 'getOwnerName', + 'person_dropbox_bcc' => 'getPersonDropboxBcc', + 'deal_dropbox_bcc' => 'getDealDropboxBcc', + 'assigned_to_user_id' => 'getAssignedToUserId', + 'file' => 'getFile' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['due_date'] = $data['due_date'] ?? null; + $this->container['due_time'] = $data['due_time'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['project_id'] = $data['project_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['location'] = $data['location'] ?? null; + $this->container['public_description'] = $data['public_description'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['note'] = $data['note'] ?? null; + $this->container['done'] = $data['done'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['participants'] = $data['participants'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['attendees'] = $data['attendees'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['reference_type'] = $data['reference_type'] ?? null; + $this->container['reference_id'] = $data['reference_id'] ?? null; + $this->container['conference_meeting_client'] = $data['conference_meeting_client'] ?? null; + $this->container['conference_meeting_url'] = $data['conference_meeting_url'] ?? null; + $this->container['conference_meeting_id'] = $data['conference_meeting_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['marked_as_done_time'] = $data['marked_as_done_time'] ?? null; + $this->container['last_notification_time'] = $data['last_notification_time'] ?? null; + $this->container['last_notification_user_id'] = $data['last_notification_user_id'] ?? null; + $this->container['notification_language_id'] = $data['notification_language_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['update_user_id'] = $data['update_user_id'] ?? null; + $this->container['gcal_event_id'] = $data['gcal_event_id'] ?? null; + $this->container['google_calendar_id'] = $data['google_calendar_id'] ?? null; + $this->container['google_calendar_etag'] = $data['google_calendar_etag'] ?? null; + $this->container['calendar_sync_include_context'] = $data['calendar_sync_include_context'] ?? null; + $this->container['source_timezone'] = $data['source_timezone'] ?? null; + $this->container['rec_rule'] = $data['rec_rule'] ?? null; + $this->container['rec_rule_extension'] = $data['rec_rule_extension'] ?? null; + $this->container['rec_master_activity_id'] = $data['rec_master_activity_id'] ?? null; + $this->container['series'] = $data['series'] ?? null; + $this->container['created_by_user_id'] = $data['created_by_user_id'] ?? null; + $this->container['location_subpremise'] = $data['location_subpremise'] ?? null; + $this->container['location_street_number'] = $data['location_street_number'] ?? null; + $this->container['location_route'] = $data['location_route'] ?? null; + $this->container['location_sublocality'] = $data['location_sublocality'] ?? null; + $this->container['location_locality'] = $data['location_locality'] ?? null; + $this->container['location_admin_area_level_1'] = $data['location_admin_area_level_1'] ?? null; + $this->container['location_admin_area_level_2'] = $data['location_admin_area_level_2'] ?? null; + $this->container['location_country'] = $data['location_country'] ?? null; + $this->container['location_postal_code'] = $data['location_postal_code'] ?? null; + $this->container['location_formatted_address'] = $data['location_formatted_address'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['deal_title'] = $data['deal_title'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['person_dropbox_bcc'] = $data['person_dropbox_bcc'] ?? null; + $this->container['deal_dropbox_bcc'] = $data['deal_dropbox_bcc'] ?? null; + $this->container['assigned_to_user_id'] = $data['assigned_to_user_id'] ?? null; + $this->container['file'] = $data['file'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date The due date of the activity. Format: YYYY-MM-DD + * + * @return self + */ + public function setDueDate($due_date): self + { + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets due_time + * + * @return string|null + */ + public function getDueTime() + { + return $this->container['due_time']; + } + + /** + * Sets due_time + * + * @param string|null $due_time The due time of the activity in UTC. Format: HH:MM + * + * @return self + */ + public function setDueTime($due_time): self + { + $this->container['due_time'] = $due_time; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the activity. Format: HH:MM + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this activity is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead in the UUID format this activity is associated with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this activity is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets project_id + * + * @return int|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param int|null $project_id The ID of the project this activity is associated with + * + * @return self + */ + public function setProjectId($project_id): self + { + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this activity is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location The address of the activity. Pipedrive will automatically check if the location matches a geo-location on Google maps. + * + * @return self + */ + public function setLocation($location): self + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets public_description + * + * @return string|null + */ + public function getPublicDescription() + { + return $this->container['public_description']; + } + + /** + * Sets public_description + * + * @param string|null $public_description Additional details about the activity that is synced to your external calendar. Unlike the note added to the activity, the description is publicly visible to any guests added to the activity. + * + * @return self + */ + public function setPublicDescription($public_description): self + { + $this->container['public_description'] = $public_description; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the activity, generated when the activity was created + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note of the activity (HTML format) + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets done + * + * @return bool|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param bool|null $done Whether the activity is done or not + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets participants + * + * @return object[]|null + */ + public function getParticipants() + { + return $this->container['participants']; + } + + /** + * Sets participants + * + * @param object[]|null $participants List of multiple persons (participants) this activity is associated with + * + * @return self + */ + public function setParticipants($participants): self + { + $this->container['participants'] = $participants; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets attendees + * + * @return object[]|null + */ + public function getAttendees() + { + return $this->container['attendees']; + } + + /** + * Sets attendees + * + * @param object[]|null $attendees The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. + * + * @return self + */ + public function setAttendees($attendees): self + { + $this->container['attendees'] = $attendees; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The user's company ID + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets reference_type + * + * @return string|null + */ + public function getReferenceType() + { + return $this->container['reference_type']; + } + + /** + * Sets reference_type + * + * @param string|null $reference_type If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. + * + * @return self + */ + public function setReferenceType($reference_type): self + { + $this->container['reference_type'] = $reference_type; + + return $this; + } + + /** + * Gets reference_id + * + * @return int|null + */ + public function getReferenceId() + { + return $this->container['reference_id']; + } + + /** + * Sets reference_id + * + * @param int|null $reference_id Together with the `reference_type`, gives the ID of the other object + * + * @return self + */ + public function setReferenceId($reference_id): self + { + $this->container['reference_id'] = $reference_id; + + return $this; + } + + /** + * Gets conference_meeting_client + * + * @return string|null + */ + public function getConferenceMeetingClient() + { + return $this->container['conference_meeting_client']; + } + + /** + * Sets conference_meeting_client + * + * @param string|null $conference_meeting_client The ID of the Marketplace app, which is connected to this activity + * + * @return self + */ + public function setConferenceMeetingClient($conference_meeting_client): self + { + $this->container['conference_meeting_client'] = $conference_meeting_client; + + return $this; + } + + /** + * Gets conference_meeting_url + * + * @return string|null + */ + public function getConferenceMeetingUrl() + { + return $this->container['conference_meeting_url']; + } + + /** + * Sets conference_meeting_url + * + * @param string|null $conference_meeting_url The link to join the meeting which is associated with this activity + * + * @return self + */ + public function setConferenceMeetingUrl($conference_meeting_url): self + { + $this->container['conference_meeting_url'] = $conference_meeting_url; + + return $this; + } + + /** + * Gets conference_meeting_id + * + * @return string|null + */ + public function getConferenceMeetingId() + { + return $this->container['conference_meeting_id']; + } + + /** + * Sets conference_meeting_id + * + * @param string|null $conference_meeting_id The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity + * + * @return self + */ + public function setConferenceMeetingId($conference_meeting_id): self + { + $this->container['conference_meeting_id'] = $conference_meeting_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets marked_as_done_time + * + * @return string|null + */ + public function getMarkedAsDoneTime() + { + return $this->container['marked_as_done_time']; + } + + /** + * Sets marked_as_done_time + * + * @param string|null $marked_as_done_time The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setMarkedAsDoneTime($marked_as_done_time): self + { + $this->container['marked_as_done_time'] = $marked_as_done_time; + + return $this; + } + + /** + * Gets last_notification_time + * + * @return string|null + */ + public function getLastNotificationTime() + { + return $this->container['last_notification_time']; + } + + /** + * Sets last_notification_time + * + * @param string|null $last_notification_time The date and time of latest notifications sent about this activity to the participants or the attendees of this activity + * + * @return self + */ + public function setLastNotificationTime($last_notification_time): self + { + $this->container['last_notification_time'] = $last_notification_time; + + return $this; + } + + /** + * Gets last_notification_user_id + * + * @return int|null + */ + public function getLastNotificationUserId() + { + return $this->container['last_notification_user_id']; + } + + /** + * Sets last_notification_user_id + * + * @param int|null $last_notification_user_id The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity + * + * @return self + */ + public function setLastNotificationUserId($last_notification_user_id): self + { + $this->container['last_notification_user_id'] = $last_notification_user_id; + + return $this; + } + + /** + * Gets notification_language_id + * + * @return int|null + */ + public function getNotificationLanguageId() + { + return $this->container['notification_language_id']; + } + + /** + * Sets notification_language_id + * + * @param int|null $notification_language_id The ID of the language the notifications are sent in + * + * @return self + */ + public function setNotificationLanguageId($notification_language_id): self + { + $this->container['notification_language_id'] = $notification_language_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the activity is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets update_user_id + * + * @return int|null + */ + public function getUpdateUserId() + { + return $this->container['update_user_id']; + } + + /** + * Sets update_user_id + * + * @param int|null $update_user_id The ID of the user who was the last to update this activity + * + * @return self + */ + public function setUpdateUserId($update_user_id): self + { + $this->container['update_user_id'] = $update_user_id; + + return $this; + } + + /** + * Gets gcal_event_id + * + * @return string|null + */ + public function getGcalEventId() + { + return $this->container['gcal_event_id']; + } + + /** + * Sets gcal_event_id + * + * @param string|null $gcal_event_id For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. + * + * @return self + */ + public function setGcalEventId($gcal_event_id): self + { + $this->container['gcal_event_id'] = $gcal_event_id; + + return $this; + } + + /** + * Gets google_calendar_id + * + * @return string|null + */ + public function getGoogleCalendarId() + { + return $this->container['google_calendar_id']; + } + + /** + * Sets google_calendar_id + * + * @param string|null $google_calendar_id The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. + * + * @return self + */ + public function setGoogleCalendarId($google_calendar_id): self + { + $this->container['google_calendar_id'] = $google_calendar_id; + + return $this; + } + + /** + * Gets google_calendar_etag + * + * @return string|null + */ + public function getGoogleCalendarEtag() + { + return $this->container['google_calendar_etag']; + } + + /** + * Sets google_calendar_etag + * + * @param string|null $google_calendar_etag The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. + * + * @return self + */ + public function setGoogleCalendarEtag($google_calendar_etag): self + { + $this->container['google_calendar_etag'] = $google_calendar_etag; + + return $this; + } + + /** + * Gets calendar_sync_include_context + * + * @return string|null + */ + public function getCalendarSyncIncludeContext() + { + return $this->container['calendar_sync_include_context']; + } + + /** + * Sets calendar_sync_include_context + * + * @param string|null $calendar_sync_include_context For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) + * + * @return self + */ + public function setCalendarSyncIncludeContext($calendar_sync_include_context): self + { + $this->container['calendar_sync_include_context'] = $calendar_sync_include_context; + + return $this; + } + + /** + * Gets source_timezone + * + * @return string|null + */ + public function getSourceTimezone() + { + return $this->container['source_timezone']; + } + + /** + * Sets source_timezone + * + * @param string|null $source_timezone The timezone the activity was created in an external calendar + * + * @return self + */ + public function setSourceTimezone($source_timezone): self + { + $this->container['source_timezone'] = $source_timezone; + + return $this; + } + + /** + * Gets rec_rule + * + * @return string|null + */ + public function getRecRule() + { + return $this->container['rec_rule']; + } + + /** + * Sets rec_rule + * + * @param string|null $rec_rule The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: \"RRULE:FREQ=WEEKLY;BYDAY=WE\" + * + * @return self + */ + public function setRecRule($rec_rule): self + { + $this->container['rec_rule'] = $rec_rule; + + return $this; + } + + /** + * Gets rec_rule_extension + * + * @return string|null + */ + public function getRecRuleExtension() + { + return $this->container['rec_rule_extension']; + } + + /** + * Sets rec_rule_extension + * + * @param string|null $rec_rule_extension Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. + * + * @return self + */ + public function setRecRuleExtension($rec_rule_extension): self + { + $this->container['rec_rule_extension'] = $rec_rule_extension; + + return $this; + } + + /** + * Gets rec_master_activity_id + * + * @return int|null + */ + public function getRecMasterActivityId() + { + return $this->container['rec_master_activity_id']; + } + + /** + * Sets rec_master_activity_id + * + * @param int|null $rec_master_activity_id The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules + * + * @return self + */ + public function setRecMasterActivityId($rec_master_activity_id): self + { + $this->container['rec_master_activity_id'] = $rec_master_activity_id; + + return $this; + } + + /** + * Gets series + * + * @return object[]|null + */ + public function getSeries() + { + return $this->container['series']; + } + + /** + * Sets series + * + * @param object[]|null $series The list of recurring activity instances. It is in a structure as follows: `[{due_date: \"2020-06-24\", due_time: \"10:00:00\"}]` + * + * @return self + */ + public function setSeries($series): self + { + $this->container['series'] = $series; + + return $this; + } + + /** + * Gets created_by_user_id + * + * @return int|null + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param int|null $created_by_user_id The ID of the user who created the activity + * + * @return self + */ + public function setCreatedByUserId($created_by_user_id): self + { + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + + /** + * Gets location_subpremise + * + * @return string|null + */ + public function getLocationSubpremise() + { + return $this->container['location_subpremise']; + } + + /** + * Sets location_subpremise + * + * @param string|null $location_subpremise A subfield of the location field. Indicates apartment/suite number. + * + * @return self + */ + public function setLocationSubpremise($location_subpremise): self + { + $this->container['location_subpremise'] = $location_subpremise; + + return $this; + } + + /** + * Gets location_street_number + * + * @return string|null + */ + public function getLocationStreetNumber() + { + return $this->container['location_street_number']; + } + + /** + * Sets location_street_number + * + * @param string|null $location_street_number A subfield of the location field. Indicates house number. + * + * @return self + */ + public function setLocationStreetNumber($location_street_number): self + { + $this->container['location_street_number'] = $location_street_number; + + return $this; + } + + /** + * Gets location_route + * + * @return string|null + */ + public function getLocationRoute() + { + return $this->container['location_route']; + } + + /** + * Sets location_route + * + * @param string|null $location_route A subfield of the location field. Indicates street name. + * + * @return self + */ + public function setLocationRoute($location_route): self + { + $this->container['location_route'] = $location_route; + + return $this; + } + + /** + * Gets location_sublocality + * + * @return string|null + */ + public function getLocationSublocality() + { + return $this->container['location_sublocality']; + } + + /** + * Sets location_sublocality + * + * @param string|null $location_sublocality A subfield of the location field. Indicates district/sublocality. + * + * @return self + */ + public function setLocationSublocality($location_sublocality): self + { + $this->container['location_sublocality'] = $location_sublocality; + + return $this; + } + + /** + * Gets location_locality + * + * @return string|null + */ + public function getLocationLocality() + { + return $this->container['location_locality']; + } + + /** + * Sets location_locality + * + * @param string|null $location_locality A subfield of the location field. Indicates city/town/village/locality. + * + * @return self + */ + public function setLocationLocality($location_locality): self + { + $this->container['location_locality'] = $location_locality; + + return $this; + } + + /** + * Gets location_admin_area_level_1 + * + * @return string|null + */ + public function getLocationAdminAreaLevel1() + { + return $this->container['location_admin_area_level_1']; + } + + /** + * Sets location_admin_area_level_1 + * + * @param string|null $location_admin_area_level_1 A subfield of the location field. Indicates state/county. + * + * @return self + */ + public function setLocationAdminAreaLevel1($location_admin_area_level_1): self + { + $this->container['location_admin_area_level_1'] = $location_admin_area_level_1; + + return $this; + } + + /** + * Gets location_admin_area_level_2 + * + * @return string|null + */ + public function getLocationAdminAreaLevel2() + { + return $this->container['location_admin_area_level_2']; + } + + /** + * Sets location_admin_area_level_2 + * + * @param string|null $location_admin_area_level_2 A subfield of the location field. Indicates region. + * + * @return self + */ + public function setLocationAdminAreaLevel2($location_admin_area_level_2): self + { + $this->container['location_admin_area_level_2'] = $location_admin_area_level_2; + + return $this; + } + + /** + * Gets location_country + * + * @return string|null + */ + public function getLocationCountry() + { + return $this->container['location_country']; + } + + /** + * Sets location_country + * + * @param string|null $location_country A subfield of the location field. Indicates country. + * + * @return self + */ + public function setLocationCountry($location_country): self + { + $this->container['location_country'] = $location_country; + + return $this; + } + + /** + * Gets location_postal_code + * + * @return string|null + */ + public function getLocationPostalCode() + { + return $this->container['location_postal_code']; + } + + /** + * Sets location_postal_code + * + * @param string|null $location_postal_code A subfield of the location field. Indicates ZIP/postal code. + * + * @return self + */ + public function setLocationPostalCode($location_postal_code): self + { + $this->container['location_postal_code'] = $location_postal_code; + + return $this; + } + + /** + * Gets location_formatted_address + * + * @return string|null + */ + public function getLocationFormattedAddress() + { + return $this->container['location_formatted_address']; + } + + /** + * Sets location_formatted_address + * + * @param string|null $location_formatted_address A subfield of the location field. Indicates full/combined address. + * + * @return self + */ + public function setLocationFormattedAddress($location_formatted_address): self + { + $this->container['location_formatted_address'] = $location_formatted_address; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization this activity is associated with + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person this activity is associated with + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets deal_title + * + * @return string|null + */ + public function getDealTitle() + { + return $this->container['deal_title']; + } + + /** + * Sets deal_title + * + * @param string|null $deal_title The name of the deal this activity is associated with + * + * @return self + */ + public function setDealTitle($deal_title): self + { + $this->container['deal_title'] = $deal_title; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the user this activity is owned by + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets person_dropbox_bcc + * + * @return string|null + */ + public function getPersonDropboxBcc() + { + return $this->container['person_dropbox_bcc']; + } + + /** + * Sets person_dropbox_bcc + * + * @param string|null $person_dropbox_bcc The BCC email address of the person + * + * @return self + */ + public function setPersonDropboxBcc($person_dropbox_bcc): self + { + $this->container['person_dropbox_bcc'] = $person_dropbox_bcc; + + return $this; + } + + /** + * Gets deal_dropbox_bcc + * + * @return string|null + */ + public function getDealDropboxBcc() + { + return $this->container['deal_dropbox_bcc']; + } + + /** + * Sets deal_dropbox_bcc + * + * @param string|null $deal_dropbox_bcc The BCC email address of the deal + * + * @return self + */ + public function setDealDropboxBcc($deal_dropbox_bcc): self + { + $this->container['deal_dropbox_bcc'] = $deal_dropbox_bcc; + + return $this; + } + + /** + * Gets assigned_to_user_id + * + * @return int|null + */ + public function getAssignedToUserId() + { + return $this->container['assigned_to_user_id']; + } + + /** + * Sets assigned_to_user_id + * + * @param int|null $assigned_to_user_id The ID of the user to whom the activity is assigned to. Equal to `user_id`. + * + * @return self + */ + public function setAssignedToUserId($assigned_to_user_id): self + { + $this->container['assigned_to_user_id'] = $assigned_to_user_id; + + return $this; + } + + /** + * Gets file + * + * @return object|null + */ + public function getFile() + { + return $this->container['file']; + } + + /** + * Sets file + * + * @param object|null $file The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. + * + * @return self + */ + public function setFile($file): self + { + $this->container['file'] = $file; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityResponseObjectAllOf.php b/lib/Model/ActivityResponseObjectAllOf.php new file mode 100644 index 00000000..766e1bcd --- /dev/null +++ b/lib/Model/ActivityResponseObjectAllOf.php @@ -0,0 +1,1842 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityResponseObjectAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityResponseObject_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'note' => 'string', + 'done' => 'bool', + 'subject' => 'string', + 'type' => 'string', + 'user_id' => 'int', + 'participants' => 'object[]', + 'busy_flag' => 'bool', + 'attendees' => 'object[]', + 'company_id' => 'int', + 'reference_type' => 'string', + 'reference_id' => 'int', + 'conference_meeting_client' => 'string', + 'conference_meeting_url' => 'string', + 'conference_meeting_id' => 'string', + 'add_time' => 'string', + 'marked_as_done_time' => 'string', + 'last_notification_time' => 'string', + 'last_notification_user_id' => 'int', + 'notification_language_id' => 'int', + 'active_flag' => 'bool', + 'update_time' => 'string', + 'update_user_id' => 'int', + 'gcal_event_id' => 'string', + 'google_calendar_id' => 'string', + 'google_calendar_etag' => 'string', + 'calendar_sync_include_context' => 'string', + 'source_timezone' => 'string', + 'rec_rule' => 'string', + 'rec_rule_extension' => 'string', + 'rec_master_activity_id' => 'int', + 'series' => 'object[]', + 'created_by_user_id' => 'int', + 'location_subpremise' => 'string', + 'location_street_number' => 'string', + 'location_route' => 'string', + 'location_sublocality' => 'string', + 'location_locality' => 'string', + 'location_admin_area_level_1' => 'string', + 'location_admin_area_level_2' => 'string', + 'location_country' => 'string', + 'location_postal_code' => 'string', + 'location_formatted_address' => 'string', + 'org_name' => 'string', + 'person_name' => 'string', + 'deal_title' => 'string', + 'owner_name' => 'string', + 'person_dropbox_bcc' => 'string', + 'deal_dropbox_bcc' => 'string', + 'assigned_to_user_id' => 'int', + 'file' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'note' => null, + 'done' => null, + 'subject' => null, + 'type' => null, + 'user_id' => null, + 'participants' => null, + 'busy_flag' => null, + 'attendees' => null, + 'company_id' => null, + 'reference_type' => null, + 'reference_id' => null, + 'conference_meeting_client' => null, + 'conference_meeting_url' => null, + 'conference_meeting_id' => null, + 'add_time' => null, + 'marked_as_done_time' => null, + 'last_notification_time' => null, + 'last_notification_user_id' => null, + 'notification_language_id' => null, + 'active_flag' => null, + 'update_time' => null, + 'update_user_id' => null, + 'gcal_event_id' => null, + 'google_calendar_id' => null, + 'google_calendar_etag' => null, + 'calendar_sync_include_context' => null, + 'source_timezone' => null, + 'rec_rule' => null, + 'rec_rule_extension' => null, + 'rec_master_activity_id' => null, + 'series' => null, + 'created_by_user_id' => null, + 'location_subpremise' => null, + 'location_street_number' => null, + 'location_route' => null, + 'location_sublocality' => null, + 'location_locality' => null, + 'location_admin_area_level_1' => null, + 'location_admin_area_level_2' => null, + 'location_country' => null, + 'location_postal_code' => null, + 'location_formatted_address' => null, + 'org_name' => null, + 'person_name' => null, + 'deal_title' => null, + 'owner_name' => null, + 'person_dropbox_bcc' => null, + 'deal_dropbox_bcc' => null, + 'assigned_to_user_id' => null, + 'file' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'note' => 'note', + 'done' => 'done', + 'subject' => 'subject', + 'type' => 'type', + 'user_id' => 'user_id', + 'participants' => 'participants', + 'busy_flag' => 'busy_flag', + 'attendees' => 'attendees', + 'company_id' => 'company_id', + 'reference_type' => 'reference_type', + 'reference_id' => 'reference_id', + 'conference_meeting_client' => 'conference_meeting_client', + 'conference_meeting_url' => 'conference_meeting_url', + 'conference_meeting_id' => 'conference_meeting_id', + 'add_time' => 'add_time', + 'marked_as_done_time' => 'marked_as_done_time', + 'last_notification_time' => 'last_notification_time', + 'last_notification_user_id' => 'last_notification_user_id', + 'notification_language_id' => 'notification_language_id', + 'active_flag' => 'active_flag', + 'update_time' => 'update_time', + 'update_user_id' => 'update_user_id', + 'gcal_event_id' => 'gcal_event_id', + 'google_calendar_id' => 'google_calendar_id', + 'google_calendar_etag' => 'google_calendar_etag', + 'calendar_sync_include_context' => 'calendar_sync_include_context', + 'source_timezone' => 'source_timezone', + 'rec_rule' => 'rec_rule', + 'rec_rule_extension' => 'rec_rule_extension', + 'rec_master_activity_id' => 'rec_master_activity_id', + 'series' => 'series', + 'created_by_user_id' => 'created_by_user_id', + 'location_subpremise' => 'location_subpremise', + 'location_street_number' => 'location_street_number', + 'location_route' => 'location_route', + 'location_sublocality' => 'location_sublocality', + 'location_locality' => 'location_locality', + 'location_admin_area_level_1' => 'location_admin_area_level_1', + 'location_admin_area_level_2' => 'location_admin_area_level_2', + 'location_country' => 'location_country', + 'location_postal_code' => 'location_postal_code', + 'location_formatted_address' => 'location_formatted_address', + 'org_name' => 'org_name', + 'person_name' => 'person_name', + 'deal_title' => 'deal_title', + 'owner_name' => 'owner_name', + 'person_dropbox_bcc' => 'person_dropbox_bcc', + 'deal_dropbox_bcc' => 'deal_dropbox_bcc', + 'assigned_to_user_id' => 'assigned_to_user_id', + 'file' => 'file' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'note' => 'setNote', + 'done' => 'setDone', + 'subject' => 'setSubject', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'participants' => 'setParticipants', + 'busy_flag' => 'setBusyFlag', + 'attendees' => 'setAttendees', + 'company_id' => 'setCompanyId', + 'reference_type' => 'setReferenceType', + 'reference_id' => 'setReferenceId', + 'conference_meeting_client' => 'setConferenceMeetingClient', + 'conference_meeting_url' => 'setConferenceMeetingUrl', + 'conference_meeting_id' => 'setConferenceMeetingId', + 'add_time' => 'setAddTime', + 'marked_as_done_time' => 'setMarkedAsDoneTime', + 'last_notification_time' => 'setLastNotificationTime', + 'last_notification_user_id' => 'setLastNotificationUserId', + 'notification_language_id' => 'setNotificationLanguageId', + 'active_flag' => 'setActiveFlag', + 'update_time' => 'setUpdateTime', + 'update_user_id' => 'setUpdateUserId', + 'gcal_event_id' => 'setGcalEventId', + 'google_calendar_id' => 'setGoogleCalendarId', + 'google_calendar_etag' => 'setGoogleCalendarEtag', + 'calendar_sync_include_context' => 'setCalendarSyncIncludeContext', + 'source_timezone' => 'setSourceTimezone', + 'rec_rule' => 'setRecRule', + 'rec_rule_extension' => 'setRecRuleExtension', + 'rec_master_activity_id' => 'setRecMasterActivityId', + 'series' => 'setSeries', + 'created_by_user_id' => 'setCreatedByUserId', + 'location_subpremise' => 'setLocationSubpremise', + 'location_street_number' => 'setLocationStreetNumber', + 'location_route' => 'setLocationRoute', + 'location_sublocality' => 'setLocationSublocality', + 'location_locality' => 'setLocationLocality', + 'location_admin_area_level_1' => 'setLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'setLocationAdminAreaLevel2', + 'location_country' => 'setLocationCountry', + 'location_postal_code' => 'setLocationPostalCode', + 'location_formatted_address' => 'setLocationFormattedAddress', + 'org_name' => 'setOrgName', + 'person_name' => 'setPersonName', + 'deal_title' => 'setDealTitle', + 'owner_name' => 'setOwnerName', + 'person_dropbox_bcc' => 'setPersonDropboxBcc', + 'deal_dropbox_bcc' => 'setDealDropboxBcc', + 'assigned_to_user_id' => 'setAssignedToUserId', + 'file' => 'setFile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'note' => 'getNote', + 'done' => 'getDone', + 'subject' => 'getSubject', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'participants' => 'getParticipants', + 'busy_flag' => 'getBusyFlag', + 'attendees' => 'getAttendees', + 'company_id' => 'getCompanyId', + 'reference_type' => 'getReferenceType', + 'reference_id' => 'getReferenceId', + 'conference_meeting_client' => 'getConferenceMeetingClient', + 'conference_meeting_url' => 'getConferenceMeetingUrl', + 'conference_meeting_id' => 'getConferenceMeetingId', + 'add_time' => 'getAddTime', + 'marked_as_done_time' => 'getMarkedAsDoneTime', + 'last_notification_time' => 'getLastNotificationTime', + 'last_notification_user_id' => 'getLastNotificationUserId', + 'notification_language_id' => 'getNotificationLanguageId', + 'active_flag' => 'getActiveFlag', + 'update_time' => 'getUpdateTime', + 'update_user_id' => 'getUpdateUserId', + 'gcal_event_id' => 'getGcalEventId', + 'google_calendar_id' => 'getGoogleCalendarId', + 'google_calendar_etag' => 'getGoogleCalendarEtag', + 'calendar_sync_include_context' => 'getCalendarSyncIncludeContext', + 'source_timezone' => 'getSourceTimezone', + 'rec_rule' => 'getRecRule', + 'rec_rule_extension' => 'getRecRuleExtension', + 'rec_master_activity_id' => 'getRecMasterActivityId', + 'series' => 'getSeries', + 'created_by_user_id' => 'getCreatedByUserId', + 'location_subpremise' => 'getLocationSubpremise', + 'location_street_number' => 'getLocationStreetNumber', + 'location_route' => 'getLocationRoute', + 'location_sublocality' => 'getLocationSublocality', + 'location_locality' => 'getLocationLocality', + 'location_admin_area_level_1' => 'getLocationAdminAreaLevel1', + 'location_admin_area_level_2' => 'getLocationAdminAreaLevel2', + 'location_country' => 'getLocationCountry', + 'location_postal_code' => 'getLocationPostalCode', + 'location_formatted_address' => 'getLocationFormattedAddress', + 'org_name' => 'getOrgName', + 'person_name' => 'getPersonName', + 'deal_title' => 'getDealTitle', + 'owner_name' => 'getOwnerName', + 'person_dropbox_bcc' => 'getPersonDropboxBcc', + 'deal_dropbox_bcc' => 'getDealDropboxBcc', + 'assigned_to_user_id' => 'getAssignedToUserId', + 'file' => 'getFile' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['note'] = $data['note'] ?? null; + $this->container['done'] = $data['done'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['participants'] = $data['participants'] ?? null; + $this->container['busy_flag'] = $data['busy_flag'] ?? null; + $this->container['attendees'] = $data['attendees'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['reference_type'] = $data['reference_type'] ?? null; + $this->container['reference_id'] = $data['reference_id'] ?? null; + $this->container['conference_meeting_client'] = $data['conference_meeting_client'] ?? null; + $this->container['conference_meeting_url'] = $data['conference_meeting_url'] ?? null; + $this->container['conference_meeting_id'] = $data['conference_meeting_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['marked_as_done_time'] = $data['marked_as_done_time'] ?? null; + $this->container['last_notification_time'] = $data['last_notification_time'] ?? null; + $this->container['last_notification_user_id'] = $data['last_notification_user_id'] ?? null; + $this->container['notification_language_id'] = $data['notification_language_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['update_user_id'] = $data['update_user_id'] ?? null; + $this->container['gcal_event_id'] = $data['gcal_event_id'] ?? null; + $this->container['google_calendar_id'] = $data['google_calendar_id'] ?? null; + $this->container['google_calendar_etag'] = $data['google_calendar_etag'] ?? null; + $this->container['calendar_sync_include_context'] = $data['calendar_sync_include_context'] ?? null; + $this->container['source_timezone'] = $data['source_timezone'] ?? null; + $this->container['rec_rule'] = $data['rec_rule'] ?? null; + $this->container['rec_rule_extension'] = $data['rec_rule_extension'] ?? null; + $this->container['rec_master_activity_id'] = $data['rec_master_activity_id'] ?? null; + $this->container['series'] = $data['series'] ?? null; + $this->container['created_by_user_id'] = $data['created_by_user_id'] ?? null; + $this->container['location_subpremise'] = $data['location_subpremise'] ?? null; + $this->container['location_street_number'] = $data['location_street_number'] ?? null; + $this->container['location_route'] = $data['location_route'] ?? null; + $this->container['location_sublocality'] = $data['location_sublocality'] ?? null; + $this->container['location_locality'] = $data['location_locality'] ?? null; + $this->container['location_admin_area_level_1'] = $data['location_admin_area_level_1'] ?? null; + $this->container['location_admin_area_level_2'] = $data['location_admin_area_level_2'] ?? null; + $this->container['location_country'] = $data['location_country'] ?? null; + $this->container['location_postal_code'] = $data['location_postal_code'] ?? null; + $this->container['location_formatted_address'] = $data['location_formatted_address'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['deal_title'] = $data['deal_title'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['person_dropbox_bcc'] = $data['person_dropbox_bcc'] ?? null; + $this->container['deal_dropbox_bcc'] = $data['deal_dropbox_bcc'] ?? null; + $this->container['assigned_to_user_id'] = $data['assigned_to_user_id'] ?? null; + $this->container['file'] = $data['file'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the activity, generated when the activity was created + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note of the activity (HTML format) + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets done + * + * @return bool|null + */ + public function getDone() + { + return $this->container['done']; + } + + /** + * Sets done + * + * @param bool|null $done Whether the activity is done or not + * + * @return self + */ + public function setDone($done): self + { + $this->container['done'] = $done; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of the activity + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the activity. This is in correlation with the `key_string` parameter of ActivityTypes. + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user whom the activity is assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets participants + * + * @return object[]|null + */ + public function getParticipants() + { + return $this->container['participants']; + } + + /** + * Sets participants + * + * @param object[]|null $participants List of multiple persons (participants) this activity is associated with + * + * @return self + */ + public function setParticipants($participants): self + { + $this->container['participants'] = $participants; + + return $this; + } + + /** + * Gets busy_flag + * + * @return bool|null + */ + public function getBusyFlag() + { + return $this->container['busy_flag']; + } + + /** + * Sets busy_flag + * + * @param bool|null $busy_flag Marks if the activity is set as 'Busy' or 'Free'. If the flag is set to `true`, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset. When the value of the flag is unset (`null`), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. + * + * @return self + */ + public function setBusyFlag($busy_flag): self + { + $this->container['busy_flag'] = $busy_flag; + + return $this; + } + + /** + * Gets attendees + * + * @return object[]|null + */ + public function getAttendees() + { + return $this->container['attendees']; + } + + /** + * Sets attendees + * + * @param object[]|null $attendees The attendees of the activity. This can be either your existing Pipedrive contacts or an external email address. + * + * @return self + */ + public function setAttendees($attendees): self + { + $this->container['attendees'] = $attendees; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The user's company ID + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets reference_type + * + * @return string|null + */ + public function getReferenceType() + { + return $this->container['reference_type']; + } + + /** + * Sets reference_type + * + * @param string|null $reference_type If the activity references some other object, it is indicated here. For example, value `Salesphone` refers to activities created with Caller. + * + * @return self + */ + public function setReferenceType($reference_type): self + { + $this->container['reference_type'] = $reference_type; + + return $this; + } + + /** + * Gets reference_id + * + * @return int|null + */ + public function getReferenceId() + { + return $this->container['reference_id']; + } + + /** + * Sets reference_id + * + * @param int|null $reference_id Together with the `reference_type`, gives the ID of the other object + * + * @return self + */ + public function setReferenceId($reference_id): self + { + $this->container['reference_id'] = $reference_id; + + return $this; + } + + /** + * Gets conference_meeting_client + * + * @return string|null + */ + public function getConferenceMeetingClient() + { + return $this->container['conference_meeting_client']; + } + + /** + * Sets conference_meeting_client + * + * @param string|null $conference_meeting_client The ID of the Marketplace app, which is connected to this activity + * + * @return self + */ + public function setConferenceMeetingClient($conference_meeting_client): self + { + $this->container['conference_meeting_client'] = $conference_meeting_client; + + return $this; + } + + /** + * Gets conference_meeting_url + * + * @return string|null + */ + public function getConferenceMeetingUrl() + { + return $this->container['conference_meeting_url']; + } + + /** + * Sets conference_meeting_url + * + * @param string|null $conference_meeting_url The link to join the meeting which is associated with this activity + * + * @return self + */ + public function setConferenceMeetingUrl($conference_meeting_url): self + { + $this->container['conference_meeting_url'] = $conference_meeting_url; + + return $this; + } + + /** + * Gets conference_meeting_id + * + * @return string|null + */ + public function getConferenceMeetingId() + { + return $this->container['conference_meeting_id']; + } + + /** + * Sets conference_meeting_id + * + * @param string|null $conference_meeting_id The meeting ID of the meeting provider (Zoom, MS Teams etc.) that is associated with this activity + * + * @return self + */ + public function setConferenceMeetingId($conference_meeting_id): self + { + $this->container['conference_meeting_id'] = $conference_meeting_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the activity in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets marked_as_done_time + * + * @return string|null + */ + public function getMarkedAsDoneTime() + { + return $this->container['marked_as_done_time']; + } + + /** + * Sets marked_as_done_time + * + * @param string|null $marked_as_done_time The date and time this activity was marked as done. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setMarkedAsDoneTime($marked_as_done_time): self + { + $this->container['marked_as_done_time'] = $marked_as_done_time; + + return $this; + } + + /** + * Gets last_notification_time + * + * @return string|null + */ + public function getLastNotificationTime() + { + return $this->container['last_notification_time']; + } + + /** + * Sets last_notification_time + * + * @param string|null $last_notification_time The date and time of latest notifications sent about this activity to the participants or the attendees of this activity + * + * @return self + */ + public function setLastNotificationTime($last_notification_time): self + { + $this->container['last_notification_time'] = $last_notification_time; + + return $this; + } + + /** + * Gets last_notification_user_id + * + * @return int|null + */ + public function getLastNotificationUserId() + { + return $this->container['last_notification_user_id']; + } + + /** + * Sets last_notification_user_id + * + * @param int|null $last_notification_user_id The ID of the user who triggered the sending of the latest notifications about this activity to the participants or the attendees of this activity + * + * @return self + */ + public function setLastNotificationUserId($last_notification_user_id): self + { + $this->container['last_notification_user_id'] = $last_notification_user_id; + + return $this; + } + + /** + * Gets notification_language_id + * + * @return int|null + */ + public function getNotificationLanguageId() + { + return $this->container['notification_language_id']; + } + + /** + * Sets notification_language_id + * + * @param int|null $notification_language_id The ID of the language the notifications are sent in + * + * @return self + */ + public function setNotificationLanguageId($notification_language_id): self + { + $this->container['notification_language_id'] = $notification_language_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the activity is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last update date and time of the activity. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets update_user_id + * + * @return int|null + */ + public function getUpdateUserId() + { + return $this->container['update_user_id']; + } + + /** + * Sets update_user_id + * + * @param int|null $update_user_id The ID of the user who was the last to update this activity + * + * @return self + */ + public function setUpdateUserId($update_user_id): self + { + $this->container['update_user_id'] = $update_user_id; + + return $this; + } + + /** + * Gets gcal_event_id + * + * @return string|null + */ + public function getGcalEventId() + { + return $this->container['gcal_event_id']; + } + + /** + * Sets gcal_event_id + * + * @param string|null $gcal_event_id For the activity which syncs to Google calendar, this is the Google event ID. NB! This field is related to old Google calendar sync and will be deprecated soon. + * + * @return self + */ + public function setGcalEventId($gcal_event_id): self + { + $this->container['gcal_event_id'] = $gcal_event_id; + + return $this; + } + + /** + * Gets google_calendar_id + * + * @return string|null + */ + public function getGoogleCalendarId() + { + return $this->container['google_calendar_id']; + } + + /** + * Sets google_calendar_id + * + * @param string|null $google_calendar_id The Google calendar ID that this activity syncs to. NB! This field is related to old Google calendar sync and will be deprecated soon. + * + * @return self + */ + public function setGoogleCalendarId($google_calendar_id): self + { + $this->container['google_calendar_id'] = $google_calendar_id; + + return $this; + } + + /** + * Gets google_calendar_etag + * + * @return string|null + */ + public function getGoogleCalendarEtag() + { + return $this->container['google_calendar_etag']; + } + + /** + * Sets google_calendar_etag + * + * @param string|null $google_calendar_etag The Google calendar API etag (version) that is used for syncing this activity. NB! This field is related to old Google calendar sync and will be deprecated soon. + * + * @return self + */ + public function setGoogleCalendarEtag($google_calendar_etag): self + { + $this->container['google_calendar_etag'] = $google_calendar_etag; + + return $this; + } + + /** + * Gets calendar_sync_include_context + * + * @return string|null + */ + public function getCalendarSyncIncludeContext() + { + return $this->container['calendar_sync_include_context']; + } + + /** + * Sets calendar_sync_include_context + * + * @param string|null $calendar_sync_include_context For activities that sync to an external calendar, this setting indicates if the activity syncs with context (what are the deals, persons, organizations this activity is related to) + * + * @return self + */ + public function setCalendarSyncIncludeContext($calendar_sync_include_context): self + { + $this->container['calendar_sync_include_context'] = $calendar_sync_include_context; + + return $this; + } + + /** + * Gets source_timezone + * + * @return string|null + */ + public function getSourceTimezone() + { + return $this->container['source_timezone']; + } + + /** + * Sets source_timezone + * + * @param string|null $source_timezone The timezone the activity was created in an external calendar + * + * @return self + */ + public function setSourceTimezone($source_timezone): self + { + $this->container['source_timezone'] = $source_timezone; + + return $this; + } + + /** + * Gets rec_rule + * + * @return string|null + */ + public function getRecRule() + { + return $this->container['rec_rule']; + } + + /** + * Sets rec_rule + * + * @param string|null $rec_rule The rule for the recurrence of the activity. Is important for activities synced into Pipedrive from an external calendar. Example: \"RRULE:FREQ=WEEKLY;BYDAY=WE\" + * + * @return self + */ + public function setRecRule($rec_rule): self + { + $this->container['rec_rule'] = $rec_rule; + + return $this; + } + + /** + * Gets rec_rule_extension + * + * @return string|null + */ + public function getRecRuleExtension() + { + return $this->container['rec_rule_extension']; + } + + /** + * Sets rec_rule_extension + * + * @param string|null $rec_rule_extension Additional rules for the recurrence of the activity, extend the `rec_rule`. Is important for activities synced into Pipedrive from an external calendar. + * + * @return self + */ + public function setRecRuleExtension($rec_rule_extension): self + { + $this->container['rec_rule_extension'] = $rec_rule_extension; + + return $this; + } + + /** + * Gets rec_master_activity_id + * + * @return int|null + */ + public function getRecMasterActivityId() + { + return $this->container['rec_master_activity_id']; + } + + /** + * Sets rec_master_activity_id + * + * @param int|null $rec_master_activity_id The ID of parent activity for a recurrent activity if the current activity is an exception to recurrence rules + * + * @return self + */ + public function setRecMasterActivityId($rec_master_activity_id): self + { + $this->container['rec_master_activity_id'] = $rec_master_activity_id; + + return $this; + } + + /** + * Gets series + * + * @return object[]|null + */ + public function getSeries() + { + return $this->container['series']; + } + + /** + * Sets series + * + * @param object[]|null $series The list of recurring activity instances. It is in a structure as follows: `[{due_date: \"2020-06-24\", due_time: \"10:00:00\"}]` + * + * @return self + */ + public function setSeries($series): self + { + $this->container['series'] = $series; + + return $this; + } + + /** + * Gets created_by_user_id + * + * @return int|null + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param int|null $created_by_user_id The ID of the user who created the activity + * + * @return self + */ + public function setCreatedByUserId($created_by_user_id): self + { + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + + /** + * Gets location_subpremise + * + * @return string|null + */ + public function getLocationSubpremise() + { + return $this->container['location_subpremise']; + } + + /** + * Sets location_subpremise + * + * @param string|null $location_subpremise A subfield of the location field. Indicates apartment/suite number. + * + * @return self + */ + public function setLocationSubpremise($location_subpremise): self + { + $this->container['location_subpremise'] = $location_subpremise; + + return $this; + } + + /** + * Gets location_street_number + * + * @return string|null + */ + public function getLocationStreetNumber() + { + return $this->container['location_street_number']; + } + + /** + * Sets location_street_number + * + * @param string|null $location_street_number A subfield of the location field. Indicates house number. + * + * @return self + */ + public function setLocationStreetNumber($location_street_number): self + { + $this->container['location_street_number'] = $location_street_number; + + return $this; + } + + /** + * Gets location_route + * + * @return string|null + */ + public function getLocationRoute() + { + return $this->container['location_route']; + } + + /** + * Sets location_route + * + * @param string|null $location_route A subfield of the location field. Indicates street name. + * + * @return self + */ + public function setLocationRoute($location_route): self + { + $this->container['location_route'] = $location_route; + + return $this; + } + + /** + * Gets location_sublocality + * + * @return string|null + */ + public function getLocationSublocality() + { + return $this->container['location_sublocality']; + } + + /** + * Sets location_sublocality + * + * @param string|null $location_sublocality A subfield of the location field. Indicates district/sublocality. + * + * @return self + */ + public function setLocationSublocality($location_sublocality): self + { + $this->container['location_sublocality'] = $location_sublocality; + + return $this; + } + + /** + * Gets location_locality + * + * @return string|null + */ + public function getLocationLocality() + { + return $this->container['location_locality']; + } + + /** + * Sets location_locality + * + * @param string|null $location_locality A subfield of the location field. Indicates city/town/village/locality. + * + * @return self + */ + public function setLocationLocality($location_locality): self + { + $this->container['location_locality'] = $location_locality; + + return $this; + } + + /** + * Gets location_admin_area_level_1 + * + * @return string|null + */ + public function getLocationAdminAreaLevel1() + { + return $this->container['location_admin_area_level_1']; + } + + /** + * Sets location_admin_area_level_1 + * + * @param string|null $location_admin_area_level_1 A subfield of the location field. Indicates state/county. + * + * @return self + */ + public function setLocationAdminAreaLevel1($location_admin_area_level_1): self + { + $this->container['location_admin_area_level_1'] = $location_admin_area_level_1; + + return $this; + } + + /** + * Gets location_admin_area_level_2 + * + * @return string|null + */ + public function getLocationAdminAreaLevel2() + { + return $this->container['location_admin_area_level_2']; + } + + /** + * Sets location_admin_area_level_2 + * + * @param string|null $location_admin_area_level_2 A subfield of the location field. Indicates region. + * + * @return self + */ + public function setLocationAdminAreaLevel2($location_admin_area_level_2): self + { + $this->container['location_admin_area_level_2'] = $location_admin_area_level_2; + + return $this; + } + + /** + * Gets location_country + * + * @return string|null + */ + public function getLocationCountry() + { + return $this->container['location_country']; + } + + /** + * Sets location_country + * + * @param string|null $location_country A subfield of the location field. Indicates country. + * + * @return self + */ + public function setLocationCountry($location_country): self + { + $this->container['location_country'] = $location_country; + + return $this; + } + + /** + * Gets location_postal_code + * + * @return string|null + */ + public function getLocationPostalCode() + { + return $this->container['location_postal_code']; + } + + /** + * Sets location_postal_code + * + * @param string|null $location_postal_code A subfield of the location field. Indicates ZIP/postal code. + * + * @return self + */ + public function setLocationPostalCode($location_postal_code): self + { + $this->container['location_postal_code'] = $location_postal_code; + + return $this; + } + + /** + * Gets location_formatted_address + * + * @return string|null + */ + public function getLocationFormattedAddress() + { + return $this->container['location_formatted_address']; + } + + /** + * Sets location_formatted_address + * + * @param string|null $location_formatted_address A subfield of the location field. Indicates full/combined address. + * + * @return self + */ + public function setLocationFormattedAddress($location_formatted_address): self + { + $this->container['location_formatted_address'] = $location_formatted_address; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization this activity is associated with + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person this activity is associated with + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets deal_title + * + * @return string|null + */ + public function getDealTitle() + { + return $this->container['deal_title']; + } + + /** + * Sets deal_title + * + * @param string|null $deal_title The name of the deal this activity is associated with + * + * @return self + */ + public function setDealTitle($deal_title): self + { + $this->container['deal_title'] = $deal_title; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the user this activity is owned by + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets person_dropbox_bcc + * + * @return string|null + */ + public function getPersonDropboxBcc() + { + return $this->container['person_dropbox_bcc']; + } + + /** + * Sets person_dropbox_bcc + * + * @param string|null $person_dropbox_bcc The BCC email address of the person + * + * @return self + */ + public function setPersonDropboxBcc($person_dropbox_bcc): self + { + $this->container['person_dropbox_bcc'] = $person_dropbox_bcc; + + return $this; + } + + /** + * Gets deal_dropbox_bcc + * + * @return string|null + */ + public function getDealDropboxBcc() + { + return $this->container['deal_dropbox_bcc']; + } + + /** + * Sets deal_dropbox_bcc + * + * @param string|null $deal_dropbox_bcc The BCC email address of the deal + * + * @return self + */ + public function setDealDropboxBcc($deal_dropbox_bcc): self + { + $this->container['deal_dropbox_bcc'] = $deal_dropbox_bcc; + + return $this; + } + + /** + * Gets assigned_to_user_id + * + * @return int|null + */ + public function getAssignedToUserId() + { + return $this->container['assigned_to_user_id']; + } + + /** + * Sets assigned_to_user_id + * + * @param int|null $assigned_to_user_id The ID of the user to whom the activity is assigned to. Equal to `user_id`. + * + * @return self + */ + public function setAssignedToUserId($assigned_to_user_id): self + { + $this->container['assigned_to_user_id'] = $assigned_to_user_id; + + return $this; + } + + /** + * Gets file + * + * @return object|null + */ + public function getFile() + { + return $this->container['file']; + } + + /** + * Sets file + * + * @param object|null $file The file that is attached to this activity. For example, this can be a reference to an audio note file generated with Pipedrive mobile app. + * + * @return self + */ + public function setFile($file): self + { + $this->container['file'] = $file; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeBulkDeleteResponse.php b/lib/Model/ActivityTypeBulkDeleteResponse.php new file mode 100644 index 00000000..d33ffda0 --- /dev/null +++ b/lib/Model/ActivityTypeBulkDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeBulkDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeBulkDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeBulkDeleteResponseAllOf.php b/lib/Model/ActivityTypeBulkDeleteResponseAllOf.php new file mode 100644 index 00000000..a975f87c --- /dev/null +++ b/lib/Model/ActivityTypeBulkDeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeBulkDeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeBulkDeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeBulkDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeBulkDeleteResponseAllOfData.php b/lib/Model/ActivityTypeBulkDeleteResponseAllOfData.php new file mode 100644 index 00000000..ad89de01 --- /dev/null +++ b/lib/Model/ActivityTypeBulkDeleteResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeBulkDeleteResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeBulkDeleteResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The IDs of the deleted activity types + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeCreateRequest.php b/lib/Model/ActivityTypeCreateRequest.php new file mode 100644 index 00000000..f680963d --- /dev/null +++ b/lib/Model/ActivityTypeCreateRequest.php @@ -0,0 +1,408 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'icon_key' => '\Pipedrive\Model\IconKey', + 'color' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'icon_key' => null, + 'color' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'icon_key' => 'icon_key', + 'color' => 'color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'icon_key' => 'setIconKey', + 'color' => 'setColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'icon_key' => 'getIconKey', + 'color' => 'getColor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['icon_key'] = $data['icon_key'] ?? null; + $this->container['color'] = $data['color'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['icon_key'] === null) { + $invalidProperties[] = "'icon_key' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the activity type + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets icon_key + * + * @return \Pipedrive\Model\IconKey + */ + public function getIconKey() + { + return $this->container['icon_key']; + } + + /** + * Sets icon_key + * + * @param \Pipedrive\Model\IconKey $icon_key icon_key + * + * @return self + */ + public function setIconKey($icon_key): self + { + $this->container['icon_key'] = $icon_key; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) + * + * @return self + */ + public function setColor($color): self + { + $this->container['color'] = $color; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeCreateUpdateDeleteResponse.php b/lib/Model/ActivityTypeCreateUpdateDeleteResponse.php new file mode 100644 index 00000000..2dee6c68 --- /dev/null +++ b/lib/Model/ActivityTypeCreateUpdateDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeCreateUpdateDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeCreateUpdateDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityTypeObjectResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeObjectResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeObjectResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.php b/lib/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.php new file mode 100644 index 00000000..cf6b6b7b --- /dev/null +++ b/lib/Model/ActivityTypeCreateUpdateDeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeCreateUpdateDeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeCreateUpdateDeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ActivityTypeObjectResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeObjectResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeObjectResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeListResponse.php b/lib/Model/ActivityTypeListResponse.php new file mode 100644 index 00000000..0c018191 --- /dev/null +++ b/lib/Model/ActivityTypeListResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeListResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityTypeObjectResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeObjectResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeObjectResponse[]|null $data The array of activity types + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeListResponseAllOf.php b/lib/Model/ActivityTypeListResponseAllOf.php new file mode 100644 index 00000000..633455f9 --- /dev/null +++ b/lib/Model/ActivityTypeListResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeListResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeListResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ActivityTypeObjectResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeObjectResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeObjectResponse[]|null $data The array of activity types + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeObjectResponse.php b/lib/Model/ActivityTypeObjectResponse.php new file mode 100644 index 00000000..8ccf30bd --- /dev/null +++ b/lib/Model/ActivityTypeObjectResponse.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeObjectResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeObjectResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'icon_key' => '\Pipedrive\Model\IconKey', + 'color' => 'string', + 'order_nr' => 'int', + 'key_string' => 'string', + 'active_flag' => 'bool', + 'is_custom_flag' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'icon_key' => null, + 'color' => null, + 'order_nr' => null, + 'key_string' => null, + 'active_flag' => null, + 'is_custom_flag' => null, + 'add_time' => 'datetime', + 'update_time' => 'datetime' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'icon_key' => 'icon_key', + 'color' => 'color', + 'order_nr' => 'order_nr', + 'key_string' => 'key_string', + 'active_flag' => 'active_flag', + 'is_custom_flag' => 'is_custom_flag', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'icon_key' => 'setIconKey', + 'color' => 'setColor', + 'order_nr' => 'setOrderNr', + 'key_string' => 'setKeyString', + 'active_flag' => 'setActiveFlag', + 'is_custom_flag' => 'setIsCustomFlag', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'icon_key' => 'getIconKey', + 'color' => 'getColor', + 'order_nr' => 'getOrderNr', + 'key_string' => 'getKeyString', + 'active_flag' => 'getActiveFlag', + 'is_custom_flag' => 'getIsCustomFlag', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['icon_key'] = $data['icon_key'] ?? null; + $this->container['color'] = $data['color'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['key_string'] = $data['key_string'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['is_custom_flag'] = $data['is_custom_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the activity type + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the activity type + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets icon_key + * + * @return \Pipedrive\Model\IconKey|null + */ + public function getIconKey() + { + return $this->container['icon_key']; + } + + /** + * Sets icon_key + * + * @param \Pipedrive\Model\IconKey|null $icon_key icon_key + * + * @return self + */ + public function setIconKey($icon_key): self + { + $this->container['icon_key'] = $icon_key; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) + * + * @return self + */ + public function setColor($color): self + { + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr An order number for the activity type. Order numbers should be used to order the types in the activity type selections. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets key_string + * + * @return string|null + */ + public function getKeyString() + { + return $this->container['key_string']; + } + + /** + * Sets key_string + * + * @param string|null $key_string A string that is generated by the API based on the given name of the activity type upon creation + * + * @return self + */ + public function setKeyString($key_string): self + { + $this->container['key_string'] = $key_string; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag The active flag of the activity type + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets is_custom_flag + * + * @return bool|null + */ + public function getIsCustomFlag() + { + return $this->container['is_custom_flag']; + } + + /** + * Sets is_custom_flag + * + * @param bool|null $is_custom_flag Whether the activity type is a custom one or not + * + * @return self + */ + public function setIsCustomFlag($is_custom_flag): self + { + $this->container['is_custom_flag'] = $is_custom_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation time of the activity type + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the activity type + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ActivityTypeUpdateRequest.php b/lib/Model/ActivityTypeUpdateRequest.php new file mode 100644 index 00000000..e2f8215b --- /dev/null +++ b/lib/Model/ActivityTypeUpdateRequest.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ActivityTypeUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ActivityTypeUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'icon_key' => '\Pipedrive\Model\IconKey', + 'color' => 'string', + 'order_nr' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'icon_key' => null, + 'color' => null, + 'order_nr' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'icon_key' => 'icon_key', + 'color' => 'color', + 'order_nr' => 'order_nr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'icon_key' => 'setIconKey', + 'color' => 'setColor', + 'order_nr' => 'setOrderNr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'icon_key' => 'getIconKey', + 'color' => 'getColor', + 'order_nr' => 'getOrderNr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['icon_key'] = $data['icon_key'] ?? null; + $this->container['color'] = $data['color'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the activity type + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets icon_key + * + * @return \Pipedrive\Model\IconKey|null + */ + public function getIconKey() + { + return $this->container['icon_key']; + } + + /** + * Sets icon_key + * + * @param \Pipedrive\Model\IconKey|null $icon_key icon_key + * + * @return self + */ + public function setIconKey($icon_key): self + { + $this->container['icon_key'] = $icon_key; + + return $this; + } + + /** + * Gets color + * + * @return string|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param string|null $color A designated color for the activity type in 6-character HEX format (e.g. `FFFFFF` for white, `000000` for black) + * + * @return self + */ + public function setColor($color): self + { + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr An order number for this activity type. Order numbers should be used to order the types in the activity type selections. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddActivityResponse200.php b/lib/Model/AddActivityResponse200.php new file mode 100644 index 00000000..f0baea06 --- /dev/null +++ b/lib/Model/AddActivityResponse200.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddActivityResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addActivityResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityResponseObject', + 'additional_data' => '\Pipedrive\Model\ActivityRecordAdditionalData', + 'related_objects' => '\Pipedrive\Model\AddActivityResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ActivityRecordAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ActivityRecordAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AddActivityResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AddActivityResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddActivityResponse200RelatedObjects.php b/lib/Model/AddActivityResponse200RelatedObjects.php new file mode 100644 index 00000000..1699dcb3 --- /dev/null +++ b/lib/Model/AddActivityResponse200RelatedObjects.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddActivityResponse200RelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addActivityResponse200_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user' => '\Pipedrive\Model\RelatedUserData', + 'deal' => '\Pipedrive\Model\RelatedDealData', + 'person' => '\Pipedrive\Model\RelatedPersonDataWithActiveFlag', + 'organization' => '\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user' => null, + 'deal' => null, + 'person' => null, + 'organization' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user' => 'user', + 'deal' => 'deal', + 'person' => 'person', + 'organization' => 'organization' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user' => 'setUser', + 'deal' => 'setDeal', + 'person' => 'setPerson', + 'organization' => 'setOrganization' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user' => 'getUser', + 'deal' => 'getDeal', + 'person' => 'getPerson', + 'organization' => 'getOrganization' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user'] = $data['user'] ?? null; + $this->container['deal'] = $data['deal'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets deal + * + * @return \Pipedrive\Model\RelatedDealData|null + */ + public function getDeal() + { + return $this->container['deal']; + } + + /** + * Sets deal + * + * @param \Pipedrive\Model\RelatedDealData|null $deal deal + * + * @return self + */ + public function setDeal($deal): self + { + $this->container['deal'] = $deal; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddDealFollowerRequest.php b/lib/Model/AddDealFollowerRequest.php new file mode 100644 index 00000000..7ac85773 --- /dev/null +++ b/lib/Model/AddDealFollowerRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddDealFollowerRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addDealFollowerRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' 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 user_id + * + * @return int + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddDealParticipantRequest.php b/lib/Model/AddDealParticipantRequest.php new file mode 100644 index 00000000..6f8543a0 --- /dev/null +++ b/lib/Model/AddDealParticipantRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddDealParticipantRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addDealParticipantRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'person_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'person_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'person_id' => 'person_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'person_id' => 'setPersonId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'person_id' => 'getPersonId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['person_id'] = $data['person_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['person_id'] === null) { + $invalidProperties[] = "'person_id' 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 person_id + * + * @return int + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int $person_id The ID of the person + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddFile.php b/lib/Model/AddFile.php new file mode 100644 index 00000000..904e37a6 --- /dev/null +++ b/lib/Model/AddFile.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddFile implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddFilterRequest.php b/lib/Model/AddFilterRequest.php new file mode 100644 index 00000000..cbdc469e --- /dev/null +++ b/lib/Model/AddFilterRequest.php @@ -0,0 +1,411 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddFilterRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addFilterRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'conditions' => 'object', + 'type' => 'FilterType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'conditions' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'conditions' => 'conditions', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'conditions' => 'setConditions', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'conditions' => 'getConditions', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['conditions'] = $data['conditions'] ?? null; + $this->container['type'] = $data['type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['conditions'] === null) { + $invalidProperties[] = "'conditions' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the filter + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets conditions + * + * @return object + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param object $conditions The conditions of the filter as a JSON object. Please note that a maximum of 16 conditions is allowed per filter and `date` values must be supplied in the `YYYY-MM-DD` format. It requires a minimum structure as follows: `{\"glue\":\"and\",\"conditions\":[{\"glue\":\"and\",\"conditions\": [CONDITION_OBJECTS]},{\"glue\":\"or\",\"conditions\":[CONDITION_OBJECTS]}]}`. Replace `CONDITION_OBJECTS` with JSON objects of the following structure: `{\"object\":\"\",\"field_id\":\"\", \"operator\":\"\",\"value\":\"\", \"extra_value\":\"\"}` or leave the array empty. Depending on the object type you should use another API endpoint to get `field_id`. There are five types of objects you can choose from: `\"person\"`, `\"deal\"`, `\"organization\"`, `\"product\"`, `\"activity\"` and you can use these types of operators depending on what type of a field you have: `\"IS NOT NULL\"`, `\"IS NULL\"`, `\"<=\"`, `\">=\"`, `\"<\"`, `\">\"`, `\"!=\"`, `\"=\"`, `\"LIKE '$%'\"`, `\"LIKE '%$%'\"`, `\"NOT LIKE '$%'\"`. To get a better understanding of how filters work try creating them directly from the Pipedrive application. + * + * @return self + */ + public function setConditions($conditions): self + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets type + * + * @return FilterType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param FilterType $type The type of filter to create + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddFollowerToPersonResponse.php b/lib/Model/AddFollowerToPersonResponse.php new file mode 100644 index 00000000..d4ca1903 --- /dev/null +++ b/lib/Model/AddFollowerToPersonResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddFollowerToPersonResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddFollowerToPersonResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\AddFollowerToPersonResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\AddFollowerToPersonResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\AddFollowerToPersonResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddFollowerToPersonResponseAllOf.php b/lib/Model/AddFollowerToPersonResponseAllOf.php new file mode 100644 index 00000000..f2543e42 --- /dev/null +++ b/lib/Model/AddFollowerToPersonResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddFollowerToPersonResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddFollowerToPersonResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\AddFollowerToPersonResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\AddFollowerToPersonResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\AddFollowerToPersonResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddFollowerToPersonResponseAllOfData.php b/lib/Model/AddFollowerToPersonResponseAllOfData.php new file mode 100644 index 00000000..6553b544 --- /dev/null +++ b/lib/Model/AddFollowerToPersonResponseAllOfData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddFollowerToPersonResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddFollowerToPersonResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'id' => 'int', + 'person_id' => 'int', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'id' => null, + 'person_id' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'id' => 'id', + 'person_id' => 'person_id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'id' => 'setId', + 'person_id' => 'setPersonId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'id' => 'getId', + 'person_id' => 'getPersonId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user who was added as a follower to a person + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person to whom the follower was added + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the follower was added to a person. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddLeadLabelRequest.php b/lib/Model/AddLeadLabelRequest.php new file mode 100644 index 00000000..9fb9aeef --- /dev/null +++ b/lib/Model/AddLeadLabelRequest.php @@ -0,0 +1,378 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddLeadLabelRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addLeadLabelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'color' => '\Pipedrive\Model\LeadLabelColor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'color' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'color' => 'color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'color' => 'setColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'color' => 'getColor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['color'] = $data['color'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['color'] === null) { + $invalidProperties[] = "'color' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the lead label + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets color + * + * @return \Pipedrive\Model\LeadLabelColor + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param \Pipedrive\Model\LeadLabelColor $color color + * + * @return self + */ + public function setColor($color): self + { + $this->container['color'] = $color; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddLeadRequest.php b/lib/Model/AddLeadRequest.php new file mode 100644 index 00000000..d523d38f --- /dev/null +++ b/lib/Model/AddLeadRequest.php @@ -0,0 +1,585 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddLeadRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addLeadRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'owner_id' => 'int', + 'label_ids' => 'string[]', + 'person_id' => 'int', + 'organization_id' => 'int', + 'value' => '\Pipedrive\Model\LeadValue', + 'expected_close_date' => '\DateTime', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'was_seen' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'owner_id' => null, + 'label_ids' => 'uuid', + 'person_id' => null, + 'organization_id' => null, + 'value' => null, + 'expected_close_date' => 'date', + 'visible_to' => null, + 'was_seen' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'owner_id' => 'owner_id', + 'label_ids' => 'label_ids', + 'person_id' => 'person_id', + 'organization_id' => 'organization_id', + 'value' => 'value', + 'expected_close_date' => 'expected_close_date', + 'visible_to' => 'visible_to', + 'was_seen' => 'was_seen' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'owner_id' => 'setOwnerId', + 'label_ids' => 'setLabelIds', + 'person_id' => 'setPersonId', + 'organization_id' => 'setOrganizationId', + 'value' => 'setValue', + 'expected_close_date' => 'setExpectedCloseDate', + 'visible_to' => 'setVisibleTo', + 'was_seen' => 'setWasSeen' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'owner_id' => 'getOwnerId', + 'label_ids' => 'getLabelIds', + 'person_id' => 'getPersonId', + 'organization_id' => 'getOrganizationId', + 'value' => 'getValue', + 'expected_close_date' => 'getExpectedCloseDate', + 'visible_to' => 'getVisibleTo', + 'was_seen' => 'getWasSeen' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['organization_id'] = $data['organization_id'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['was_seen'] = $data['was_seen'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' 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 title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The name of the lead + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets label_ids + * + * @return string[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param string[]|null $label_ids The IDs of the lead labels which will be associated with the lead + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `organization_id` is specified. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets organization_id + * + * @return int|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param int|null $organization_id The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. + * + * @return self + */ + public function setOrganizationId($organization_id): self + { + $this->container['organization_id'] = $organization_id; + + return $this; + } + + /** + * Gets value + * + * @return \Pipedrive\Model\LeadValue|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Pipedrive\Model\LeadValue|null $value value + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD. + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets was_seen + * + * @return bool|null + */ + public function getWasSeen() + { + return $this->container['was_seen']; + } + + /** + * Sets was_seen + * + * @param bool|null $was_seen A flag indicating whether the lead was seen by someone in the Pipedrive UI + * + * @return self + */ + public function setWasSeen($was_seen): self + { + $this->container['was_seen'] = $was_seen; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddNewPipeline.php b/lib/Model/AddNewPipeline.php new file mode 100644 index 00000000..eb8434e6 --- /dev/null +++ b/lib/Model/AddNewPipeline.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddNewPipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddNewPipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BasePipeline' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BasePipeline|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BasePipeline|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddNewPipelineAllOf.php b/lib/Model/AddNewPipelineAllOf.php new file mode 100644 index 00000000..aa314249 --- /dev/null +++ b/lib/Model/AddNewPipelineAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddNewPipelineAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddNewPipeline_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BasePipeline' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BasePipeline|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BasePipeline|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddNoteRequest.php b/lib/Model/AddNoteRequest.php new file mode 100644 index 00000000..0defc411 --- /dev/null +++ b/lib/Model/AddNoteRequest.php @@ -0,0 +1,645 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddNoteRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddNoteRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'content' => 'string', + 'lead_id' => 'string', + 'deal_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'user_id' => 'int', + 'add_time' => 'string', + 'pinned_to_lead_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_deal_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_organization_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_person_flag' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null, + 'lead_id' => 'uuid', + 'deal_id' => null, + 'person_id' => null, + 'org_id' => null, + 'user_id' => null, + 'add_time' => null, + 'pinned_to_lead_flag' => null, + 'pinned_to_deal_flag' => null, + 'pinned_to_organization_flag' => null, + 'pinned_to_person_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'lead_id' => 'lead_id', + 'deal_id' => 'deal_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'user_id' => 'user_id', + 'add_time' => 'add_time', + 'pinned_to_lead_flag' => 'pinned_to_lead_flag', + 'pinned_to_deal_flag' => 'pinned_to_deal_flag', + 'pinned_to_organization_flag' => 'pinned_to_organization_flag', + 'pinned_to_person_flag' => 'pinned_to_person_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'lead_id' => 'setLeadId', + 'deal_id' => 'setDealId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'user_id' => 'setUserId', + 'add_time' => 'setAddTime', + 'pinned_to_lead_flag' => 'setPinnedToLeadFlag', + 'pinned_to_deal_flag' => 'setPinnedToDealFlag', + 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'setPinnedToPersonFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'lead_id' => 'getLeadId', + 'deal_id' => 'getDealId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'user_id' => 'getUserId', + 'add_time' => 'getAddTime', + 'pinned_to_lead_flag' => 'getPinnedToLeadFlag', + 'pinned_to_deal_flag' => 'getPinnedToDealFlag', + 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'getPinnedToPersonFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = $data['content'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['pinned_to_lead_flag'] = $data['pinned_to_lead_flag'] ?? null; + $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; + $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; + $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' 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 content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content The content of the note in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user who will be marked as the author of the note. Only an admin can change the author. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets pinned_to_lead_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToLeadFlag() + { + return $this->container['pinned_to_lead_flag']; + } + + /** + * Sets pinned_to_lead_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (`lead_id` is also required) + * + * @return self + */ + public function setPinnedToLeadFlag($pinned_to_lead_flag): self + { + $this->container['pinned_to_lead_flag'] = $pinned_to_lead_flag; + + return $this; + } + + /** + * Gets pinned_to_deal_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToDealFlag() + { + return $this->container['pinned_to_deal_flag']; + } + + /** + * Sets pinned_to_deal_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (`deal_id` is also required) + * + * @return self + */ + public function setPinnedToDealFlag($pinned_to_deal_flag): self + { + $this->container['pinned_to_deal_flag'] = $pinned_to_deal_flag; + + return $this; + } + + /** + * Gets pinned_to_organization_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToOrganizationFlag() + { + return $this->container['pinned_to_organization_flag']; + } + + /** + * Sets pinned_to_organization_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (`org_id` is also required) + * + * @return self + */ + public function setPinnedToOrganizationFlag($pinned_to_organization_flag): self + { + $this->container['pinned_to_organization_flag'] = $pinned_to_organization_flag; + + return $this; + } + + /** + * Gets pinned_to_person_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToPersonFlag() + { + return $this->container['pinned_to_person_flag']; + } + + /** + * Sets pinned_to_person_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (`person_id` is also required) + * + * @return self + */ + public function setPinnedToPersonFlag($pinned_to_person_flag): self + { + $this->container['pinned_to_person_flag'] = $pinned_to_person_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddNoteRequestAllOf.php b/lib/Model/AddNoteRequestAllOf.php new file mode 100644 index 00000000..029d8d86 --- /dev/null +++ b/lib/Model/AddNoteRequestAllOf.php @@ -0,0 +1,465 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddNoteRequestAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddNoteRequest_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'content' => 'string', + 'lead_id' => 'string', + 'deal_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null, + 'lead_id' => 'uuid', + 'deal_id' => null, + 'person_id' => null, + 'org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'lead_id' => 'lead_id', + 'deal_id' => 'deal_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'lead_id' => 'setLeadId', + 'deal_id' => 'setDealId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'lead_id' => 'getLeadId', + 'deal_id' => 'getDealId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = $data['content'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' 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 content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content The content of the note in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead the note will be attached to. This property is required unless one of (`deal_id/person_id/org_id`) is specified. + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal the note will be attached to. This property is required unless one of (`lead_id/person_id/org_id`) is specified. + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this note will be attached to. This property is required unless one of (`deal_id/lead_id/org_id`) is specified. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this note will be attached to. This property is required unless one of (`deal_id/lead_id/person_id`) is specified. + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddOrUpdateGoalResponse200.php b/lib/Model/AddOrUpdateGoalResponse200.php new file mode 100644 index 00000000..2eecd3b9 --- /dev/null +++ b/lib/Model/AddOrUpdateGoalResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddOrUpdateGoalResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addOrUpdateGoalResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PostGoalResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PostGoalResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostGoalResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddOrUpdateLeadLabelResponse200.php b/lib/Model/AddOrUpdateLeadLabelResponse200.php new file mode 100644 index 00000000..a8a82a56 --- /dev/null +++ b/lib/Model/AddOrUpdateLeadLabelResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddOrUpdateLeadLabelResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addOrUpdateLeadLabelResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\LeadLabelResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadLabelResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadLabelResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddOrUpdateRoleSettingRequest.php b/lib/Model/AddOrUpdateRoleSettingRequest.php new file mode 100644 index 00000000..810b7e07 --- /dev/null +++ b/lib/Model/AddOrUpdateRoleSettingRequest.php @@ -0,0 +1,460 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddOrUpdateRoleSettingRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addOrUpdateRoleSettingRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'setting_key' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'setting_key' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'setting_key' => 'setting_key', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'setting_key' => 'setSettingKey', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'setting_key' => 'getSettingKey', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const SETTING_KEY_DEAL_DEFAULT_VISIBILITY = 'deal_default_visibility'; + const SETTING_KEY_LEAD_DEFAULT_VISIBILITY = 'lead_default_visibility'; + const SETTING_KEY_ORG_DEFAULT_VISIBILITY = 'org_default_visibility'; + const SETTING_KEY_PERSON_DEFAULT_VISIBILITY = 'person_default_visibility'; + const SETTING_KEY_PRODUCT_DEFAULT_VISIBILITY = 'product_default_visibility'; + const VALUE_1 = 1; + const VALUE_3 = 3; + const VALUE_5 = 5; + const VALUE_7 = 7; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getSettingKeyAllowableValues(): array + { + return [ + self::SETTING_KEY_DEAL_DEFAULT_VISIBILITY, + self::SETTING_KEY_LEAD_DEFAULT_VISIBILITY, + self::SETTING_KEY_ORG_DEFAULT_VISIBILITY, + self::SETTING_KEY_PERSON_DEFAULT_VISIBILITY, + self::SETTING_KEY_PRODUCT_DEFAULT_VISIBILITY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getValueAllowableValues(): array + { + return [ + self::VALUE_1, + self::VALUE_3, + self::VALUE_5, + self::VALUE_7, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['setting_key'] = $data['setting_key'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['setting_key'] === null) { + $invalidProperties[] = "'setting_key' can't be null"; + } + $allowedValues = $this->getSettingKeyAllowableValues(); + if (!is_null($this->container['setting_key']) && !in_array($this->container['setting_key'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'setting_key', must be one of '%s'", + $this->container['setting_key'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets setting_key + * + * @return string + */ + public function getSettingKey() + { + return $this->container['setting_key']; + } + + /** + * Sets setting_key + * + * @param string $setting_key setting_key + * + * @return self + */ + public function setSettingKey($setting_key): self + { + $allowedValues = $this->getSettingKeyAllowableValues(); + if (!in_array($setting_key, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'setting_key', must be one of '%s'", + $setting_key, + implode("', '", $allowedValues) + ) + ); + } + $this->container['setting_key'] = $setting_key; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value Possible values for the `default_visibility` setting depending on the subscription plan:
Essential / Advanced plan
ValueDescription
`1`Owner & Followers
`3`Entire company

Professional / Enterprise plan
ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company

Read more about visibility groups here. + * + * @return self + */ + public function setValue($value): self + { + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddOrganizationFollowerRequest.php b/lib/Model/AddOrganizationFollowerRequest.php new file mode 100644 index 00000000..14621e05 --- /dev/null +++ b/lib/Model/AddOrganizationFollowerRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddOrganizationFollowerRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addOrganizationFollowerRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' 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 user_id + * + * @return int + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddOrganizationRelationshipRequest.php b/lib/Model/AddOrganizationRelationshipRequest.php new file mode 100644 index 00000000..0cee6dc1 --- /dev/null +++ b/lib/Model/AddOrganizationRelationshipRequest.php @@ -0,0 +1,477 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddOrganizationRelationshipRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddOrganizationRelationshipRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'org_id' => 'int', + 'type' => 'string', + 'rel_owner_org_id' => 'int', + 'rel_linked_org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'org_id' => null, + 'type' => null, + 'rel_owner_org_id' => null, + 'rel_linked_org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'org_id' => 'org_id', + 'type' => 'type', + 'rel_owner_org_id' => 'rel_owner_org_id', + 'rel_linked_org_id' => 'rel_linked_org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'org_id' => 'setOrgId', + 'type' => 'setType', + 'rel_owner_org_id' => 'setRelOwnerOrgId', + 'rel_linked_org_id' => 'setRelLinkedOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'org_id' => 'getOrgId', + 'type' => 'getType', + 'rel_owner_org_id' => 'getRelOwnerOrgId', + 'rel_linked_org_id' => 'getRelLinkedOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const TYPE_PARENT = 'parent'; + const TYPE_RELATED = 'related'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getTypeAllowableValues(): array + { + return [ + self::TYPE_PARENT, + self::TYPE_RELATED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['rel_owner_org_id'] = $data['rel_owner_org_id'] ?? null; + $this->container['rel_linked_org_id'] = $data['rel_linked_org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['rel_owner_org_id'] === null) { + $invalidProperties[] = "'rel_owner_org_id' can't be null"; + } + if ($this->container['rel_linked_org_id'] === null) { + $invalidProperties[] = "'rel_linked_org_id' 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 org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the base organization for the returned calculated values + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of organization relationship + * + * @return self + */ + public function setType($type): self + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rel_owner_org_id + * + * @return int + */ + public function getRelOwnerOrgId() + { + return $this->container['rel_owner_org_id']; + } + + /** + * Sets rel_owner_org_id + * + * @param int $rel_owner_org_id The owner of the relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter. + * + * @return self + */ + public function setRelOwnerOrgId($rel_owner_org_id): self + { + $this->container['rel_owner_org_id'] = $rel_owner_org_id; + + return $this; + } + + /** + * Gets rel_linked_org_id + * + * @return int + */ + public function getRelLinkedOrgId() + { + return $this->container['rel_linked_org_id']; + } + + /** + * Sets rel_linked_org_id + * + * @param int $rel_linked_org_id The linked organization in the relationship. If type is `parent`, then the linked organization is the daughter. + * + * @return self + */ + public function setRelLinkedOrgId($rel_linked_org_id): self + { + $this->container['rel_linked_org_id'] = $rel_linked_org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddPersonFollowerRequest.php b/lib/Model/AddPersonFollowerRequest.php new file mode 100644 index 00000000..45d2bae5 --- /dev/null +++ b/lib/Model/AddPersonFollowerRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddPersonFollowerRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addPersonFollowerRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' 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 user_id + * + * @return int + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddPersonPictureResponse.php b/lib/Model/AddPersonPictureResponse.php new file mode 100644 index 00000000..a4386355 --- /dev/null +++ b/lib/Model/AddPersonPictureResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddPersonPictureResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddPersonPictureResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\RelatedPictureData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\RelatedPictureData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RelatedPictureData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddPersonPictureResponseAllOf.php b/lib/Model/AddPersonPictureResponseAllOf.php new file mode 100644 index 00000000..5be70f22 --- /dev/null +++ b/lib/Model/AddPersonPictureResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddPersonPictureResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddPersonPictureResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\RelatedPictureData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\RelatedPictureData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RelatedPictureData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddPersonResponse.php b/lib/Model/AddPersonResponse.php new file mode 100644 index 00000000..12a95407 --- /dev/null +++ b/lib/Model/AddPersonResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddPersonResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddPersonResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonItem', + 'related_objects' => '\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddPersonResponseAllOf.php b/lib/Model/AddPersonResponseAllOf.php new file mode 100644 index 00000000..730d7dc0 --- /dev/null +++ b/lib/Model/AddPersonResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddPersonResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddPersonResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PersonItem', + 'related_objects' => '\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddProductAttachmentDetails.php b/lib/Model/AddProductAttachmentDetails.php new file mode 100644 index 00000000..2421d8fe --- /dev/null +++ b/lib/Model/AddProductAttachmentDetails.php @@ -0,0 +1,951 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddProductAttachmentDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddProductAttachmentDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'product_id' => 'int', + 'item_price' => 'float', + 'quantity' => 'int', + 'discount_percentage' => 'float', + 'duration' => 'float', + 'duration_unit' => 'string', + 'product_variation_id' => 'int', + 'comments' => 'string', + 'tax' => 'float', + 'enabled_flag' => 'bool', + 'id' => 'int', + 'company_id' => 'int', + 'deal_id' => 'int', + 'sum_no_discount' => 'float', + 'sum' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'last_edit' => 'string', + 'active_flag' => 'bool', + 'name' => 'string', + 'product_attachment_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'item_price' => null, + 'quantity' => null, + 'discount_percentage' => null, + 'duration' => null, + 'duration_unit' => null, + 'product_variation_id' => null, + 'comments' => null, + 'tax' => null, + 'enabled_flag' => null, + 'id' => null, + 'company_id' => null, + 'deal_id' => null, + 'sum_no_discount' => null, + 'sum' => null, + 'currency' => null, + 'add_time' => null, + 'last_edit' => null, + 'active_flag' => null, + 'name' => null, + 'product_attachment_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'item_price' => 'item_price', + 'quantity' => 'quantity', + 'discount_percentage' => 'discount_percentage', + 'duration' => 'duration', + 'duration_unit' => 'duration_unit', + 'product_variation_id' => 'product_variation_id', + 'comments' => 'comments', + 'tax' => 'tax', + 'enabled_flag' => 'enabled_flag', + 'id' => 'id', + 'company_id' => 'company_id', + 'deal_id' => 'deal_id', + 'sum_no_discount' => 'sum_no_discount', + 'sum' => 'sum', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'last_edit' => 'last_edit', + 'active_flag' => 'active_flag', + 'name' => 'name', + 'product_attachment_id' => 'product_attachment_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'item_price' => 'setItemPrice', + 'quantity' => 'setQuantity', + 'discount_percentage' => 'setDiscountPercentage', + 'duration' => 'setDuration', + 'duration_unit' => 'setDurationUnit', + 'product_variation_id' => 'setProductVariationId', + 'comments' => 'setComments', + 'tax' => 'setTax', + 'enabled_flag' => 'setEnabledFlag', + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'deal_id' => 'setDealId', + 'sum_no_discount' => 'setSumNoDiscount', + 'sum' => 'setSum', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'last_edit' => 'setLastEdit', + 'active_flag' => 'setActiveFlag', + 'name' => 'setName', + 'product_attachment_id' => 'setProductAttachmentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'item_price' => 'getItemPrice', + 'quantity' => 'getQuantity', + 'discount_percentage' => 'getDiscountPercentage', + 'duration' => 'getDuration', + 'duration_unit' => 'getDurationUnit', + 'product_variation_id' => 'getProductVariationId', + 'comments' => 'getComments', + 'tax' => 'getTax', + 'enabled_flag' => 'getEnabledFlag', + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'deal_id' => 'getDealId', + 'sum_no_discount' => 'getSumNoDiscount', + 'sum' => 'getSum', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'last_edit' => 'getLastEdit', + 'active_flag' => 'getActiveFlag', + 'name' => 'getName', + 'product_attachment_id' => 'getProductAttachmentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['item_price'] = $data['item_price'] ?? null; + $this->container['quantity'] = $data['quantity'] ?? null; + $this->container['discount_percentage'] = $data['discount_percentage'] ?? 0; + $this->container['duration'] = $data['duration'] ?? 1; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['product_variation_id'] = $data['product_variation_id'] ?? null; + $this->container['comments'] = $data['comments'] ?? null; + $this->container['tax'] = $data['tax'] ?? null; + $this->container['enabled_flag'] = $data['enabled_flag'] ?? true; + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['sum_no_discount'] = $data['sum_no_discount'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['last_edit'] = $data['last_edit'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['product_attachment_id'] = $data['product_attachment_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['item_price'] === null) { + $invalidProperties[] = "'item_price' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' 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 product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id The ID of the product + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets item_price + * + * @return float + */ + public function getItemPrice() + { + return $this->container['item_price']; + } + + /** + * Sets item_price + * + * @param float $item_price The price at which this product will be added to the deal + * + * @return self + */ + public function setItemPrice($item_price): self + { + $this->container['item_price'] = $item_price; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity Quantity – e.g. how many items of this product will be added to the deal + * + * @return self + */ + public function setQuantity($quantity): self + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets discount_percentage + * + * @return float|null + */ + public function getDiscountPercentage() + { + return $this->container['discount_percentage']; + } + + /** + * Sets discount_percentage + * + * @param float|null $discount_percentage The discount %. If omitted, will be set to 0. + * + * @return self + */ + public function setDiscountPercentage($discount_percentage): self + { + $this->container['discount_percentage'] = $discount_percentage; + + return $this; + } + + /** + * Gets duration + * + * @return float|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param float|null $duration The duration of the product. If omitted, will be set to 1. + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets duration_unit + * + * @return string|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param string|null $duration_unit The type of the duration. (For example hourly, daily, etc.) + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets product_variation_id + * + * @return int|null + */ + public function getProductVariationId() + { + return $this->container['product_variation_id']; + } + + /** + * Sets product_variation_id + * + * @param int|null $product_variation_id The ID of the product variation to use. When omitted, no variation will be used. + * + * @return self + */ + public function setProductVariationId($product_variation_id): self + { + $this->container['product_variation_id'] = $product_variation_id; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments A textual comment associated with this product-deal attachment + * + * @return self + */ + public function setComments($comments): self + { + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The product tax + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets enabled_flag + * + * @return bool|null + */ + public function getEnabledFlag() + { + return $this->container['enabled_flag']; + } + + /** + * Sets enabled_flag + * + * @param bool|null $enabled_flag Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. + * + * @return self + */ + public function setEnabledFlag($enabled_flag): self + { + $this->container['enabled_flag'] = $enabled_flag; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal-product (the ID of the product attached to the deal) + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets sum_no_discount + * + * @return float|null + */ + public function getSumNoDiscount() + { + return $this->container['sum_no_discount']; + } + + /** + * Sets sum_no_discount + * + * @param float|null $sum_no_discount The product sum without the discount + * + * @return self + */ + public function setSumNoDiscount($sum_no_discount): self + { + $this->container['sum_no_discount'] = $sum_no_discount; + + return $this; + } + + /** + * Gets sum + * + * @return float|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param float|null $sum The sum of all the products attached to the deal + * + * @return self + */ + public function setSum($sum): self + { + $this->container['sum'] = $sum; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal product + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the product was added to the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets last_edit + * + * @return string|null + */ + public function getLastEdit() + { + return $this->container['last_edit']; + } + + /** + * Sets last_edit + * + * @param string|null $last_edit The date and time when the deal product was last edited + * + * @return self + */ + public function setLastEdit($last_edit): self + { + $this->container['last_edit'] = $last_edit; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The product name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets product_attachment_id + * + * @return int|null + */ + public function getProductAttachmentId() + { + return $this->container['product_attachment_id']; + } + + /** + * Sets product_attachment_id + * + * @param int|null $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) + * + * @return self + */ + public function setProductAttachmentId($product_attachment_id): self + { + $this->container['product_attachment_id'] = $product_attachment_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddProductAttachmentDetailsAllOf.php b/lib/Model/AddProductAttachmentDetailsAllOf.php new file mode 100644 index 00000000..05c04887 --- /dev/null +++ b/lib/Model/AddProductAttachmentDetailsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddProductAttachmentDetailsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddProductAttachmentDetails_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'product_attachment_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_attachment_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_attachment_id' => 'product_attachment_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_attachment_id' => 'setProductAttachmentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_attachment_id' => 'getProductAttachmentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_attachment_id'] = $data['product_attachment_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_attachment_id + * + * @return int|null + */ + public function getProductAttachmentId() + { + return $this->container['product_attachment_id']; + } + + /** + * Sets product_attachment_id + * + * @param int|null $product_attachment_id The ID of the deal-product (the ID of the product attached to the deal) + * + * @return self + */ + public function setProductAttachmentId($product_attachment_id): self + { + $this->container['product_attachment_id'] = $product_attachment_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddProductFollowerRequest.php b/lib/Model/AddProductFollowerRequest.php new file mode 100644 index 00000000..d13e2cce --- /dev/null +++ b/lib/Model/AddProductFollowerRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddProductFollowerRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addProductFollowerRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' 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 user_id + * + * @return int + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddProductRequestBody.php b/lib/Model/AddProductRequestBody.php new file mode 100644 index 00000000..75dd77ad --- /dev/null +++ b/lib/Model/AddProductRequestBody.php @@ -0,0 +1,585 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddProductRequestBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddProductRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'code' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'int', + 'prices' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'code' => null, + 'unit' => null, + 'tax' => null, + 'active_flag' => null, + 'selectable' => null, + 'visible_to' => null, + 'owner_id' => null, + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'code' => 'code', + 'unit' => 'unit', + 'tax' => 'tax', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'code' => 'setCode', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'code' => 'getCode', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product will be made active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product can be selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets prices + * + * @return object[]|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object[]|null $prices An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddRole.php b/lib/Model/AddRole.php new file mode 100644 index 00000000..761db1cb --- /dev/null +++ b/lib/Model/AddRole.php @@ -0,0 +1,376 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'parent_role_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'parent_role_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'parent_role_id' => 'parent_role_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'parent_role_id' => 'setParentRoleId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'parent_role_id' => 'getParentRoleId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['parent_role_id'] = $data['parent_role_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the role + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets parent_role_id + * + * @return int|null + */ + public function getParentRoleId() + { + return $this->container['parent_role_id']; + } + + /** + * Sets parent_role_id + * + * @param int|null $parent_role_id The ID of the parent role + * + * @return self + */ + public function setParentRoleId($parent_role_id): self + { + $this->container['parent_role_id'] = $parent_role_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddRoleAssignmentRequest.php b/lib/Model/AddRoleAssignmentRequest.php new file mode 100644 index 00000000..1a7307fc --- /dev/null +++ b/lib/Model/AddRoleAssignmentRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddRoleAssignmentRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addRoleAssignmentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' 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 user_id + * + * @return int + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddTeamUserRequest.php b/lib/Model/AddTeamUserRequest.php new file mode 100644 index 00000000..0499feef --- /dev/null +++ b/lib/Model/AddTeamUserRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddTeamUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addTeamUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'users' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'users' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'users' => 'users' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'users' => 'setUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'users' => 'getUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['users'] = $data['users'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' 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 users + * + * @return int[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param int[] $users The list of user IDs + * + * @return self + */ + public function setUsers($users): self + { + $this->container['users'] = $users; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddUserRequest.php b/lib/Model/AddUserRequest.php new file mode 100644 index 00000000..ba0fa170 --- /dev/null +++ b/lib/Model/AddUserRequest.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email' => 'string', + 'access' => '\Pipedrive\Model\UserAccess[]', + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email' => null, + 'access' => null, + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'access' => 'access', + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'access' => 'setAccess', + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'access' => 'getAccess', + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = $data['email'] ?? null; + $this->container['access'] = $data['access'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email The email of the user + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets access + * + * @return \Pipedrive\Model\UserAccess[]|null + */ + public function getAccess() + { + return $this->container['access']; + } + + /** + * Sets access + * + * @param \Pipedrive\Model\UserAccess[]|null $access The access given to the user. Each item in the array represents access to a specific app. Optionally may include either admin flag or permission set ID to specify which access to give within the app. If both are omitted, the default access for the corresponding app will be used. It requires structure as follows: `[{ app: 'sales', permission_set_id: '62cc4d7f-4038-4352-abf3-a8c1c822b631' }, { app: 'global', admin: true }, { app: 'account_settings' }]` + * + * @return self + */ + public function setAccess($access): self + { + $this->container['access'] = $access; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not. `false` = Not activated, `true` = Activated + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddWebhookRequest.php b/lib/Model/AddWebhookRequest.php new file mode 100644 index 00000000..73fef980 --- /dev/null +++ b/lib/Model/AddWebhookRequest.php @@ -0,0 +1,663 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddWebhookRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'addWebhookRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'subscription_url' => 'string', + 'event_action' => 'string', + 'event_object' => 'string', + 'user_id' => 'int', + 'http_auth_user' => 'string', + 'http_auth_password' => 'string', + 'version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_url' => null, + 'event_action' => null, + 'event_object' => null, + 'user_id' => null, + 'http_auth_user' => null, + 'http_auth_password' => null, + 'version' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_url' => 'subscription_url', + 'event_action' => 'event_action', + 'event_object' => 'event_object', + 'user_id' => 'user_id', + 'http_auth_user' => 'http_auth_user', + 'http_auth_password' => 'http_auth_password', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_url' => 'setSubscriptionUrl', + 'event_action' => 'setEventAction', + 'event_object' => 'setEventObject', + 'user_id' => 'setUserId', + 'http_auth_user' => 'setHttpAuthUser', + 'http_auth_password' => 'setHttpAuthPassword', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_url' => 'getSubscriptionUrl', + 'event_action' => 'getEventAction', + 'event_object' => 'getEventObject', + 'user_id' => 'getUserId', + 'http_auth_user' => 'getHttpAuthUser', + 'http_auth_password' => 'getHttpAuthPassword', + 'version' => 'getVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const EVENT_ACTION_ADDED = 'added'; + const EVENT_ACTION_UPDATED = 'updated'; + const EVENT_ACTION_MERGED = 'merged'; + const EVENT_ACTION_DELETED = 'deleted'; + const EVENT_ACTION_STAR = '*'; + const EVENT_OBJECT_ACTIVITY = 'activity'; + const EVENT_OBJECT_ACTIVITY_TYPE = 'activityType'; + const EVENT_OBJECT_DEAL = 'deal'; + const EVENT_OBJECT_NOTE = 'note'; + const EVENT_OBJECT_ORGANIZATION = 'organization'; + const EVENT_OBJECT_PERSON = 'person'; + const EVENT_OBJECT_PIPELINE = 'pipeline'; + const EVENT_OBJECT_PRODUCT = 'product'; + const EVENT_OBJECT_STAGE = 'stage'; + const EVENT_OBJECT_USER = 'user'; + const EVENT_OBJECT_STAR = '*'; + const VERSION__1_0 = '1.0'; + const VERSION__2_0 = '2.0'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getEventActionAllowableValues(): array + { + return [ + self::EVENT_ACTION_ADDED, + self::EVENT_ACTION_UPDATED, + self::EVENT_ACTION_MERGED, + self::EVENT_ACTION_DELETED, + self::EVENT_ACTION_STAR, + ]; + } + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getEventObjectAllowableValues(): array + { + return [ + self::EVENT_OBJECT_ACTIVITY, + self::EVENT_OBJECT_ACTIVITY_TYPE, + self::EVENT_OBJECT_DEAL, + self::EVENT_OBJECT_NOTE, + self::EVENT_OBJECT_ORGANIZATION, + self::EVENT_OBJECT_PERSON, + self::EVENT_OBJECT_PIPELINE, + self::EVENT_OBJECT_PRODUCT, + self::EVENT_OBJECT_STAGE, + self::EVENT_OBJECT_USER, + self::EVENT_OBJECT_STAR, + ]; + } + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getVersionAllowableValues(): array + { + return [ + self::VERSION__1_0, + self::VERSION__2_0, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['subscription_url'] = $data['subscription_url'] ?? null; + $this->container['event_action'] = $data['event_action'] ?? null; + $this->container['event_object'] = $data['event_object'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['http_auth_user'] = $data['http_auth_user'] ?? null; + $this->container['http_auth_password'] = $data['http_auth_password'] ?? null; + $this->container['version'] = $data['version'] ?? '1.0'; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['subscription_url'] === null) { + $invalidProperties[] = "'subscription_url' can't be null"; + } + if ($this->container['event_action'] === null) { + $invalidProperties[] = "'event_action' can't be null"; + } + $allowedValues = $this->getEventActionAllowableValues(); + if (!is_null($this->container['event_action']) && !in_array($this->container['event_action'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'event_action', must be one of '%s'", + $this->container['event_action'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['event_object'] === null) { + $invalidProperties[] = "'event_object' can't be null"; + } + $allowedValues = $this->getEventObjectAllowableValues(); + if (!is_null($this->container['event_object']) && !in_array($this->container['event_object'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'event_object', must be one of '%s'", + $this->container['event_object'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVersionAllowableValues(); + if (!is_null($this->container['version']) && !in_array($this->container['version'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'version', must be one of '%s'", + $this->container['version'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_url + * + * @return string + */ + public function getSubscriptionUrl() + { + return $this->container['subscription_url']; + } + + /** + * Sets subscription_url + * + * @param string $subscription_url A full, valid, publicly accessible URL which determines where to send the notifications. Please note that you cannot use Pipedrive API endpoints as the `subscription_url` and the chosen URL must not redirect to another link. + * + * @return self + */ + public function setSubscriptionUrl($subscription_url): self + { + $this->container['subscription_url'] = $subscription_url; + + return $this; + } + + /** + * Gets event_action + * + * @return string + */ + public function getEventAction() + { + return $this->container['event_action']; + } + + /** + * Sets event_action + * + * @param string $event_action The type of action to receive notifications about. Wildcard will match all supported actions. + * + * @return self + */ + public function setEventAction($event_action): self + { + $allowedValues = $this->getEventActionAllowableValues(); + if (!in_array($event_action, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'event_action', must be one of '%s'", + $event_action, + implode("', '", $allowedValues) + ) + ); + } + $this->container['event_action'] = $event_action; + + return $this; + } + + /** + * Gets event_object + * + * @return string + */ + public function getEventObject() + { + return $this->container['event_object']; + } + + /** + * Sets event_object + * + * @param string $event_object The type of object to receive notifications about. Wildcard will match all supported objects. + * + * @return self + */ + public function setEventObject($event_object): self + { + $allowedValues = $this->getEventObjectAllowableValues(); + if (!in_array($event_object, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'event_object', must be one of '%s'", + $event_object, + implode("', '", $allowedValues) + ) + ); + } + $this->container['event_object'] = $event_object; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user that this webhook will be authorized with. You have the option to use a different user's `user_id`. If it is not set, the current user's `user_id` will be used. As each webhook event is checked against a user’s permissions, the webhook will only be sent if the user has access to the specified object(s). If you want to receive notifications for all events, please use a top-level admin user’s `user_id`. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets http_auth_user + * + * @return string|null + */ + public function getHttpAuthUser() + { + return $this->container['http_auth_user']; + } + + /** + * Sets http_auth_user + * + * @param string|null $http_auth_user The HTTP basic auth username of the subscription URL endpoint (if required) + * + * @return self + */ + public function setHttpAuthUser($http_auth_user): self + { + $this->container['http_auth_user'] = $http_auth_user; + + return $this; + } + + /** + * Gets http_auth_password + * + * @return string|null + */ + public function getHttpAuthPassword() + { + return $this->container['http_auth_password']; + } + + /** + * Sets http_auth_password + * + * @param string|null $http_auth_password The HTTP basic auth password of the subscription URL endpoint (if required) + * + * @return self + */ + public function setHttpAuthPassword($http_auth_password): self + { + $this->container['http_auth_password'] = $http_auth_password; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version The webhook's version + * + * @return self + */ + public function setVersion($version): self + { + $allowedValues = $this->getVersionAllowableValues(); + if (!is_null($version) && !in_array($version, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'version', must be one of '%s'", + $version, + implode("', '", $allowedValues) + ) + ); + } + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddedDealFollower.php b/lib/Model/AddedDealFollower.php new file mode 100644 index 00000000..3bdf648e --- /dev/null +++ b/lib/Model/AddedDealFollower.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddedDealFollower implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddedDealFollower'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\AddedDealFollowerData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\AddedDealFollowerData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\AddedDealFollowerData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AddedDealFollowerData.php b/lib/Model/AddedDealFollowerData.php new file mode 100644 index 00000000..007c69fe --- /dev/null +++ b/lib/Model/AddedDealFollowerData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddedDealFollowerData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AddedDealFollower_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'id' => 'int', + 'deal_id' => 'int', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'id' => null, + 'deal_id' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'id' => 'id', + 'deal_id' => 'deal_id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'id' => 'setId', + 'deal_id' => 'setDealId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'id' => 'getId', + 'deal_id' => 'getDealId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID who added the follower + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The follower ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal which the follower was added to + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the deal follower was added + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalBaseOrganizationItemInfo.php b/lib/Model/AdditionalBaseOrganizationItemInfo.php new file mode 100644 index 00000000..17cc11d8 --- /dev/null +++ b/lib/Model/AdditionalBaseOrganizationItemInfo.php @@ -0,0 +1,1272 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalBaseOrganizationItemInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdditionalBaseOrganizationItemInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email_messages_count' => 'int', + 'people_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'address' => 'string', + 'address_subpremise' => 'string', + 'address_street_number' => 'string', + 'address_route' => 'string', + 'address_sublocality' => 'string', + 'address_locality' => 'string', + 'address_admin_area_level_1' => 'string', + 'address_admin_area_level_2' => 'string', + 'address_country' => 'string', + 'address_postal_code' => 'string', + 'address_formatted_address' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email_messages_count' => null, + 'people_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'address' => null, + 'address_subpremise' => null, + 'address_street_number' => null, + 'address_route' => null, + 'address_sublocality' => null, + 'address_locality' => null, + 'address_admin_area_level_1' => null, + 'address_admin_area_level_2' => null, + 'address_country' => null, + 'address_postal_code' => null, + 'address_formatted_address' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_messages_count' => 'email_messages_count', + 'people_count' => 'people_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'address' => 'address', + 'address_subpremise' => 'address_subpremise', + 'address_street_number' => 'address_street_number', + 'address_route' => 'address_route', + 'address_sublocality' => 'address_sublocality', + 'address_locality' => 'address_locality', + 'address_admin_area_level_1' => 'address_admin_area_level_1', + 'address_admin_area_level_2' => 'address_admin_area_level_2', + 'address_country' => 'address_country', + 'address_postal_code' => 'address_postal_code', + 'address_formatted_address' => 'address_formatted_address', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_messages_count' => 'setEmailMessagesCount', + 'people_count' => 'setPeopleCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'address' => 'setAddress', + 'address_subpremise' => 'setAddressSubpremise', + 'address_street_number' => 'setAddressStreetNumber', + 'address_route' => 'setAddressRoute', + 'address_sublocality' => 'setAddressSublocality', + 'address_locality' => 'setAddressLocality', + 'address_admin_area_level_1' => 'setAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'setAddressAdminAreaLevel2', + 'address_country' => 'setAddressCountry', + 'address_postal_code' => 'setAddressPostalCode', + 'address_formatted_address' => 'setAddressFormattedAddress', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_messages_count' => 'getEmailMessagesCount', + 'people_count' => 'getPeopleCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'address' => 'getAddress', + 'address_subpremise' => 'getAddressSubpremise', + 'address_street_number' => 'getAddressStreetNumber', + 'address_route' => 'getAddressRoute', + 'address_sublocality' => 'getAddressSublocality', + 'address_locality' => 'getAddressLocality', + 'address_admin_area_level_1' => 'getAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'getAddressAdminAreaLevel2', + 'address_country' => 'getAddressCountry', + 'address_postal_code' => 'getAddressPostalCode', + 'address_formatted_address' => 'getAddressFormattedAddress', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['address_subpremise'] = $data['address_subpremise'] ?? null; + $this->container['address_street_number'] = $data['address_street_number'] ?? null; + $this->container['address_route'] = $data['address_route'] ?? null; + $this->container['address_sublocality'] = $data['address_sublocality'] ?? null; + $this->container['address_locality'] = $data['address_locality'] ?? null; + $this->container['address_admin_area_level_1'] = $data['address_admin_area_level_1'] ?? null; + $this->container['address_admin_area_level_2'] = $data['address_admin_area_level_2'] ?? null; + $this->container['address_country'] = $data['address_country'] ?? null; + $this->container['address_postal_code'] = $data['address_postal_code'] ?? null; + $this->container['address_formatted_address'] = $data['address_formatted_address'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the organization + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The count of persons related to the organization + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the organization + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the organization + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the organization + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the organization + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the organization + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the organization + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The full address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets address_subpremise + * + * @return string|null + */ + public function getAddressSubpremise() + { + return $this->container['address_subpremise']; + } + + /** + * Sets address_subpremise + * + * @param string|null $address_subpremise The sub-premise of the organization location + * + * @return self + */ + public function setAddressSubpremise($address_subpremise): self + { + $this->container['address_subpremise'] = $address_subpremise; + + return $this; + } + + /** + * Gets address_street_number + * + * @return string|null + */ + public function getAddressStreetNumber() + { + return $this->container['address_street_number']; + } + + /** + * Sets address_street_number + * + * @param string|null $address_street_number The street number of the organization location + * + * @return self + */ + public function setAddressStreetNumber($address_street_number): self + { + $this->container['address_street_number'] = $address_street_number; + + return $this; + } + + /** + * Gets address_route + * + * @return string|null + */ + public function getAddressRoute() + { + return $this->container['address_route']; + } + + /** + * Sets address_route + * + * @param string|null $address_route The route of the organization location + * + * @return self + */ + public function setAddressRoute($address_route): self + { + $this->container['address_route'] = $address_route; + + return $this; + } + + /** + * Gets address_sublocality + * + * @return string|null + */ + public function getAddressSublocality() + { + return $this->container['address_sublocality']; + } + + /** + * Sets address_sublocality + * + * @param string|null $address_sublocality The sub-locality of the organization location + * + * @return self + */ + public function setAddressSublocality($address_sublocality): self + { + $this->container['address_sublocality'] = $address_sublocality; + + return $this; + } + + /** + * Gets address_locality + * + * @return string|null + */ + public function getAddressLocality() + { + return $this->container['address_locality']; + } + + /** + * Sets address_locality + * + * @param string|null $address_locality The locality of the organization location + * + * @return self + */ + public function setAddressLocality($address_locality): self + { + $this->container['address_locality'] = $address_locality; + + return $this; + } + + /** + * Gets address_admin_area_level_1 + * + * @return string|null + */ + public function getAddressAdminAreaLevel1() + { + return $this->container['address_admin_area_level_1']; + } + + /** + * Sets address_admin_area_level_1 + * + * @param string|null $address_admin_area_level_1 The level 1 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel1($address_admin_area_level_1): self + { + $this->container['address_admin_area_level_1'] = $address_admin_area_level_1; + + return $this; + } + + /** + * Gets address_admin_area_level_2 + * + * @return string|null + */ + public function getAddressAdminAreaLevel2() + { + return $this->container['address_admin_area_level_2']; + } + + /** + * Sets address_admin_area_level_2 + * + * @param string|null $address_admin_area_level_2 The level 2 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel2($address_admin_area_level_2): self + { + $this->container['address_admin_area_level_2'] = $address_admin_area_level_2; + + return $this; + } + + /** + * Gets address_country + * + * @return string|null + */ + public function getAddressCountry() + { + return $this->container['address_country']; + } + + /** + * Sets address_country + * + * @param string|null $address_country The country of the organization location + * + * @return self + */ + public function setAddressCountry($address_country): self + { + $this->container['address_country'] = $address_country; + + return $this; + } + + /** + * Gets address_postal_code + * + * @return string|null + */ + public function getAddressPostalCode() + { + return $this->container['address_postal_code']; + } + + /** + * Sets address_postal_code + * + * @param string|null $address_postal_code The postal code of the organization location + * + * @return self + */ + public function setAddressPostalCode($address_postal_code): self + { + $this->container['address_postal_code'] = $address_postal_code; + + return $this; + } + + /** + * Gets address_formatted_address + * + * @return string|null + */ + public function getAddressFormattedAddress() + { + return $this->container['address_formatted_address']; + } + + /** + * Sets address_formatted_address + * + * @param string|null $address_formatted_address The formatted organization location + * + * @return self + */ + public function setAddressFormattedAddress($address_formatted_address): self + { + $this->container['address_formatted_address'] = $address_formatted_address; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalData.php b/lib/Model/AdditionalData.php new file mode 100644 index 00000000..d111bac6 --- /dev/null +++ b/lib/Model/AdditionalData.php @@ -0,0 +1,403 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'additional-data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'start' => 'int', + 'limit' => 'int', + 'more_items_in_collection' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'start' => null, + 'limit' => null, + 'more_items_in_collection' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'start' => 'start', + 'limit' => 'limit', + 'more_items_in_collection' => 'more_items_in_collection' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'limit' => 'setLimit', + 'more_items_in_collection' => 'setMoreItemsInCollection' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'limit' => 'getLimit', + 'more_items_in_collection' => 'getMoreItemsInCollection' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start'] = $data['start'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['more_items_in_collection'] = $data['more_items_in_collection'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets start + * + * @return int|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param int|null $start Pagination start + * + * @return self + */ + public function setStart($start): self + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit Items shown per page + * + * @return self + */ + public function setLimit($limit): self + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets more_items_in_collection + * + * @return bool|null + */ + public function getMoreItemsInCollection() + { + return $this->container['more_items_in_collection']; + } + + /** + * Sets more_items_in_collection + * + * @param bool|null $more_items_in_collection If there are more list items in the collection than displayed or not + * + * @return self + */ + public function setMoreItemsInCollection($more_items_in_collection): self + { + $this->container['more_items_in_collection'] = $more_items_in_collection; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalDataWithCursorPagination.php b/lib/Model/AdditionalDataWithCursorPagination.php new file mode 100644 index 00000000..db3b58b9 --- /dev/null +++ b/lib/Model/AdditionalDataWithCursorPagination.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalDataWithCursorPagination implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'additional-data-with-cursor-pagination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'next_cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_cursor' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_cursor' => 'next_cursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_cursor' => 'setNextCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_cursor' => 'getNextCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['next_cursor'] = $data['next_cursor'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + * + * @return self + */ + public function setNextCursor($next_cursor): self + { + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalDataWithOffsetPagination.php b/lib/Model/AdditionalDataWithOffsetPagination.php new file mode 100644 index 00000000..a9a80d1a --- /dev/null +++ b/lib/Model/AdditionalDataWithOffsetPagination.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalDataWithOffsetPagination implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'additional-data-with-offset-pagination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pagination' => 'AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return AdditionalData|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param AdditionalData|null $pagination The pagination details of the list + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalDataWithPaginationDetails.php b/lib/Model/AdditionalDataWithPaginationDetails.php new file mode 100644 index 00000000..90cbe78f --- /dev/null +++ b/lib/Model/AdditionalDataWithPaginationDetails.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalDataWithPaginationDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdditionalDataWithPaginationDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pagination' => '\Pipedrive\Model\PaginationDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \Pipedrive\Model\PaginationDetails|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Pipedrive\Model\PaginationDetails|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalMergePersonInfo.php b/lib/Model/AdditionalMergePersonInfo.php new file mode 100644 index 00000000..5121928b --- /dev/null +++ b/lib/Model/AdditionalMergePersonInfo.php @@ -0,0 +1,1212 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalMergePersonInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdditionalMergePersonInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => 'int', + 'org_id' => 'int', + 'merge_what_id' => 'int', + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'participant_open_deals_count' => 'int', + 'participant_closed_deals_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null, + 'merge_what_id' => null, + 'name' => null, + 'first_name' => null, + 'last_name' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'participant_open_deals_count' => null, + 'participant_closed_deals_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'merge_what_id' => 'merge_what_id', + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'participant_open_deals_count' => 'participant_open_deals_count', + 'participant_closed_deals_count' => 'participant_closed_deals_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'merge_what_id' => 'setMergeWhatId', + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'participant_open_deals_count' => 'setParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'setParticipantClosedDealsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'merge_what_id' => 'getMergeWhatId', + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'participant_open_deals_count' => 'getParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'getParticipantClosedDealsCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['merge_what_id'] = $data['merge_what_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['participant_open_deals_count'] = $data['participant_open_deals_count'] ?? null; + $this->container['participant_closed_deals_count'] = $data['participant_closed_deals_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner related to the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization related to the person + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets merge_what_id + * + * @return int|null + */ + public function getMergeWhatId() + { + return $this->container['merge_what_id']; + } + + /** + * Sets merge_what_id + * + * @param int|null $merge_what_id The ID of the person with what the main person was merged + * + * @return self + */ + public function setMergeWhatId($merge_what_id): self + { + $this->container['merge_what_id'] = $merge_what_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets participant_open_deals_count + * + * @return int|null + */ + public function getParticipantOpenDealsCount() + { + return $this->container['participant_open_deals_count']; + } + + /** + * Sets participant_open_deals_count + * + * @param int|null $participant_open_deals_count The count of open participant deals related with the item + * + * @return self + */ + public function setParticipantOpenDealsCount($participant_open_deals_count): self + { + $this->container['participant_open_deals_count'] = $participant_open_deals_count; + + return $this; + } + + /** + * Gets participant_closed_deals_count + * + * @return int|null + */ + public function getParticipantClosedDealsCount() + { + return $this->container['participant_closed_deals_count']; + } + + /** + * Sets participant_closed_deals_count + * + * @param int|null $participant_closed_deals_count The count of closed participant deals related with the item + * + * @return self + */ + public function setParticipantClosedDealsCount($participant_closed_deals_count): self + { + $this->container['participant_closed_deals_count'] = $participant_closed_deals_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AdditionalPersonInfo.php b/lib/Model/AdditionalPersonInfo.php new file mode 100644 index 00000000..9e35d855 --- /dev/null +++ b/lib/Model/AdditionalPersonInfo.php @@ -0,0 +1,1122 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AdditionalPersonInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AdditionalPersonInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => '\Pipedrive\Model\Owner', + 'org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag', + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null, + 'name' => null, + 'first_name' => null, + 'last_name' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AllOrganizationRelationshipsGetResponse.php b/lib/Model/AllOrganizationRelationshipsGetResponse.php new file mode 100644 index 00000000..f84110da --- /dev/null +++ b/lib/Model/AllOrganizationRelationshipsGetResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AllOrganizationRelationshipsGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AllOrganizationRelationshipsGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationRelationshipDetails[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationRelationshipDetails[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationRelationshipDetails[]|null $data The array of organization relationships + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AllOrganizationRelationshipsGetResponseAllOf.php b/lib/Model/AllOrganizationRelationshipsGetResponseAllOf.php new file mode 100644 index 00000000..a3315492 --- /dev/null +++ b/lib/Model/AllOrganizationRelationshipsGetResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AllOrganizationRelationshipsGetResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AllOrganizationRelationshipsGetResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\OrganizationRelationshipDetails[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationRelationshipDetails[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationRelationshipDetails[]|null $data The array of organization relationships + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.php b/lib/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..1ac09cbf --- /dev/null +++ b/lib/Model/AllOrganizationRelationshipsGetResponseAllOfRelatedObjects.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AllOrganizationRelationshipsGetResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AllOrganizationRelationshipsGetResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization' => '\Pipedrive\Model\RelatedOrganizationData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization' => 'organization' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization' => 'setOrganization' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization' => 'getOrganization' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization'] = $data['organization'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationData|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationData|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AllOrganizationsGetResponse.php b/lib/Model/AllOrganizationsGetResponse.php new file mode 100644 index 00000000..dc26a561 --- /dev/null +++ b/lib/Model/AllOrganizationsGetResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AllOrganizationsGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AllOrganizationsGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseOrganizationItem[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItem[]|null $data The array of organizations + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AllOrganizationsGetResponseAllOf.php b/lib/Model/AllOrganizationsGetResponseAllOf.php new file mode 100644 index 00000000..b8961e20 --- /dev/null +++ b/lib/Model/AllOrganizationsGetResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AllOrganizationsGetResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AllOrganizationsGetResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseOrganizationItem[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItem[]|null $data The array of organizations + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AllOrganizationsGetResponseAllOfRelatedObjects.php b/lib/Model/AllOrganizationsGetResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..88955eb5 --- /dev/null +++ b/lib/Model/AllOrganizationsGetResponseAllOfRelatedObjects.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AllOrganizationsGetResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'AllOrganizationsGetResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization' => '\Pipedrive\Model\RelatedOrganizationData', + 'user' => '\Pipedrive\Model\RelatedUserData', + 'picture' => '\Pipedrive\Model\RelatedPictureData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization' => null, + 'user' => null, + 'picture' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization' => 'organization', + 'user' => 'user', + 'picture' => 'picture' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization' => 'setOrganization', + 'user' => 'setUser', + 'picture' => 'setPicture' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization' => 'getOrganization', + 'user' => 'getUser', + 'picture' => 'getPicture' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization'] = $data['organization'] ?? null; + $this->container['user'] = $data['user'] ?? null; + $this->container['picture'] = $data['picture'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationData|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationData|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets picture + * + * @return \Pipedrive\Model\RelatedPictureData|null + */ + public function getPicture() + { + return $this->container['picture']; + } + + /** + * Sets picture + * + * @param \Pipedrive\Model\RelatedPictureData|null $picture picture + * + * @return self + */ + public function setPicture($picture): self + { + $this->container['picture'] = $picture; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/AnyOfRecents.php b/lib/Model/AnyOfRecents.php new file mode 100644 index 00000000..eadf467e --- /dev/null +++ b/lib/Model/AnyOfRecents.php @@ -0,0 +1,215 @@ + + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return [ + 'id' => 'int', + 'item' => 'string', + 'data' => 'array' + ]; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return [ + 'id' => 'id', + 'item' => 'item', + 'data' => 'data' + ]; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return [ + 'id' => 'setId', + 'item' => 'setItem', + 'data' => 'setData' + ]; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return [ + 'id' => 'getId', + 'item' => 'getItem', + 'data' => 'getData' + ]; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['item'] = $data['item'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Gets id + * + * @return int + */ + public function getId(): int + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The id of an item + * + * @return self + */ + public function setId(int $id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets item + * + * @return string + */ + public function getItem(): string + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string $item The type of the item + * + * @return self + */ + public function setItem(string $item): self + { + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets data + * + * @return array + */ + public function getData(): array + { + return $this->container['data']; + } + + /** + * Sets id + * + * @param array $data The data about the item + * + * @return self + */ + public function setData(array $data): self + { + $this->container['data'] = $data; + + return $this; + } +} \ No newline at end of file diff --git a/lib/Model/ArrayPrices.php b/lib/Model/ArrayPrices.php new file mode 100644 index 00000000..fc59882f --- /dev/null +++ b/lib/Model/ArrayPrices.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ArrayPrices implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ArrayPrices'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'prices' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets prices + * + * @return object[]|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object[]|null $prices Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Assignee.php b/lib/Model/Assignee.php new file mode 100644 index 00000000..7e9c6459 --- /dev/null +++ b/lib/Model/Assignee.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Assignee implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Assignee'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the goal assignee + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the assignee + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseComment.php b/lib/Model/BaseComment.php new file mode 100644 index 00000000..8b6b73e4 --- /dev/null +++ b/lib/Model/BaseComment.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseComment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseComment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'uuid' => 'string', + 'active_flag' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string', + 'content' => 'string', + 'object_id' => 'string', + 'object_type' => 'string', + 'user_id' => 'int', + 'updater_id' => 'int', + 'company_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'uuid' => 'uuid', + 'active_flag' => null, + 'add_time' => null, + 'update_time' => null, + 'content' => null, + 'object_id' => null, + 'object_type' => null, + 'user_id' => null, + 'updater_id' => null, + 'company_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'uuid' => 'uuid', + 'active_flag' => 'active_flag', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'content' => 'content', + 'object_id' => 'object_id', + 'object_type' => 'object_type', + 'user_id' => 'user_id', + 'updater_id' => 'updater_id', + 'company_id' => 'company_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'uuid' => 'setUuid', + 'active_flag' => 'setActiveFlag', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'content' => 'setContent', + 'object_id' => 'setObjectId', + 'object_type' => 'setObjectType', + 'user_id' => 'setUserId', + 'updater_id' => 'setUpdaterId', + 'company_id' => 'setCompanyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'uuid' => 'getUuid', + 'active_flag' => 'getActiveFlag', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'content' => 'getContent', + 'object_id' => 'getObjectId', + 'object_type' => 'getObjectType', + 'user_id' => 'getUserId', + 'updater_id' => 'getUpdaterId', + 'company_id' => 'getCompanyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['uuid'] = $data['uuid'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['content'] = $data['content'] ?? null; + $this->container['object_id'] = $data['object_id'] ?? null; + $this->container['object_type'] = $data['object_type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['updater_id'] = $data['updater_id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets uuid + * + * @return string|null + */ + public function getUuid() + { + return $this->container['uuid']; + } + + /** + * Sets uuid + * + * @param string|null $uuid The ID of the note + * + * @return self + */ + public function setUuid($uuid): self + { + $this->container['uuid'] = $uuid; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the note is active or deleted + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the note + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The creation date and time of the note + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content The content of the note in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets object_id + * + * @return string|null + */ + public function getObjectId() + { + return $this->container['object_id']; + } + + /** + * Sets object_id + * + * @param string|null $object_id The ID of the object that the comment is attached to, will be the id of the note + * + * @return self + */ + public function setObjectId($object_id): self + { + $this->container['object_id'] = $object_id; + + return $this; + } + + /** + * Gets object_type + * + * @return string|null + */ + public function getObjectType() + { + return $this->container['object_type']; + } + + /** + * Sets object_type + * + * @param string|null $object_type The type of object that the comment is attached to, will be \"note\" + * + * @return self + */ + public function setObjectType($object_type): self + { + $this->container['object_type'] = $object_type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user who created the comment + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets updater_id + * + * @return int|null + */ + public function getUpdaterId() + { + return $this->container['updater_id']; + } + + /** + * Sets updater_id + * + * @param int|null $updater_id The ID of the user who last updated the comment + * + * @return self + */ + public function setUpdaterId($updater_id): self + { + $this->container['updater_id'] = $updater_id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseCurrency.php b/lib/Model/BaseCurrency.php new file mode 100644 index 00000000..6d125b41 --- /dev/null +++ b/lib/Model/BaseCurrency.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseCurrency implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseCurrency'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'code' => 'string', + 'name' => 'string', + 'decimal_points' => 'int', + 'symbol' => 'string', + 'active_flag' => 'bool', + 'is_custom_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'code' => null, + 'name' => null, + 'decimal_points' => null, + 'symbol' => null, + 'active_flag' => null, + 'is_custom_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'code' => 'code', + 'name' => 'name', + 'decimal_points' => 'decimal_points', + 'symbol' => 'symbol', + 'active_flag' => 'active_flag', + 'is_custom_flag' => 'is_custom_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'code' => 'setCode', + 'name' => 'setName', + 'decimal_points' => 'setDecimalPoints', + 'symbol' => 'setSymbol', + 'active_flag' => 'setActiveFlag', + 'is_custom_flag' => 'setIsCustomFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'code' => 'getCode', + 'name' => 'getName', + 'decimal_points' => 'getDecimalPoints', + 'symbol' => 'getSymbol', + 'active_flag' => 'getActiveFlag', + 'is_custom_flag' => 'getIsCustomFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['decimal_points'] = $data['decimal_points'] ?? null; + $this->container['symbol'] = $data['symbol'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['is_custom_flag'] = $data['is_custom_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the currency + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The code of the currency + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the currency + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets decimal_points + * + * @return int|null + */ + public function getDecimalPoints() + { + return $this->container['decimal_points']; + } + + /** + * Sets decimal_points + * + * @param int|null $decimal_points The amount of decimal points of the currency + * + * @return self + */ + public function setDecimalPoints($decimal_points): self + { + $this->container['decimal_points'] = $decimal_points; + + return $this; + } + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol The symbol of the currency + * + * @return self + */ + public function setSymbol($symbol): self + { + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the currency is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets is_custom_flag + * + * @return bool|null + */ + public function getIsCustomFlag() + { + return $this->container['is_custom_flag']; + } + + /** + * Sets is_custom_flag + * + * @param bool|null $is_custom_flag Whether the currency is a custom one or not + * + * @return self + */ + public function setIsCustomFlag($is_custom_flag): self + { + $this->container['is_custom_flag'] = $is_custom_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseDeal.php b/lib/Model/BaseDeal.php new file mode 100644 index 00000000..56ba35e3 --- /dev/null +++ b/lib/Model/BaseDeal.php @@ -0,0 +1,1872 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'stage_change_time' => 'string', + 'active' => 'bool', + 'deleted' => 'bool', + 'status' => 'string', + 'probability' => 'float', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'first_won_time' => 'string', + 'lost_time' => 'string', + 'products_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'participants_count' => 'int', + 'expected_close_date' => '\DateTime', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'label' => 'string', + 'stage_order_nr' => 'int', + 'person_name' => 'string', + 'org_name' => 'string', + 'next_activity_subject' => 'string', + 'next_activity_type' => 'string', + 'next_activity_duration' => 'string', + 'next_activity_note' => 'string', + 'formatted_value' => 'string', + 'weighted_value' => 'float', + 'formatted_weighted_value' => 'string', + 'weighted_value_currency' => 'string', + 'rotten_time' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'org_hidden' => 'bool', + 'person_hidden' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'update_time' => null, + 'stage_change_time' => null, + 'active' => null, + 'deleted' => null, + 'status' => null, + 'probability' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'first_won_time' => null, + 'lost_time' => null, + 'products_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'participants_count' => null, + 'expected_close_date' => 'date', + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'label' => null, + 'stage_order_nr' => null, + 'person_name' => null, + 'org_name' => null, + 'next_activity_subject' => null, + 'next_activity_type' => null, + 'next_activity_duration' => null, + 'next_activity_note' => null, + 'formatted_value' => null, + 'weighted_value' => null, + 'formatted_weighted_value' => null, + 'weighted_value_currency' => null, + 'rotten_time' => null, + 'owner_name' => null, + 'cc_email' => null, + 'org_hidden' => null, + 'person_hidden' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'stage_change_time' => 'stage_change_time', + 'active' => 'active', + 'deleted' => 'deleted', + 'status' => 'status', + 'probability' => 'probability', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'first_won_time' => 'first_won_time', + 'lost_time' => 'lost_time', + 'products_count' => 'products_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'participants_count' => 'participants_count', + 'expected_close_date' => 'expected_close_date', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'label' => 'label', + 'stage_order_nr' => 'stage_order_nr', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'next_activity_subject' => 'next_activity_subject', + 'next_activity_type' => 'next_activity_type', + 'next_activity_duration' => 'next_activity_duration', + 'next_activity_note' => 'next_activity_note', + 'formatted_value' => 'formatted_value', + 'weighted_value' => 'weighted_value', + 'formatted_weighted_value' => 'formatted_weighted_value', + 'weighted_value_currency' => 'weighted_value_currency', + 'rotten_time' => 'rotten_time', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'org_hidden' => 'org_hidden', + 'person_hidden' => 'person_hidden' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'stage_change_time' => 'setStageChangeTime', + 'active' => 'setActive', + 'deleted' => 'setDeleted', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'first_won_time' => 'setFirstWonTime', + 'lost_time' => 'setLostTime', + 'products_count' => 'setProductsCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'participants_count' => 'setParticipantsCount', + 'expected_close_date' => 'setExpectedCloseDate', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'label' => 'setLabel', + 'stage_order_nr' => 'setStageOrderNr', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'next_activity_subject' => 'setNextActivitySubject', + 'next_activity_type' => 'setNextActivityType', + 'next_activity_duration' => 'setNextActivityDuration', + 'next_activity_note' => 'setNextActivityNote', + 'formatted_value' => 'setFormattedValue', + 'weighted_value' => 'setWeightedValue', + 'formatted_weighted_value' => 'setFormattedWeightedValue', + 'weighted_value_currency' => 'setWeightedValueCurrency', + 'rotten_time' => 'setRottenTime', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'org_hidden' => 'setOrgHidden', + 'person_hidden' => 'setPersonHidden' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'stage_change_time' => 'getStageChangeTime', + 'active' => 'getActive', + 'deleted' => 'getDeleted', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'first_won_time' => 'getFirstWonTime', + 'lost_time' => 'getLostTime', + 'products_count' => 'getProductsCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'participants_count' => 'getParticipantsCount', + 'expected_close_date' => 'getExpectedCloseDate', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'label' => 'getLabel', + 'stage_order_nr' => 'getStageOrderNr', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'next_activity_subject' => 'getNextActivitySubject', + 'next_activity_type' => 'getNextActivityType', + 'next_activity_duration' => 'getNextActivityDuration', + 'next_activity_note' => 'getNextActivityNote', + 'formatted_value' => 'getFormattedValue', + 'weighted_value' => 'getWeightedValue', + 'formatted_weighted_value' => 'getFormattedWeightedValue', + 'weighted_value_currency' => 'getWeightedValueCurrency', + 'rotten_time' => 'getRottenTime', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'org_hidden' => 'getOrgHidden', + 'person_hidden' => 'getPersonHidden' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deleted'] = $data['deleted'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['first_won_time'] = $data['first_won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['products_count'] = $data['products_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['participants_count'] = $data['participants_count'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['stage_order_nr'] = $data['stage_order_nr'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['next_activity_subject'] = $data['next_activity_subject'] ?? null; + $this->container['next_activity_type'] = $data['next_activity_type'] ?? null; + $this->container['next_activity_duration'] = $data['next_activity_duration'] ?? null; + $this->container['next_activity_note'] = $data['next_activity_note'] ?? null; + $this->container['formatted_value'] = $data['formatted_value'] ?? null; + $this->container['weighted_value'] = $data['weighted_value'] ?? null; + $this->container['formatted_weighted_value'] = $data['formatted_weighted_value'] ?? null; + $this->container['weighted_value_currency'] = $data['weighted_value_currency'] ?? null; + $this->container['rotten_time'] = $data['rotten_time'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['org_hidden'] = $data['org_hidden'] ?? null; + $this->container['person_hidden'] = $data['person_hidden'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets stage_change_time + * + * @return string|null + */ + public function getStageChangeTime() + { + return $this->container['stage_change_time']; + } + + /** + * Sets stage_change_time + * + * @param string|null $stage_change_time The last updated date and time of the deal stage + * + * @return self + */ + public function setStageChangeTime($stage_change_time): self + { + $this->container['stage_change_time'] = $stage_change_time; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether the deal is active or not + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deleted + * + * @return bool|null + */ + public function getDeleted() + { + return $this->container['deleted']; + } + + /** + * Sets deleted + * + * @param bool|null $deleted Whether the deal is deleted or not + * + * @return self + */ + public function setDeleted($deleted): self + { + $this->container['deleted'] = $deleted; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status as won + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets first_won_time + * + * @return string|null + */ + public function getFirstWonTime() + { + return $this->container['first_won_time']; + } + + /** + * Sets first_won_time + * + * @param string|null $first_won_time The date and time of the first time changing the deal status as won + * + * @return self + */ + public function setFirstWonTime($first_won_time): self + { + $this->container['first_won_time'] = $first_won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status as lost + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets products_count + * + * @return int|null + */ + public function getProductsCount() + { + return $this->container['products_count']; + } + + /** + * Sets products_count + * + * @param int|null $products_count The number of products associated with the deal + * + * @return self + */ + public function setProductsCount($products_count): self + { + $this->container['products_count'] = $products_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The number of files associated with the deal + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The number of notes associated with the deal + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The number of followers associated with the deal + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The number of emails associated with the deal + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The number of activities associated with the deal + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The number of completed activities associated with the deal + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The number of incomplete activities associated with the deal + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets participants_count + * + * @return int|null + */ + public function getParticipantsCount() + { + return $this->container['participants_count']; + } + + /** + * Sets participants_count + * + * @param int|null $participants_count The number of participants associated with the deal + * + * @return self + */ + public function setParticipantsCount($participants_count): self + { + $this->container['participants_count'] = $participants_count; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the deal + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the deal + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets stage_order_nr + * + * @return int|null + */ + public function getStageOrderNr() + { + return $this->container['stage_order_nr']; + } + + /** + * Sets stage_order_nr + * + * @param int|null $stage_order_nr The order number of the deal stage associated with the deal + * + * @return self + */ + public function setStageOrderNr($stage_order_nr): self + { + $this->container['stage_order_nr'] = $stage_order_nr; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the deal + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the deal + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets next_activity_subject + * + * @return string|null + */ + public function getNextActivitySubject() + { + return $this->container['next_activity_subject']; + } + + /** + * Sets next_activity_subject + * + * @param string|null $next_activity_subject The subject of the next activity associated with the deal + * + * @return self + */ + public function setNextActivitySubject($next_activity_subject): self + { + $this->container['next_activity_subject'] = $next_activity_subject; + + return $this; + } + + /** + * Gets next_activity_type + * + * @return string|null + */ + public function getNextActivityType() + { + return $this->container['next_activity_type']; + } + + /** + * Sets next_activity_type + * + * @param string|null $next_activity_type The type of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityType($next_activity_type): self + { + $this->container['next_activity_type'] = $next_activity_type; + + return $this; + } + + /** + * Gets next_activity_duration + * + * @return string|null + */ + public function getNextActivityDuration() + { + return $this->container['next_activity_duration']; + } + + /** + * Sets next_activity_duration + * + * @param string|null $next_activity_duration The duration of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDuration($next_activity_duration): self + { + $this->container['next_activity_duration'] = $next_activity_duration; + + return $this; + } + + /** + * Gets next_activity_note + * + * @return string|null + */ + public function getNextActivityNote() + { + return $this->container['next_activity_note']; + } + + /** + * Sets next_activity_note + * + * @param string|null $next_activity_note The note of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityNote($next_activity_note): self + { + $this->container['next_activity_note'] = $next_activity_note; + + return $this; + } + + /** + * Gets formatted_value + * + * @return string|null + */ + public function getFormattedValue() + { + return $this->container['formatted_value']; + } + + /** + * Sets formatted_value + * + * @param string|null $formatted_value The deal value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedValue($formatted_value): self + { + $this->container['formatted_value'] = $formatted_value; + + return $this; + } + + /** + * Gets weighted_value + * + * @return float|null + */ + public function getWeightedValue() + { + return $this->container['weighted_value']; + } + + /** + * Sets weighted_value + * + * @param float|null $weighted_value Probability times deal value. Probability can either be deal probability or if not set, then stage probability. + * + * @return self + */ + public function setWeightedValue($weighted_value): self + { + $this->container['weighted_value'] = $weighted_value; + + return $this; + } + + /** + * Gets formatted_weighted_value + * + * @return string|null + */ + public function getFormattedWeightedValue() + { + return $this->container['formatted_weighted_value']; + } + + /** + * Sets formatted_weighted_value + * + * @param string|null $formatted_weighted_value The weighted_value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedWeightedValue($formatted_weighted_value): self + { + $this->container['formatted_weighted_value'] = $formatted_weighted_value; + + return $this; + } + + /** + * Gets weighted_value_currency + * + * @return string|null + */ + public function getWeightedValueCurrency() + { + return $this->container['weighted_value_currency']; + } + + /** + * Sets weighted_value_currency + * + * @param string|null $weighted_value_currency The currency associated with the deal + * + * @return self + */ + public function setWeightedValueCurrency($weighted_value_currency): self + { + $this->container['weighted_value_currency'] = $weighted_value_currency; + + return $this; + } + + /** + * Gets rotten_time + * + * @return string|null + */ + public function getRottenTime() + { + return $this->container['rotten_time']; + } + + /** + * Sets rotten_time + * + * @param string|null $rotten_time The date and time of changing the deal status as rotten + * + * @return self + */ + public function setRottenTime($rotten_time): self + { + $this->container['rotten_time'] = $rotten_time; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the deal owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets org_hidden + * + * @return bool|null + */ + public function getOrgHidden() + { + return $this->container['org_hidden']; + } + + /** + * Sets org_hidden + * + * @param bool|null $org_hidden If the organization that is associated with the deal is hidden or not + * + * @return self + */ + public function setOrgHidden($org_hidden): self + { + $this->container['org_hidden'] = $org_hidden; + + return $this; + } + + /** + * Gets person_hidden + * + * @return bool|null + */ + public function getPersonHidden() + { + return $this->container['person_hidden']; + } + + /** + * Sets person_hidden + * + * @param bool|null $person_hidden If the person that is associated with the deal is hidden or not + * + * @return self + */ + public function setPersonHidden($person_hidden): self + { + $this->container['person_hidden'] = $person_hidden; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseFollowerItem.php b/lib/Model/BaseFollowerItem.php new file mode 100644 index 00000000..06b3dd4e --- /dev/null +++ b/lib/Model/BaseFollowerItem.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseFollowerItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseFollowerItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'id' => 'int', + 'add_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'id' => null, + 'add_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'id' => 'id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'id' => 'setId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'id' => 'getId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID of the follower related to the item + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The date and time of adding the follower to the item + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseMailThread.php b/lib/Model/BaseMailThread.php new file mode 100644 index 00000000..3b476fad --- /dev/null +++ b/lib/Model/BaseMailThread.php @@ -0,0 +1,1422 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseMailThread implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseMailThread'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'account_id' => 'string', + 'user_id' => 'int', + 'subject' => 'string', + 'snippet' => 'string', + 'read_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'mail_tracking_status' => 'string', + 'has_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_inline_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_real_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'synced_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'smart_bcc_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'mail_link_tracking_enabled_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'parties' => '\Pipedrive\Model\BaseMailThreadAllOfParties', + 'drafts_parties' => 'object[]', + 'folders' => 'string[]', + 'version' => 'float', + 'snippet_draft' => 'string', + 'snippet_sent' => 'string', + 'message_count' => 'int', + 'has_draft_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'archived_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'shared_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'external_deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'first_message_to_me_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'last_message_timestamp' => '\DateTime', + 'first_message_timestamp' => '\DateTime', + 'last_message_sent_timestamp' => '\DateTime', + 'last_message_received_timestamp' => '\DateTime', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime', + 'deal_id' => 'int', + 'deal_status' => 'string', + 'lead_id' => 'string', + 'all_messages_sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'account_id' => null, + 'user_id' => null, + 'subject' => null, + 'snippet' => null, + 'read_flag' => null, + 'mail_tracking_status' => null, + 'has_attachments_flag' => null, + 'has_inline_attachments_flag' => null, + 'has_real_attachments_flag' => null, + 'deleted_flag' => null, + 'synced_flag' => null, + 'smart_bcc_flag' => null, + 'mail_link_tracking_enabled_flag' => null, + 'parties' => null, + 'drafts_parties' => null, + 'folders' => null, + 'version' => null, + 'snippet_draft' => null, + 'snippet_sent' => null, + 'message_count' => null, + 'has_draft_flag' => null, + 'has_sent_flag' => null, + 'archived_flag' => null, + 'shared_flag' => null, + 'external_deleted_flag' => null, + 'first_message_to_me_flag' => null, + 'last_message_timestamp' => 'date-time', + 'first_message_timestamp' => 'date-time', + 'last_message_sent_timestamp' => 'date-time', + 'last_message_received_timestamp' => 'date-time', + 'add_time' => 'date-time', + 'update_time' => 'date-time', + 'deal_id' => null, + 'deal_status' => null, + 'lead_id' => 'uuid', + 'all_messages_sent_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'account_id' => 'account_id', + 'user_id' => 'user_id', + 'subject' => 'subject', + 'snippet' => 'snippet', + 'read_flag' => 'read_flag', + 'mail_tracking_status' => 'mail_tracking_status', + 'has_attachments_flag' => 'has_attachments_flag', + 'has_inline_attachments_flag' => 'has_inline_attachments_flag', + 'has_real_attachments_flag' => 'has_real_attachments_flag', + 'deleted_flag' => 'deleted_flag', + 'synced_flag' => 'synced_flag', + 'smart_bcc_flag' => 'smart_bcc_flag', + 'mail_link_tracking_enabled_flag' => 'mail_link_tracking_enabled_flag', + 'parties' => 'parties', + 'drafts_parties' => 'drafts_parties', + 'folders' => 'folders', + 'version' => 'version', + 'snippet_draft' => 'snippet_draft', + 'snippet_sent' => 'snippet_sent', + 'message_count' => 'message_count', + 'has_draft_flag' => 'has_draft_flag', + 'has_sent_flag' => 'has_sent_flag', + 'archived_flag' => 'archived_flag', + 'shared_flag' => 'shared_flag', + 'external_deleted_flag' => 'external_deleted_flag', + 'first_message_to_me_flag' => 'first_message_to_me_flag', + 'last_message_timestamp' => 'last_message_timestamp', + 'first_message_timestamp' => 'first_message_timestamp', + 'last_message_sent_timestamp' => 'last_message_sent_timestamp', + 'last_message_received_timestamp' => 'last_message_received_timestamp', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'deal_id' => 'deal_id', + 'deal_status' => 'deal_status', + 'lead_id' => 'lead_id', + 'all_messages_sent_flag' => 'all_messages_sent_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'account_id' => 'setAccountId', + 'user_id' => 'setUserId', + 'subject' => 'setSubject', + 'snippet' => 'setSnippet', + 'read_flag' => 'setReadFlag', + 'mail_tracking_status' => 'setMailTrackingStatus', + 'has_attachments_flag' => 'setHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'setHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'setHasRealAttachmentsFlag', + 'deleted_flag' => 'setDeletedFlag', + 'synced_flag' => 'setSyncedFlag', + 'smart_bcc_flag' => 'setSmartBccFlag', + 'mail_link_tracking_enabled_flag' => 'setMailLinkTrackingEnabledFlag', + 'parties' => 'setParties', + 'drafts_parties' => 'setDraftsParties', + 'folders' => 'setFolders', + 'version' => 'setVersion', + 'snippet_draft' => 'setSnippetDraft', + 'snippet_sent' => 'setSnippetSent', + 'message_count' => 'setMessageCount', + 'has_draft_flag' => 'setHasDraftFlag', + 'has_sent_flag' => 'setHasSentFlag', + 'archived_flag' => 'setArchivedFlag', + 'shared_flag' => 'setSharedFlag', + 'external_deleted_flag' => 'setExternalDeletedFlag', + 'first_message_to_me_flag' => 'setFirstMessageToMeFlag', + 'last_message_timestamp' => 'setLastMessageTimestamp', + 'first_message_timestamp' => 'setFirstMessageTimestamp', + 'last_message_sent_timestamp' => 'setLastMessageSentTimestamp', + 'last_message_received_timestamp' => 'setLastMessageReceivedTimestamp', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'deal_id' => 'setDealId', + 'deal_status' => 'setDealStatus', + 'lead_id' => 'setLeadId', + 'all_messages_sent_flag' => 'setAllMessagesSentFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'account_id' => 'getAccountId', + 'user_id' => 'getUserId', + 'subject' => 'getSubject', + 'snippet' => 'getSnippet', + 'read_flag' => 'getReadFlag', + 'mail_tracking_status' => 'getMailTrackingStatus', + 'has_attachments_flag' => 'getHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'getHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'getHasRealAttachmentsFlag', + 'deleted_flag' => 'getDeletedFlag', + 'synced_flag' => 'getSyncedFlag', + 'smart_bcc_flag' => 'getSmartBccFlag', + 'mail_link_tracking_enabled_flag' => 'getMailLinkTrackingEnabledFlag', + 'parties' => 'getParties', + 'drafts_parties' => 'getDraftsParties', + 'folders' => 'getFolders', + 'version' => 'getVersion', + 'snippet_draft' => 'getSnippetDraft', + 'snippet_sent' => 'getSnippetSent', + 'message_count' => 'getMessageCount', + 'has_draft_flag' => 'getHasDraftFlag', + 'has_sent_flag' => 'getHasSentFlag', + 'archived_flag' => 'getArchivedFlag', + 'shared_flag' => 'getSharedFlag', + 'external_deleted_flag' => 'getExternalDeletedFlag', + 'first_message_to_me_flag' => 'getFirstMessageToMeFlag', + 'last_message_timestamp' => 'getLastMessageTimestamp', + 'first_message_timestamp' => 'getFirstMessageTimestamp', + 'last_message_sent_timestamp' => 'getLastMessageSentTimestamp', + 'last_message_received_timestamp' => 'getLastMessageReceivedTimestamp', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'deal_id' => 'getDealId', + 'deal_status' => 'getDealStatus', + 'lead_id' => 'getLeadId', + 'all_messages_sent_flag' => 'getAllMessagesSentFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['account_id'] = $data['account_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['snippet'] = $data['snippet'] ?? null; + $this->container['read_flag'] = $data['read_flag'] ?? null; + $this->container['mail_tracking_status'] = $data['mail_tracking_status'] ?? null; + $this->container['has_attachments_flag'] = $data['has_attachments_flag'] ?? null; + $this->container['has_inline_attachments_flag'] = $data['has_inline_attachments_flag'] ?? null; + $this->container['has_real_attachments_flag'] = $data['has_real_attachments_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['synced_flag'] = $data['synced_flag'] ?? null; + $this->container['smart_bcc_flag'] = $data['smart_bcc_flag'] ?? null; + $this->container['mail_link_tracking_enabled_flag'] = $data['mail_link_tracking_enabled_flag'] ?? null; + $this->container['parties'] = $data['parties'] ?? null; + $this->container['drafts_parties'] = $data['drafts_parties'] ?? null; + $this->container['folders'] = $data['folders'] ?? null; + $this->container['version'] = $data['version'] ?? null; + $this->container['snippet_draft'] = $data['snippet_draft'] ?? null; + $this->container['snippet_sent'] = $data['snippet_sent'] ?? null; + $this->container['message_count'] = $data['message_count'] ?? null; + $this->container['has_draft_flag'] = $data['has_draft_flag'] ?? null; + $this->container['has_sent_flag'] = $data['has_sent_flag'] ?? null; + $this->container['archived_flag'] = $data['archived_flag'] ?? null; + $this->container['shared_flag'] = $data['shared_flag'] ?? null; + $this->container['external_deleted_flag'] = $data['external_deleted_flag'] ?? null; + $this->container['first_message_to_me_flag'] = $data['first_message_to_me_flag'] ?? null; + $this->container['last_message_timestamp'] = $data['last_message_timestamp'] ?? null; + $this->container['first_message_timestamp'] = $data['first_message_timestamp'] ?? null; + $this->container['last_message_sent_timestamp'] = $data['last_message_sent_timestamp'] ?? null; + $this->container['last_message_received_timestamp'] = $data['last_message_received_timestamp'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['deal_status'] = $data['deal_status'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['all_messages_sent_flag'] = $data['all_messages_sent_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail thread + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id The connection account ID + * + * @return self + */ + public function setAccountId($account_id): self + { + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id ID of the user whom mail message will be assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets snippet + * + * @return string|null + */ + public function getSnippet() + { + return $this->container['snippet']; + } + + /** + * Sets snippet + * + * @param string|null $snippet A snippet + * + * @return self + */ + public function setSnippet($snippet): self + { + $this->container['snippet'] = $snippet; + + return $this; + } + + /** + * Gets read_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getReadFlag() + { + return $this->container['read_flag']; + } + + /** + * Sets read_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $read_flag Whether the mail thread is read + * + * @return self + */ + public function setReadFlag($read_flag): self + { + $this->container['read_flag'] = $read_flag; + + return $this; + } + + /** + * Gets mail_tracking_status + * + * @return string|null + */ + public function getMailTrackingStatus() + { + return $this->container['mail_tracking_status']; + } + + /** + * Sets mail_tracking_status + * + * @param string|null $mail_tracking_status Mail tracking status + * + * @return self + */ + public function setMailTrackingStatus($mail_tracking_status): self + { + $this->container['mail_tracking_status'] = $mail_tracking_status; + + return $this; + } + + /** + * Gets has_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasAttachmentsFlag() + { + return $this->container['has_attachments_flag']; + } + + /** + * Sets has_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_attachments_flag Whether the mail thread has an attachment + * + * @return self + */ + public function setHasAttachmentsFlag($has_attachments_flag): self + { + $this->container['has_attachments_flag'] = $has_attachments_flag; + + return $this; + } + + /** + * Gets has_inline_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasInlineAttachmentsFlag() + { + return $this->container['has_inline_attachments_flag']; + } + + /** + * Sets has_inline_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_inline_attachments_flag Whether the mail thread has inline attachments + * + * @return self + */ + public function setHasInlineAttachmentsFlag($has_inline_attachments_flag): self + { + $this->container['has_inline_attachments_flag'] = $has_inline_attachments_flag; + + return $this; + } + + /** + * Gets has_real_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasRealAttachmentsFlag() + { + return $this->container['has_real_attachments_flag']; + } + + /** + * Sets has_real_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_real_attachments_flag Whether the mail thread has real attachments (which are not inline) + * + * @return self + */ + public function setHasRealAttachmentsFlag($has_real_attachments_flag): self + { + $this->container['has_real_attachments_flag'] = $has_real_attachments_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $deleted_flag Whether the mail thread is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets synced_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSyncedFlag() + { + return $this->container['synced_flag']; + } + + /** + * Sets synced_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $synced_flag Whether the mail thread is synced + * + * @return self + */ + public function setSyncedFlag($synced_flag): self + { + $this->container['synced_flag'] = $synced_flag; + + return $this; + } + + /** + * Gets smart_bcc_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSmartBccFlag() + { + return $this->container['smart_bcc_flag']; + } + + /** + * Sets smart_bcc_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $smart_bcc_flag Whether one of the parties of the mail thread is Bcc + * + * @return self + */ + public function setSmartBccFlag($smart_bcc_flag): self + { + $this->container['smart_bcc_flag'] = $smart_bcc_flag; + + return $this; + } + + /** + * Gets mail_link_tracking_enabled_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getMailLinkTrackingEnabledFlag() + { + return $this->container['mail_link_tracking_enabled_flag']; + } + + /** + * Sets mail_link_tracking_enabled_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $mail_link_tracking_enabled_flag Whether the link tracking of the mail thread is enabled + * + * @return self + */ + public function setMailLinkTrackingEnabledFlag($mail_link_tracking_enabled_flag): self + { + $this->container['mail_link_tracking_enabled_flag'] = $mail_link_tracking_enabled_flag; + + return $this; + } + + /** + * Gets parties + * + * @return \Pipedrive\Model\BaseMailThreadAllOfParties|null + */ + public function getParties() + { + return $this->container['parties']; + } + + /** + * Sets parties + * + * @param \Pipedrive\Model\BaseMailThreadAllOfParties|null $parties parties + * + * @return self + */ + public function setParties($parties): self + { + $this->container['parties'] = $parties; + + return $this; + } + + /** + * Gets drafts_parties + * + * @return object[]|null + */ + public function getDraftsParties() + { + return $this->container['drafts_parties']; + } + + /** + * Sets drafts_parties + * + * @param object[]|null $drafts_parties Parties of the drafted mail thread + * + * @return self + */ + public function setDraftsParties($drafts_parties): self + { + $this->container['drafts_parties'] = $drafts_parties; + + return $this; + } + + /** + * Gets folders + * + * @return string[]|null + */ + public function getFolders() + { + return $this->container['folders']; + } + + /** + * Sets folders + * + * @param string[]|null $folders Folders in which messages from thread are being stored + * + * @return self + */ + public function setFolders($folders): self + { + $this->container['folders'] = $folders; + + return $this; + } + + /** + * Gets version + * + * @return float|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param float|null $version Version + * + * @return self + */ + public function setVersion($version): self + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets snippet_draft + * + * @return string|null + */ + public function getSnippetDraft() + { + return $this->container['snippet_draft']; + } + + /** + * Sets snippet_draft + * + * @param string|null $snippet_draft A snippet from a draft + * + * @return self + */ + public function setSnippetDraft($snippet_draft): self + { + $this->container['snippet_draft'] = $snippet_draft; + + return $this; + } + + /** + * Gets snippet_sent + * + * @return string|null + */ + public function getSnippetSent() + { + return $this->container['snippet_sent']; + } + + /** + * Sets snippet_sent + * + * @param string|null $snippet_sent A snippet from a message sent + * + * @return self + */ + public function setSnippetSent($snippet_sent): self + { + $this->container['snippet_sent'] = $snippet_sent; + + return $this; + } + + /** + * Gets message_count + * + * @return int|null + */ + public function getMessageCount() + { + return $this->container['message_count']; + } + + /** + * Sets message_count + * + * @param int|null $message_count An amount of messages + * + * @return self + */ + public function setMessageCount($message_count): self + { + $this->container['message_count'] = $message_count; + + return $this; + } + + /** + * Gets has_draft_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasDraftFlag() + { + return $this->container['has_draft_flag']; + } + + /** + * Sets has_draft_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_draft_flag Whether the mail thread has any drafts + * + * @return self + */ + public function setHasDraftFlag($has_draft_flag): self + { + $this->container['has_draft_flag'] = $has_draft_flag; + + return $this; + } + + /** + * Gets has_sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasSentFlag() + { + return $this->container['has_sent_flag']; + } + + /** + * Sets has_sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_sent_flag Whether the mail thread has messages sent + * + * @return self + */ + public function setHasSentFlag($has_sent_flag): self + { + $this->container['has_sent_flag'] = $has_sent_flag; + + return $this; + } + + /** + * Gets archived_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getArchivedFlag() + { + return $this->container['archived_flag']; + } + + /** + * Sets archived_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $archived_flag Whether the mail thread is archived + * + * @return self + */ + public function setArchivedFlag($archived_flag): self + { + $this->container['archived_flag'] = $archived_flag; + + return $this; + } + + /** + * Gets shared_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSharedFlag() + { + return $this->container['shared_flag']; + } + + /** + * Sets shared_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $shared_flag Whether the mail thread is shared + * + * @return self + */ + public function setSharedFlag($shared_flag): self + { + $this->container['shared_flag'] = $shared_flag; + + return $this; + } + + /** + * Gets external_deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getExternalDeletedFlag() + { + return $this->container['external_deleted_flag']; + } + + /** + * Sets external_deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $external_deleted_flag Whether the mail thread has been deleted externally + * + * @return self + */ + public function setExternalDeletedFlag($external_deleted_flag): self + { + $this->container['external_deleted_flag'] = $external_deleted_flag; + + return $this; + } + + /** + * Gets first_message_to_me_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getFirstMessageToMeFlag() + { + return $this->container['first_message_to_me_flag']; + } + + /** + * Sets first_message_to_me_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $first_message_to_me_flag Whether the mail thread was initialized by others + * + * @return self + */ + public function setFirstMessageToMeFlag($first_message_to_me_flag): self + { + $this->container['first_message_to_me_flag'] = $first_message_to_me_flag; + + return $this; + } + + /** + * Gets last_message_timestamp + * + * @return \DateTime|null + */ + public function getLastMessageTimestamp() + { + return $this->container['last_message_timestamp']; + } + + /** + * Sets last_message_timestamp + * + * @param \DateTime|null $last_message_timestamp Last message timestamp + * + * @return self + */ + public function setLastMessageTimestamp($last_message_timestamp): self + { + $this->container['last_message_timestamp'] = $last_message_timestamp; + + return $this; + } + + /** + * Gets first_message_timestamp + * + * @return \DateTime|null + */ + public function getFirstMessageTimestamp() + { + return $this->container['first_message_timestamp']; + } + + /** + * Sets first_message_timestamp + * + * @param \DateTime|null $first_message_timestamp The time when the mail thread has had the first message received or created + * + * @return self + */ + public function setFirstMessageTimestamp($first_message_timestamp): self + { + $this->container['first_message_timestamp'] = $first_message_timestamp; + + return $this; + } + + /** + * Gets last_message_sent_timestamp + * + * @return \DateTime|null + */ + public function getLastMessageSentTimestamp() + { + return $this->container['last_message_sent_timestamp']; + } + + /** + * Sets last_message_sent_timestamp + * + * @param \DateTime|null $last_message_sent_timestamp The last time when the mail thread has had a message sent + * + * @return self + */ + public function setLastMessageSentTimestamp($last_message_sent_timestamp): self + { + $this->container['last_message_sent_timestamp'] = $last_message_sent_timestamp; + + return $this; + } + + /** + * Gets last_message_received_timestamp + * + * @return \DateTime|null + */ + public function getLastMessageReceivedTimestamp() + { + return $this->container['last_message_received_timestamp']; + } + + /** + * Sets last_message_received_timestamp + * + * @param \DateTime|null $last_message_received_timestamp The last time when the mail thread has had a message received + * + * @return self + */ + public function setLastMessageReceivedTimestamp($last_message_received_timestamp): self + { + $this->container['last_message_received_timestamp'] = $last_message_received_timestamp; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The time when the mail thread was inserted to database + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The time when the mail thread was updated in database received + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets deal_status + * + * @return string|null + */ + public function getDealStatus() + { + return $this->container['deal_status']; + } + + /** + * Sets deal_status + * + * @param string|null $deal_status Status of the deal + * + * @return self + */ + public function setDealStatus($deal_status): self + { + $this->container['deal_status'] = $deal_status; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets all_messages_sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getAllMessagesSentFlag() + { + return $this->container['all_messages_sent_flag']; + } + + /** + * Sets all_messages_sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $all_messages_sent_flag Whether all the mail thread messages have been sent + * + * @return self + */ + public function setAllMessagesSentFlag($all_messages_sent_flag): self + { + $this->container['all_messages_sent_flag'] = $all_messages_sent_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseMailThreadAllOf.php b/lib/Model/BaseMailThreadAllOf.php new file mode 100644 index 00000000..0766aa91 --- /dev/null +++ b/lib/Model/BaseMailThreadAllOf.php @@ -0,0 +1,1002 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseMailThreadAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseMailThread_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'parties' => '\Pipedrive\Model\BaseMailThreadAllOfParties', + 'drafts_parties' => 'object[]', + 'folders' => 'string[]', + 'version' => 'float', + 'snippet_draft' => 'string', + 'snippet_sent' => 'string', + 'message_count' => 'int', + 'has_draft_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'archived_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'shared_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'external_deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'first_message_to_me_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'last_message_timestamp' => '\DateTime', + 'first_message_timestamp' => '\DateTime', + 'last_message_sent_timestamp' => '\DateTime', + 'last_message_received_timestamp' => '\DateTime', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime', + 'deal_id' => 'int', + 'deal_status' => 'string', + 'lead_id' => 'string', + 'all_messages_sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'parties' => null, + 'drafts_parties' => null, + 'folders' => null, + 'version' => null, + 'snippet_draft' => null, + 'snippet_sent' => null, + 'message_count' => null, + 'has_draft_flag' => null, + 'has_sent_flag' => null, + 'archived_flag' => null, + 'shared_flag' => null, + 'external_deleted_flag' => null, + 'first_message_to_me_flag' => null, + 'last_message_timestamp' => 'date-time', + 'first_message_timestamp' => 'date-time', + 'last_message_sent_timestamp' => 'date-time', + 'last_message_received_timestamp' => 'date-time', + 'add_time' => 'date-time', + 'update_time' => 'date-time', + 'deal_id' => null, + 'deal_status' => null, + 'lead_id' => 'uuid', + 'all_messages_sent_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'parties' => 'parties', + 'drafts_parties' => 'drafts_parties', + 'folders' => 'folders', + 'version' => 'version', + 'snippet_draft' => 'snippet_draft', + 'snippet_sent' => 'snippet_sent', + 'message_count' => 'message_count', + 'has_draft_flag' => 'has_draft_flag', + 'has_sent_flag' => 'has_sent_flag', + 'archived_flag' => 'archived_flag', + 'shared_flag' => 'shared_flag', + 'external_deleted_flag' => 'external_deleted_flag', + 'first_message_to_me_flag' => 'first_message_to_me_flag', + 'last_message_timestamp' => 'last_message_timestamp', + 'first_message_timestamp' => 'first_message_timestamp', + 'last_message_sent_timestamp' => 'last_message_sent_timestamp', + 'last_message_received_timestamp' => 'last_message_received_timestamp', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'deal_id' => 'deal_id', + 'deal_status' => 'deal_status', + 'lead_id' => 'lead_id', + 'all_messages_sent_flag' => 'all_messages_sent_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'parties' => 'setParties', + 'drafts_parties' => 'setDraftsParties', + 'folders' => 'setFolders', + 'version' => 'setVersion', + 'snippet_draft' => 'setSnippetDraft', + 'snippet_sent' => 'setSnippetSent', + 'message_count' => 'setMessageCount', + 'has_draft_flag' => 'setHasDraftFlag', + 'has_sent_flag' => 'setHasSentFlag', + 'archived_flag' => 'setArchivedFlag', + 'shared_flag' => 'setSharedFlag', + 'external_deleted_flag' => 'setExternalDeletedFlag', + 'first_message_to_me_flag' => 'setFirstMessageToMeFlag', + 'last_message_timestamp' => 'setLastMessageTimestamp', + 'first_message_timestamp' => 'setFirstMessageTimestamp', + 'last_message_sent_timestamp' => 'setLastMessageSentTimestamp', + 'last_message_received_timestamp' => 'setLastMessageReceivedTimestamp', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'deal_id' => 'setDealId', + 'deal_status' => 'setDealStatus', + 'lead_id' => 'setLeadId', + 'all_messages_sent_flag' => 'setAllMessagesSentFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'parties' => 'getParties', + 'drafts_parties' => 'getDraftsParties', + 'folders' => 'getFolders', + 'version' => 'getVersion', + 'snippet_draft' => 'getSnippetDraft', + 'snippet_sent' => 'getSnippetSent', + 'message_count' => 'getMessageCount', + 'has_draft_flag' => 'getHasDraftFlag', + 'has_sent_flag' => 'getHasSentFlag', + 'archived_flag' => 'getArchivedFlag', + 'shared_flag' => 'getSharedFlag', + 'external_deleted_flag' => 'getExternalDeletedFlag', + 'first_message_to_me_flag' => 'getFirstMessageToMeFlag', + 'last_message_timestamp' => 'getLastMessageTimestamp', + 'first_message_timestamp' => 'getFirstMessageTimestamp', + 'last_message_sent_timestamp' => 'getLastMessageSentTimestamp', + 'last_message_received_timestamp' => 'getLastMessageReceivedTimestamp', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'deal_id' => 'getDealId', + 'deal_status' => 'getDealStatus', + 'lead_id' => 'getLeadId', + 'all_messages_sent_flag' => 'getAllMessagesSentFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['parties'] = $data['parties'] ?? null; + $this->container['drafts_parties'] = $data['drafts_parties'] ?? null; + $this->container['folders'] = $data['folders'] ?? null; + $this->container['version'] = $data['version'] ?? null; + $this->container['snippet_draft'] = $data['snippet_draft'] ?? null; + $this->container['snippet_sent'] = $data['snippet_sent'] ?? null; + $this->container['message_count'] = $data['message_count'] ?? null; + $this->container['has_draft_flag'] = $data['has_draft_flag'] ?? null; + $this->container['has_sent_flag'] = $data['has_sent_flag'] ?? null; + $this->container['archived_flag'] = $data['archived_flag'] ?? null; + $this->container['shared_flag'] = $data['shared_flag'] ?? null; + $this->container['external_deleted_flag'] = $data['external_deleted_flag'] ?? null; + $this->container['first_message_to_me_flag'] = $data['first_message_to_me_flag'] ?? null; + $this->container['last_message_timestamp'] = $data['last_message_timestamp'] ?? null; + $this->container['first_message_timestamp'] = $data['first_message_timestamp'] ?? null; + $this->container['last_message_sent_timestamp'] = $data['last_message_sent_timestamp'] ?? null; + $this->container['last_message_received_timestamp'] = $data['last_message_received_timestamp'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['deal_status'] = $data['deal_status'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['all_messages_sent_flag'] = $data['all_messages_sent_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets parties + * + * @return \Pipedrive\Model\BaseMailThreadAllOfParties|null + */ + public function getParties() + { + return $this->container['parties']; + } + + /** + * Sets parties + * + * @param \Pipedrive\Model\BaseMailThreadAllOfParties|null $parties parties + * + * @return self + */ + public function setParties($parties): self + { + $this->container['parties'] = $parties; + + return $this; + } + + /** + * Gets drafts_parties + * + * @return object[]|null + */ + public function getDraftsParties() + { + return $this->container['drafts_parties']; + } + + /** + * Sets drafts_parties + * + * @param object[]|null $drafts_parties Parties of the drafted mail thread + * + * @return self + */ + public function setDraftsParties($drafts_parties): self + { + $this->container['drafts_parties'] = $drafts_parties; + + return $this; + } + + /** + * Gets folders + * + * @return string[]|null + */ + public function getFolders() + { + return $this->container['folders']; + } + + /** + * Sets folders + * + * @param string[]|null $folders Folders in which messages from thread are being stored + * + * @return self + */ + public function setFolders($folders): self + { + $this->container['folders'] = $folders; + + return $this; + } + + /** + * Gets version + * + * @return float|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param float|null $version Version + * + * @return self + */ + public function setVersion($version): self + { + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets snippet_draft + * + * @return string|null + */ + public function getSnippetDraft() + { + return $this->container['snippet_draft']; + } + + /** + * Sets snippet_draft + * + * @param string|null $snippet_draft A snippet from a draft + * + * @return self + */ + public function setSnippetDraft($snippet_draft): self + { + $this->container['snippet_draft'] = $snippet_draft; + + return $this; + } + + /** + * Gets snippet_sent + * + * @return string|null + */ + public function getSnippetSent() + { + return $this->container['snippet_sent']; + } + + /** + * Sets snippet_sent + * + * @param string|null $snippet_sent A snippet from a message sent + * + * @return self + */ + public function setSnippetSent($snippet_sent): self + { + $this->container['snippet_sent'] = $snippet_sent; + + return $this; + } + + /** + * Gets message_count + * + * @return int|null + */ + public function getMessageCount() + { + return $this->container['message_count']; + } + + /** + * Sets message_count + * + * @param int|null $message_count An amount of messages + * + * @return self + */ + public function setMessageCount($message_count): self + { + $this->container['message_count'] = $message_count; + + return $this; + } + + /** + * Gets has_draft_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasDraftFlag() + { + return $this->container['has_draft_flag']; + } + + /** + * Sets has_draft_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_draft_flag Whether the mail thread has any drafts + * + * @return self + */ + public function setHasDraftFlag($has_draft_flag): self + { + $this->container['has_draft_flag'] = $has_draft_flag; + + return $this; + } + + /** + * Gets has_sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasSentFlag() + { + return $this->container['has_sent_flag']; + } + + /** + * Sets has_sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_sent_flag Whether the mail thread has messages sent + * + * @return self + */ + public function setHasSentFlag($has_sent_flag): self + { + $this->container['has_sent_flag'] = $has_sent_flag; + + return $this; + } + + /** + * Gets archived_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getArchivedFlag() + { + return $this->container['archived_flag']; + } + + /** + * Sets archived_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $archived_flag Whether the mail thread is archived + * + * @return self + */ + public function setArchivedFlag($archived_flag): self + { + $this->container['archived_flag'] = $archived_flag; + + return $this; + } + + /** + * Gets shared_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSharedFlag() + { + return $this->container['shared_flag']; + } + + /** + * Sets shared_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $shared_flag Whether the mail thread is shared + * + * @return self + */ + public function setSharedFlag($shared_flag): self + { + $this->container['shared_flag'] = $shared_flag; + + return $this; + } + + /** + * Gets external_deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getExternalDeletedFlag() + { + return $this->container['external_deleted_flag']; + } + + /** + * Sets external_deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $external_deleted_flag Whether the mail thread has been deleted externally + * + * @return self + */ + public function setExternalDeletedFlag($external_deleted_flag): self + { + $this->container['external_deleted_flag'] = $external_deleted_flag; + + return $this; + } + + /** + * Gets first_message_to_me_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getFirstMessageToMeFlag() + { + return $this->container['first_message_to_me_flag']; + } + + /** + * Sets first_message_to_me_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $first_message_to_me_flag Whether the mail thread was initialized by others + * + * @return self + */ + public function setFirstMessageToMeFlag($first_message_to_me_flag): self + { + $this->container['first_message_to_me_flag'] = $first_message_to_me_flag; + + return $this; + } + + /** + * Gets last_message_timestamp + * + * @return \DateTime|null + */ + public function getLastMessageTimestamp() + { + return $this->container['last_message_timestamp']; + } + + /** + * Sets last_message_timestamp + * + * @param \DateTime|null $last_message_timestamp Last message timestamp + * + * @return self + */ + public function setLastMessageTimestamp($last_message_timestamp): self + { + $this->container['last_message_timestamp'] = $last_message_timestamp; + + return $this; + } + + /** + * Gets first_message_timestamp + * + * @return \DateTime|null + */ + public function getFirstMessageTimestamp() + { + return $this->container['first_message_timestamp']; + } + + /** + * Sets first_message_timestamp + * + * @param \DateTime|null $first_message_timestamp The time when the mail thread has had the first message received or created + * + * @return self + */ + public function setFirstMessageTimestamp($first_message_timestamp): self + { + $this->container['first_message_timestamp'] = $first_message_timestamp; + + return $this; + } + + /** + * Gets last_message_sent_timestamp + * + * @return \DateTime|null + */ + public function getLastMessageSentTimestamp() + { + return $this->container['last_message_sent_timestamp']; + } + + /** + * Sets last_message_sent_timestamp + * + * @param \DateTime|null $last_message_sent_timestamp The last time when the mail thread has had a message sent + * + * @return self + */ + public function setLastMessageSentTimestamp($last_message_sent_timestamp): self + { + $this->container['last_message_sent_timestamp'] = $last_message_sent_timestamp; + + return $this; + } + + /** + * Gets last_message_received_timestamp + * + * @return \DateTime|null + */ + public function getLastMessageReceivedTimestamp() + { + return $this->container['last_message_received_timestamp']; + } + + /** + * Sets last_message_received_timestamp + * + * @param \DateTime|null $last_message_received_timestamp The last time when the mail thread has had a message received + * + * @return self + */ + public function setLastMessageReceivedTimestamp($last_message_received_timestamp): self + { + $this->container['last_message_received_timestamp'] = $last_message_received_timestamp; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The time when the mail thread was inserted to database + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The time when the mail thread was updated in database received + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets deal_status + * + * @return string|null + */ + public function getDealStatus() + { + return $this->container['deal_status']; + } + + /** + * Sets deal_status + * + * @param string|null $deal_status Status of the deal + * + * @return self + */ + public function setDealStatus($deal_status): self + { + $this->container['deal_status'] = $deal_status; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets all_messages_sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getAllMessagesSentFlag() + { + return $this->container['all_messages_sent_flag']; + } + + /** + * Sets all_messages_sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $all_messages_sent_flag Whether all the mail thread messages have been sent + * + * @return self + */ + public function setAllMessagesSentFlag($all_messages_sent_flag): self + { + $this->container['all_messages_sent_flag'] = $all_messages_sent_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseMailThreadAllOfParties.php b/lib/Model/BaseMailThreadAllOfParties.php new file mode 100644 index 00000000..23da7a74 --- /dev/null +++ b/lib/Model/BaseMailThreadAllOfParties.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseMailThreadAllOfParties implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseMailThread_allOf_parties'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'to' => '\Pipedrive\Model\MailThreadParticipant[]', + 'from' => '\Pipedrive\Model\MailThreadParticipant[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'to' => null, + 'from' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'to' => 'to', + 'from' => 'from' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'to' => 'setTo', + 'from' => 'setFrom' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'to' => 'getTo', + 'from' => 'getFrom' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['to'] = $data['to'] ?? null; + $this->container['from'] = $data['from'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets to + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $to Recipients of the mail thread + * + * @return self + */ + public function setTo($to): self + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets from + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $from Senders of the mail thread + * + * @return self + */ + public function setFrom($from): self + { + $this->container['from'] = $from; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseMailThreadMessages.php b/lib/Model/BaseMailThreadMessages.php new file mode 100644 index 00000000..835ed101 --- /dev/null +++ b/lib/Model/BaseMailThreadMessages.php @@ -0,0 +1,1122 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseMailThreadMessages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseMailThreadMessages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'account_id' => 'string', + 'user_id' => 'int', + 'subject' => 'string', + 'snippet' => 'string', + 'read_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'mail_tracking_status' => 'string', + 'has_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_inline_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_real_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'synced_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'smart_bcc_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'mail_link_tracking_enabled_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'from' => '\Pipedrive\Model\MailThreadParticipant[]', + 'to' => '\Pipedrive\Model\MailThreadParticipant[]', + 'cc' => '\Pipedrive\Model\MailThreadParticipant[]', + 'bcc' => '\Pipedrive\Model\MailThreadParticipant[]', + 'body_url' => 'string', + 'mail_thread_id' => 'int', + 'draft' => 'string', + 'has_body_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_from_pipedrive_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'message_time' => '\DateTime', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'account_id' => null, + 'user_id' => null, + 'subject' => null, + 'snippet' => null, + 'read_flag' => null, + 'mail_tracking_status' => null, + 'has_attachments_flag' => null, + 'has_inline_attachments_flag' => null, + 'has_real_attachments_flag' => null, + 'deleted_flag' => null, + 'synced_flag' => null, + 'smart_bcc_flag' => null, + 'mail_link_tracking_enabled_flag' => null, + 'from' => null, + 'to' => null, + 'cc' => null, + 'bcc' => null, + 'body_url' => null, + 'mail_thread_id' => null, + 'draft' => null, + 'has_body_flag' => null, + 'sent_flag' => null, + 'sent_from_pipedrive_flag' => null, + 'message_time' => 'date-time', + 'add_time' => 'date-time', + 'update_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'account_id' => 'account_id', + 'user_id' => 'user_id', + 'subject' => 'subject', + 'snippet' => 'snippet', + 'read_flag' => 'read_flag', + 'mail_tracking_status' => 'mail_tracking_status', + 'has_attachments_flag' => 'has_attachments_flag', + 'has_inline_attachments_flag' => 'has_inline_attachments_flag', + 'has_real_attachments_flag' => 'has_real_attachments_flag', + 'deleted_flag' => 'deleted_flag', + 'synced_flag' => 'synced_flag', + 'smart_bcc_flag' => 'smart_bcc_flag', + 'mail_link_tracking_enabled_flag' => 'mail_link_tracking_enabled_flag', + 'from' => 'from', + 'to' => 'to', + 'cc' => 'cc', + 'bcc' => 'bcc', + 'body_url' => 'body_url', + 'mail_thread_id' => 'mail_thread_id', + 'draft' => 'draft', + 'has_body_flag' => 'has_body_flag', + 'sent_flag' => 'sent_flag', + 'sent_from_pipedrive_flag' => 'sent_from_pipedrive_flag', + 'message_time' => 'message_time', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'account_id' => 'setAccountId', + 'user_id' => 'setUserId', + 'subject' => 'setSubject', + 'snippet' => 'setSnippet', + 'read_flag' => 'setReadFlag', + 'mail_tracking_status' => 'setMailTrackingStatus', + 'has_attachments_flag' => 'setHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'setHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'setHasRealAttachmentsFlag', + 'deleted_flag' => 'setDeletedFlag', + 'synced_flag' => 'setSyncedFlag', + 'smart_bcc_flag' => 'setSmartBccFlag', + 'mail_link_tracking_enabled_flag' => 'setMailLinkTrackingEnabledFlag', + 'from' => 'setFrom', + 'to' => 'setTo', + 'cc' => 'setCc', + 'bcc' => 'setBcc', + 'body_url' => 'setBodyUrl', + 'mail_thread_id' => 'setMailThreadId', + 'draft' => 'setDraft', + 'has_body_flag' => 'setHasBodyFlag', + 'sent_flag' => 'setSentFlag', + 'sent_from_pipedrive_flag' => 'setSentFromPipedriveFlag', + 'message_time' => 'setMessageTime', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'account_id' => 'getAccountId', + 'user_id' => 'getUserId', + 'subject' => 'getSubject', + 'snippet' => 'getSnippet', + 'read_flag' => 'getReadFlag', + 'mail_tracking_status' => 'getMailTrackingStatus', + 'has_attachments_flag' => 'getHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'getHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'getHasRealAttachmentsFlag', + 'deleted_flag' => 'getDeletedFlag', + 'synced_flag' => 'getSyncedFlag', + 'smart_bcc_flag' => 'getSmartBccFlag', + 'mail_link_tracking_enabled_flag' => 'getMailLinkTrackingEnabledFlag', + 'from' => 'getFrom', + 'to' => 'getTo', + 'cc' => 'getCc', + 'bcc' => 'getBcc', + 'body_url' => 'getBodyUrl', + 'mail_thread_id' => 'getMailThreadId', + 'draft' => 'getDraft', + 'has_body_flag' => 'getHasBodyFlag', + 'sent_flag' => 'getSentFlag', + 'sent_from_pipedrive_flag' => 'getSentFromPipedriveFlag', + 'message_time' => 'getMessageTime', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['account_id'] = $data['account_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['snippet'] = $data['snippet'] ?? null; + $this->container['read_flag'] = $data['read_flag'] ?? null; + $this->container['mail_tracking_status'] = $data['mail_tracking_status'] ?? null; + $this->container['has_attachments_flag'] = $data['has_attachments_flag'] ?? null; + $this->container['has_inline_attachments_flag'] = $data['has_inline_attachments_flag'] ?? null; + $this->container['has_real_attachments_flag'] = $data['has_real_attachments_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['synced_flag'] = $data['synced_flag'] ?? null; + $this->container['smart_bcc_flag'] = $data['smart_bcc_flag'] ?? null; + $this->container['mail_link_tracking_enabled_flag'] = $data['mail_link_tracking_enabled_flag'] ?? null; + $this->container['from'] = $data['from'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['cc'] = $data['cc'] ?? null; + $this->container['bcc'] = $data['bcc'] ?? null; + $this->container['body_url'] = $data['body_url'] ?? null; + $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null; + $this->container['draft'] = $data['draft'] ?? null; + $this->container['has_body_flag'] = $data['has_body_flag'] ?? null; + $this->container['sent_flag'] = $data['sent_flag'] ?? null; + $this->container['sent_from_pipedrive_flag'] = $data['sent_from_pipedrive_flag'] ?? null; + $this->container['message_time'] = $data['message_time'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail thread + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id The connection account ID + * + * @return self + */ + public function setAccountId($account_id): self + { + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id ID of the user whom mail message will be assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets snippet + * + * @return string|null + */ + public function getSnippet() + { + return $this->container['snippet']; + } + + /** + * Sets snippet + * + * @param string|null $snippet A snippet + * + * @return self + */ + public function setSnippet($snippet): self + { + $this->container['snippet'] = $snippet; + + return $this; + } + + /** + * Gets read_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getReadFlag() + { + return $this->container['read_flag']; + } + + /** + * Sets read_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $read_flag Whether the mail thread is read + * + * @return self + */ + public function setReadFlag($read_flag): self + { + $this->container['read_flag'] = $read_flag; + + return $this; + } + + /** + * Gets mail_tracking_status + * + * @return string|null + */ + public function getMailTrackingStatus() + { + return $this->container['mail_tracking_status']; + } + + /** + * Sets mail_tracking_status + * + * @param string|null $mail_tracking_status Mail tracking status + * + * @return self + */ + public function setMailTrackingStatus($mail_tracking_status): self + { + $this->container['mail_tracking_status'] = $mail_tracking_status; + + return $this; + } + + /** + * Gets has_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasAttachmentsFlag() + { + return $this->container['has_attachments_flag']; + } + + /** + * Sets has_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_attachments_flag Whether the mail thread has an attachment + * + * @return self + */ + public function setHasAttachmentsFlag($has_attachments_flag): self + { + $this->container['has_attachments_flag'] = $has_attachments_flag; + + return $this; + } + + /** + * Gets has_inline_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasInlineAttachmentsFlag() + { + return $this->container['has_inline_attachments_flag']; + } + + /** + * Sets has_inline_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_inline_attachments_flag Whether the mail thread has inline attachments + * + * @return self + */ + public function setHasInlineAttachmentsFlag($has_inline_attachments_flag): self + { + $this->container['has_inline_attachments_flag'] = $has_inline_attachments_flag; + + return $this; + } + + /** + * Gets has_real_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasRealAttachmentsFlag() + { + return $this->container['has_real_attachments_flag']; + } + + /** + * Sets has_real_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_real_attachments_flag Whether the mail thread has real attachments (which are not inline) + * + * @return self + */ + public function setHasRealAttachmentsFlag($has_real_attachments_flag): self + { + $this->container['has_real_attachments_flag'] = $has_real_attachments_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $deleted_flag Whether the mail thread is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets synced_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSyncedFlag() + { + return $this->container['synced_flag']; + } + + /** + * Sets synced_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $synced_flag Whether the mail thread is synced + * + * @return self + */ + public function setSyncedFlag($synced_flag): self + { + $this->container['synced_flag'] = $synced_flag; + + return $this; + } + + /** + * Gets smart_bcc_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSmartBccFlag() + { + return $this->container['smart_bcc_flag']; + } + + /** + * Sets smart_bcc_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $smart_bcc_flag Whether one of the parties of the mail thread is Bcc + * + * @return self + */ + public function setSmartBccFlag($smart_bcc_flag): self + { + $this->container['smart_bcc_flag'] = $smart_bcc_flag; + + return $this; + } + + /** + * Gets mail_link_tracking_enabled_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getMailLinkTrackingEnabledFlag() + { + return $this->container['mail_link_tracking_enabled_flag']; + } + + /** + * Sets mail_link_tracking_enabled_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $mail_link_tracking_enabled_flag Whether the link tracking of the mail thread is enabled + * + * @return self + */ + public function setMailLinkTrackingEnabledFlag($mail_link_tracking_enabled_flag): self + { + $this->container['mail_link_tracking_enabled_flag'] = $mail_link_tracking_enabled_flag; + + return $this; + } + + /** + * Gets from + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $from Senders of the mail thread + * + * @return self + */ + public function setFrom($from): self + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $to Recipients of the mail thread + * + * @return self + */ + public function setTo($to): self + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets cc + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $cc Participants of the Cc + * + * @return self + */ + public function setCc($cc): self + { + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets bcc + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getBcc() + { + return $this->container['bcc']; + } + + /** + * Sets bcc + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $bcc Participants of the Bcc + * + * @return self + */ + public function setBcc($bcc): self + { + $this->container['bcc'] = $bcc; + + return $this; + } + + /** + * Gets body_url + * + * @return string|null + */ + public function getBodyUrl() + { + return $this->container['body_url']; + } + + /** + * Sets body_url + * + * @param string|null $body_url A link to the mail thread message + * + * @return self + */ + public function setBodyUrl($body_url): self + { + $this->container['body_url'] = $body_url; + + return $this; + } + + /** + * Gets mail_thread_id + * + * @return int|null + */ + public function getMailThreadId() + { + return $this->container['mail_thread_id']; + } + + /** + * Sets mail_thread_id + * + * @param int|null $mail_thread_id ID of the mail thread + * + * @return self + */ + public function setMailThreadId($mail_thread_id): self + { + $this->container['mail_thread_id'] = $mail_thread_id; + + return $this; + } + + /** + * Gets draft + * + * @return string|null + */ + public function getDraft() + { + return $this->container['draft']; + } + + /** + * Sets draft + * + * @param string|null $draft If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. + * + * @return self + */ + public function setDraft($draft): self + { + $this->container['draft'] = $draft; + + return $this; + } + + /** + * Gets has_body_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasBodyFlag() + { + return $this->container['has_body_flag']; + } + + /** + * Sets has_body_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_body_flag Whether the mail thread message has a body + * + * @return self + */ + public function setHasBodyFlag($has_body_flag): self + { + $this->container['has_body_flag'] = $has_body_flag; + + return $this; + } + + /** + * Gets sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFlag() + { + return $this->container['sent_flag']; + } + + /** + * Sets sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_flag Whether the mail thread message is sent + * + * @return self + */ + public function setSentFlag($sent_flag): self + { + $this->container['sent_flag'] = $sent_flag; + + return $this; + } + + /** + * Gets sent_from_pipedrive_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFromPipedriveFlag() + { + return $this->container['sent_from_pipedrive_flag']; + } + + /** + * Sets sent_from_pipedrive_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_from_pipedrive_flag Whether the mail thread message is sent from Pipedrive + * + * @return self + */ + public function setSentFromPipedriveFlag($sent_from_pipedrive_flag): self + { + $this->container['sent_from_pipedrive_flag'] = $sent_from_pipedrive_flag; + + return $this; + } + + /** + * Gets message_time + * + * @return \DateTime|null + */ + public function getMessageTime() + { + return $this->container['message_time']; + } + + /** + * Sets message_time + * + * @param \DateTime|null $message_time The time when the mail message was received or created + * + * @return self + */ + public function setMessageTime($message_time): self + { + $this->container['message_time'] = $message_time; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The time when the mail message was inserted to database + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The time when the mail message was updated in database received + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseMailThreadMessagesAllOf.php b/lib/Model/BaseMailThreadMessagesAllOf.php new file mode 100644 index 00000000..716f3fd5 --- /dev/null +++ b/lib/Model/BaseMailThreadMessagesAllOf.php @@ -0,0 +1,702 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseMailThreadMessagesAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseMailThreadMessages_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'from' => '\Pipedrive\Model\MailThreadParticipant[]', + 'to' => '\Pipedrive\Model\MailThreadParticipant[]', + 'cc' => '\Pipedrive\Model\MailThreadParticipant[]', + 'bcc' => '\Pipedrive\Model\MailThreadParticipant[]', + 'body_url' => 'string', + 'mail_thread_id' => 'int', + 'draft' => 'string', + 'has_body_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_from_pipedrive_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'message_time' => '\DateTime', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from' => null, + 'to' => null, + 'cc' => null, + 'bcc' => null, + 'body_url' => null, + 'mail_thread_id' => null, + 'draft' => null, + 'has_body_flag' => null, + 'sent_flag' => null, + 'sent_from_pipedrive_flag' => null, + 'message_time' => 'date-time', + 'add_time' => 'date-time', + 'update_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from' => 'from', + 'to' => 'to', + 'cc' => 'cc', + 'bcc' => 'bcc', + 'body_url' => 'body_url', + 'mail_thread_id' => 'mail_thread_id', + 'draft' => 'draft', + 'has_body_flag' => 'has_body_flag', + 'sent_flag' => 'sent_flag', + 'sent_from_pipedrive_flag' => 'sent_from_pipedrive_flag', + 'message_time' => 'message_time', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from' => 'setFrom', + 'to' => 'setTo', + 'cc' => 'setCc', + 'bcc' => 'setBcc', + 'body_url' => 'setBodyUrl', + 'mail_thread_id' => 'setMailThreadId', + 'draft' => 'setDraft', + 'has_body_flag' => 'setHasBodyFlag', + 'sent_flag' => 'setSentFlag', + 'sent_from_pipedrive_flag' => 'setSentFromPipedriveFlag', + 'message_time' => 'setMessageTime', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from' => 'getFrom', + 'to' => 'getTo', + 'cc' => 'getCc', + 'bcc' => 'getBcc', + 'body_url' => 'getBodyUrl', + 'mail_thread_id' => 'getMailThreadId', + 'draft' => 'getDraft', + 'has_body_flag' => 'getHasBodyFlag', + 'sent_flag' => 'getSentFlag', + 'sent_from_pipedrive_flag' => 'getSentFromPipedriveFlag', + 'message_time' => 'getMessageTime', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['from'] = $data['from'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['cc'] = $data['cc'] ?? null; + $this->container['bcc'] = $data['bcc'] ?? null; + $this->container['body_url'] = $data['body_url'] ?? null; + $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null; + $this->container['draft'] = $data['draft'] ?? null; + $this->container['has_body_flag'] = $data['has_body_flag'] ?? null; + $this->container['sent_flag'] = $data['sent_flag'] ?? null; + $this->container['sent_from_pipedrive_flag'] = $data['sent_from_pipedrive_flag'] ?? null; + $this->container['message_time'] = $data['message_time'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $from Senders of the mail thread + * + * @return self + */ + public function setFrom($from): self + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $to Recipients of the mail thread + * + * @return self + */ + public function setTo($to): self + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets cc + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $cc Participants of the Cc + * + * @return self + */ + public function setCc($cc): self + { + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets bcc + * + * @return \Pipedrive\Model\MailThreadParticipant[]|null + */ + public function getBcc() + { + return $this->container['bcc']; + } + + /** + * Sets bcc + * + * @param \Pipedrive\Model\MailThreadParticipant[]|null $bcc Participants of the Bcc + * + * @return self + */ + public function setBcc($bcc): self + { + $this->container['bcc'] = $bcc; + + return $this; + } + + /** + * Gets body_url + * + * @return string|null + */ + public function getBodyUrl() + { + return $this->container['body_url']; + } + + /** + * Sets body_url + * + * @param string|null $body_url A link to the mail thread message + * + * @return self + */ + public function setBodyUrl($body_url): self + { + $this->container['body_url'] = $body_url; + + return $this; + } + + /** + * Gets mail_thread_id + * + * @return int|null + */ + public function getMailThreadId() + { + return $this->container['mail_thread_id']; + } + + /** + * Sets mail_thread_id + * + * @param int|null $mail_thread_id ID of the mail thread + * + * @return self + */ + public function setMailThreadId($mail_thread_id): self + { + $this->container['mail_thread_id'] = $mail_thread_id; + + return $this; + } + + /** + * Gets draft + * + * @return string|null + */ + public function getDraft() + { + return $this->container['draft']; + } + + /** + * Sets draft + * + * @param string|null $draft If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. + * + * @return self + */ + public function setDraft($draft): self + { + $this->container['draft'] = $draft; + + return $this; + } + + /** + * Gets has_body_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasBodyFlag() + { + return $this->container['has_body_flag']; + } + + /** + * Sets has_body_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_body_flag Whether the mail thread message has a body + * + * @return self + */ + public function setHasBodyFlag($has_body_flag): self + { + $this->container['has_body_flag'] = $has_body_flag; + + return $this; + } + + /** + * Gets sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFlag() + { + return $this->container['sent_flag']; + } + + /** + * Sets sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_flag Whether the mail thread message is sent + * + * @return self + */ + public function setSentFlag($sent_flag): self + { + $this->container['sent_flag'] = $sent_flag; + + return $this; + } + + /** + * Gets sent_from_pipedrive_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFromPipedriveFlag() + { + return $this->container['sent_from_pipedrive_flag']; + } + + /** + * Sets sent_from_pipedrive_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_from_pipedrive_flag Whether the mail thread message is sent from Pipedrive + * + * @return self + */ + public function setSentFromPipedriveFlag($sent_from_pipedrive_flag): self + { + $this->container['sent_from_pipedrive_flag'] = $sent_from_pipedrive_flag; + + return $this; + } + + /** + * Gets message_time + * + * @return \DateTime|null + */ + public function getMessageTime() + { + return $this->container['message_time']; + } + + /** + * Sets message_time + * + * @param \DateTime|null $message_time The time when the mail message was received or created + * + * @return self + */ + public function setMessageTime($message_time): self + { + $this->container['message_time'] = $message_time; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The time when the mail message was inserted to database + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The time when the mail message was updated in database received + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseNote.php b/lib/Model/BaseNote.php new file mode 100644 index 00000000..e686a99e --- /dev/null +++ b/lib/Model/BaseNote.php @@ -0,0 +1,852 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseNote implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseNote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'active_flag' => 'bool', + 'add_time' => 'string', + 'content' => 'string', + 'deal' => '\Pipedrive\Model\BaseNoteDealTitle', + 'lead_id' => 'string', + 'deal_id' => 'int', + 'last_update_user_id' => 'int', + 'org_id' => 'int', + 'organization' => '\Pipedrive\Model\BaseNoteOrganization', + 'person' => '\Pipedrive\Model\BaseNotePerson', + 'person_id' => 'int', + 'pinned_to_deal_flag' => 'bool', + 'pinned_to_organization_flag' => 'bool', + 'pinned_to_person_flag' => 'bool', + 'update_time' => 'string', + 'user' => '\Pipedrive\Model\NoteCreatorUser', + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'active_flag' => null, + 'add_time' => null, + 'content' => null, + 'deal' => null, + 'lead_id' => 'uuid', + 'deal_id' => null, + 'last_update_user_id' => null, + 'org_id' => null, + 'organization' => null, + 'person' => null, + 'person_id' => null, + 'pinned_to_deal_flag' => null, + 'pinned_to_organization_flag' => null, + 'pinned_to_person_flag' => null, + 'update_time' => null, + 'user' => null, + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'active_flag' => 'active_flag', + 'add_time' => 'add_time', + 'content' => 'content', + 'deal' => 'deal', + 'lead_id' => 'lead_id', + 'deal_id' => 'deal_id', + 'last_update_user_id' => 'last_update_user_id', + 'org_id' => 'org_id', + 'organization' => 'organization', + 'person' => 'person', + 'person_id' => 'person_id', + 'pinned_to_deal_flag' => 'pinned_to_deal_flag', + 'pinned_to_organization_flag' => 'pinned_to_organization_flag', + 'pinned_to_person_flag' => 'pinned_to_person_flag', + 'update_time' => 'update_time', + 'user' => 'user', + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'active_flag' => 'setActiveFlag', + 'add_time' => 'setAddTime', + 'content' => 'setContent', + 'deal' => 'setDeal', + 'lead_id' => 'setLeadId', + 'deal_id' => 'setDealId', + 'last_update_user_id' => 'setLastUpdateUserId', + 'org_id' => 'setOrgId', + 'organization' => 'setOrganization', + 'person' => 'setPerson', + 'person_id' => 'setPersonId', + 'pinned_to_deal_flag' => 'setPinnedToDealFlag', + 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'setPinnedToPersonFlag', + 'update_time' => 'setUpdateTime', + 'user' => 'setUser', + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'active_flag' => 'getActiveFlag', + 'add_time' => 'getAddTime', + 'content' => 'getContent', + 'deal' => 'getDeal', + 'lead_id' => 'getLeadId', + 'deal_id' => 'getDealId', + 'last_update_user_id' => 'getLastUpdateUserId', + 'org_id' => 'getOrgId', + 'organization' => 'getOrganization', + 'person' => 'getPerson', + 'person_id' => 'getPersonId', + 'pinned_to_deal_flag' => 'getPinnedToDealFlag', + 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'getPinnedToPersonFlag', + 'update_time' => 'getUpdateTime', + 'user' => 'getUser', + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['content'] = $data['content'] ?? null; + $this->container['deal'] = $data['deal'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['last_update_user_id'] = $data['last_update_user_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; + $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; + $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['user'] = $data['user'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the note + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the note is active or deleted + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the note + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content The content of the note in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets deal + * + * @return \Pipedrive\Model\BaseNoteDealTitle|null + */ + public function getDeal() + { + return $this->container['deal']; + } + + /** + * Sets deal + * + * @param \Pipedrive\Model\BaseNoteDealTitle|null $deal deal + * + * @return self + */ + public function setDeal($deal): self + { + $this->container['deal'] = $deal; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead the note is attached to + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal the note is attached to + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets last_update_user_id + * + * @return int|null + */ + public function getLastUpdateUserId() + { + return $this->container['last_update_user_id']; + } + + /** + * Sets last_update_user_id + * + * @param int|null $last_update_user_id The ID of the user who last updated the note + * + * @return self + */ + public function setLastUpdateUserId($last_update_user_id): self + { + $this->container['last_update_user_id'] = $last_update_user_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization the note is attached to + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\BaseNoteOrganization|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\BaseNoteOrganization|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\BaseNotePerson|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\BaseNotePerson|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person the note is attached to + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets pinned_to_deal_flag + * + * @return bool|null + */ + public function getPinnedToDealFlag() + { + return $this->container['pinned_to_deal_flag']; + } + + /** + * Sets pinned_to_deal_flag + * + * @param bool|null $pinned_to_deal_flag If true, the results are filtered by note to deal pinning state + * + * @return self + */ + public function setPinnedToDealFlag($pinned_to_deal_flag): self + { + $this->container['pinned_to_deal_flag'] = $pinned_to_deal_flag; + + return $this; + } + + /** + * Gets pinned_to_organization_flag + * + * @return bool|null + */ + public function getPinnedToOrganizationFlag() + { + return $this->container['pinned_to_organization_flag']; + } + + /** + * Sets pinned_to_organization_flag + * + * @param bool|null $pinned_to_organization_flag If true, the results are filtered by note to organization pinning state + * + * @return self + */ + public function setPinnedToOrganizationFlag($pinned_to_organization_flag): self + { + $this->container['pinned_to_organization_flag'] = $pinned_to_organization_flag; + + return $this; + } + + /** + * Gets pinned_to_person_flag + * + * @return bool|null + */ + public function getPinnedToPersonFlag() + { + return $this->container['pinned_to_person_flag']; + } + + /** + * Sets pinned_to_person_flag + * + * @param bool|null $pinned_to_person_flag If true, the results are filtered by note to person pinning state + * + * @return self + */ + public function setPinnedToPersonFlag($pinned_to_person_flag): self + { + $this->container['pinned_to_person_flag'] = $pinned_to_person_flag; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the note + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\NoteCreatorUser|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\NoteCreatorUser|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the note creator + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseNoteDealTitle.php b/lib/Model/BaseNoteDealTitle.php new file mode 100644 index 00000000..a299ddab --- /dev/null +++ b/lib/Model/BaseNoteDealTitle.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseNoteDealTitle implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseNoteDealTitle'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal this note is attached to + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseNoteOrganization.php b/lib/Model/BaseNoteOrganization.php new file mode 100644 index 00000000..cca4a443 --- /dev/null +++ b/lib/Model/BaseNoteOrganization.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseNoteOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseNote_organization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization the note is attached to + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseNotePerson.php b/lib/Model/BaseNotePerson.php new file mode 100644 index 00000000..0b6aa1a8 --- /dev/null +++ b/lib/Model/BaseNotePerson.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseNotePerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseNote_person'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person the note is attached to + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseOrganizationItem.php b/lib/Model/BaseOrganizationItem.php new file mode 100644 index 00000000..234fe2db --- /dev/null +++ b/lib/Model/BaseOrganizationItem.php @@ -0,0 +1,1692 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseOrganizationItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseOrganizationItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'owner_id' => '\Pipedrive\Model\Owner', + 'name' => 'string', + 'active_flag' => 'bool', + 'picture_id' => '\Pipedrive\Model\PictureDataWithValue', + 'country_code' => 'string', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'label' => 'int', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'email_messages_count' => 'int', + 'people_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'address' => 'string', + 'address_subpremise' => 'string', + 'address_street_number' => 'string', + 'address_route' => 'string', + 'address_sublocality' => 'string', + 'address_locality' => 'string', + 'address_admin_area_level_1' => 'string', + 'address_admin_area_level_2' => 'string', + 'address_country' => 'string', + 'address_postal_code' => 'string', + 'address_formatted_address' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'owner_id' => null, + 'name' => null, + 'active_flag' => null, + 'picture_id' => null, + 'country_code' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'label' => null, + 'owner_name' => null, + 'cc_email' => null, + 'email_messages_count' => null, + 'people_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'address' => null, + 'address_subpremise' => null, + 'address_street_number' => null, + 'address_route' => null, + 'address_sublocality' => null, + 'address_locality' => null, + 'address_admin_area_level_1' => null, + 'address_admin_area_level_2' => null, + 'address_country' => null, + 'address_postal_code' => null, + 'address_formatted_address' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'owner_id' => 'owner_id', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'picture_id' => 'picture_id', + 'country_code' => 'country_code', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'label' => 'label', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'email_messages_count' => 'email_messages_count', + 'people_count' => 'people_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'address' => 'address', + 'address_subpremise' => 'address_subpremise', + 'address_street_number' => 'address_street_number', + 'address_route' => 'address_route', + 'address_sublocality' => 'address_sublocality', + 'address_locality' => 'address_locality', + 'address_admin_area_level_1' => 'address_admin_area_level_1', + 'address_admin_area_level_2' => 'address_admin_area_level_2', + 'address_country' => 'address_country', + 'address_postal_code' => 'address_postal_code', + 'address_formatted_address' => 'address_formatted_address', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'owner_id' => 'setOwnerId', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'picture_id' => 'setPictureId', + 'country_code' => 'setCountryCode', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'label' => 'setLabel', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'email_messages_count' => 'setEmailMessagesCount', + 'people_count' => 'setPeopleCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'address' => 'setAddress', + 'address_subpremise' => 'setAddressSubpremise', + 'address_street_number' => 'setAddressStreetNumber', + 'address_route' => 'setAddressRoute', + 'address_sublocality' => 'setAddressSublocality', + 'address_locality' => 'setAddressLocality', + 'address_admin_area_level_1' => 'setAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'setAddressAdminAreaLevel2', + 'address_country' => 'setAddressCountry', + 'address_postal_code' => 'setAddressPostalCode', + 'address_formatted_address' => 'setAddressFormattedAddress', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'owner_id' => 'getOwnerId', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'picture_id' => 'getPictureId', + 'country_code' => 'getCountryCode', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'label' => 'getLabel', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'email_messages_count' => 'getEmailMessagesCount', + 'people_count' => 'getPeopleCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'address' => 'getAddress', + 'address_subpremise' => 'getAddressSubpremise', + 'address_street_number' => 'getAddressStreetNumber', + 'address_route' => 'getAddressRoute', + 'address_sublocality' => 'getAddressSublocality', + 'address_locality' => 'getAddressLocality', + 'address_admin_area_level_1' => 'getAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'getAddressAdminAreaLevel2', + 'address_country' => 'getAddressCountry', + 'address_postal_code' => 'getAddressPostalCode', + 'address_formatted_address' => 'getAddressFormattedAddress', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['address_subpremise'] = $data['address_subpremise'] ?? null; + $this->container['address_street_number'] = $data['address_street_number'] ?? null; + $this->container['address_route'] = $data['address_route'] ?? null; + $this->container['address_sublocality'] = $data['address_sublocality'] ?? null; + $this->container['address_locality'] = $data['address_locality'] ?? null; + $this->container['address_admin_area_level_1'] = $data['address_admin_area_level_1'] ?? null; + $this->container['address_admin_area_level_2'] = $data['address_admin_area_level_2'] ?? null; + $this->container['address_country'] = $data['address_country'] ?? null; + $this->container['address_postal_code'] = $data['address_postal_code'] ?? null; + $this->container['address_formatted_address'] = $data['address_formatted_address'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the organization + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithValue|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithValue|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The country code of the organization + * + * @return self + */ + public function setCountryCode($country_code): self + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first character of the organization name + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the organization + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the organization + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The ID of the label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the organization owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the organization + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The count of persons related to the organization + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the organization + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the organization + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the organization + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the organization + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the organization + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the organization + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The full address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets address_subpremise + * + * @return string|null + */ + public function getAddressSubpremise() + { + return $this->container['address_subpremise']; + } + + /** + * Sets address_subpremise + * + * @param string|null $address_subpremise The sub-premise of the organization location + * + * @return self + */ + public function setAddressSubpremise($address_subpremise): self + { + $this->container['address_subpremise'] = $address_subpremise; + + return $this; + } + + /** + * Gets address_street_number + * + * @return string|null + */ + public function getAddressStreetNumber() + { + return $this->container['address_street_number']; + } + + /** + * Sets address_street_number + * + * @param string|null $address_street_number The street number of the organization location + * + * @return self + */ + public function setAddressStreetNumber($address_street_number): self + { + $this->container['address_street_number'] = $address_street_number; + + return $this; + } + + /** + * Gets address_route + * + * @return string|null + */ + public function getAddressRoute() + { + return $this->container['address_route']; + } + + /** + * Sets address_route + * + * @param string|null $address_route The route of the organization location + * + * @return self + */ + public function setAddressRoute($address_route): self + { + $this->container['address_route'] = $address_route; + + return $this; + } + + /** + * Gets address_sublocality + * + * @return string|null + */ + public function getAddressSublocality() + { + return $this->container['address_sublocality']; + } + + /** + * Sets address_sublocality + * + * @param string|null $address_sublocality The sub-locality of the organization location + * + * @return self + */ + public function setAddressSublocality($address_sublocality): self + { + $this->container['address_sublocality'] = $address_sublocality; + + return $this; + } + + /** + * Gets address_locality + * + * @return string|null + */ + public function getAddressLocality() + { + return $this->container['address_locality']; + } + + /** + * Sets address_locality + * + * @param string|null $address_locality The locality of the organization location + * + * @return self + */ + public function setAddressLocality($address_locality): self + { + $this->container['address_locality'] = $address_locality; + + return $this; + } + + /** + * Gets address_admin_area_level_1 + * + * @return string|null + */ + public function getAddressAdminAreaLevel1() + { + return $this->container['address_admin_area_level_1']; + } + + /** + * Sets address_admin_area_level_1 + * + * @param string|null $address_admin_area_level_1 The level 1 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel1($address_admin_area_level_1): self + { + $this->container['address_admin_area_level_1'] = $address_admin_area_level_1; + + return $this; + } + + /** + * Gets address_admin_area_level_2 + * + * @return string|null + */ + public function getAddressAdminAreaLevel2() + { + return $this->container['address_admin_area_level_2']; + } + + /** + * Sets address_admin_area_level_2 + * + * @param string|null $address_admin_area_level_2 The level 2 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel2($address_admin_area_level_2): self + { + $this->container['address_admin_area_level_2'] = $address_admin_area_level_2; + + return $this; + } + + /** + * Gets address_country + * + * @return string|null + */ + public function getAddressCountry() + { + return $this->container['address_country']; + } + + /** + * Sets address_country + * + * @param string|null $address_country The country of the organization location + * + * @return self + */ + public function setAddressCountry($address_country): self + { + $this->container['address_country'] = $address_country; + + return $this; + } + + /** + * Gets address_postal_code + * + * @return string|null + */ + public function getAddressPostalCode() + { + return $this->container['address_postal_code']; + } + + /** + * Sets address_postal_code + * + * @param string|null $address_postal_code The postal code of the organization location + * + * @return self + */ + public function setAddressPostalCode($address_postal_code): self + { + $this->container['address_postal_code'] = $address_postal_code; + + return $this; + } + + /** + * Gets address_formatted_address + * + * @return string|null + */ + public function getAddressFormattedAddress() + { + return $this->container['address_formatted_address']; + } + + /** + * Sets address_formatted_address + * + * @param string|null $address_formatted_address The formatted organization location + * + * @return self + */ + public function setAddressFormattedAddress($address_formatted_address): self + { + $this->container['address_formatted_address'] = $address_formatted_address; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseOrganizationItemFields.php b/lib/Model/BaseOrganizationItemFields.php new file mode 100644 index 00000000..c8abf391 --- /dev/null +++ b/lib/Model/BaseOrganizationItemFields.php @@ -0,0 +1,732 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseOrganizationItemFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseOrganizationItemFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'owner_id' => '\Pipedrive\Model\Owner', + 'name' => 'string', + 'active_flag' => 'bool', + 'picture_id' => '\Pipedrive\Model\PictureDataWithValue', + 'country_code' => 'string', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'label' => 'int', + 'owner_name' => 'string', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'owner_id' => null, + 'name' => null, + 'active_flag' => null, + 'picture_id' => null, + 'country_code' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'label' => null, + 'owner_name' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'owner_id' => 'owner_id', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'picture_id' => 'picture_id', + 'country_code' => 'country_code', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'label' => 'label', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'owner_id' => 'setOwnerId', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'picture_id' => 'setPictureId', + 'country_code' => 'setCountryCode', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'label' => 'setLabel', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'owner_id' => 'getOwnerId', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'picture_id' => 'getPictureId', + 'country_code' => 'getCountryCode', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'label' => 'getLabel', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the organization + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithValue|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithValue|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The country code of the organization + * + * @return self + */ + public function setCountryCode($country_code): self + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first character of the organization name + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the organization + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the organization + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The ID of the label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the organization owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseOrganizationItemWithEditNameFlag.php b/lib/Model/BaseOrganizationItemWithEditNameFlag.php new file mode 100644 index 00000000..1655f6a3 --- /dev/null +++ b/lib/Model/BaseOrganizationItemWithEditNameFlag.php @@ -0,0 +1,1722 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseOrganizationItemWithEditNameFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseOrganizationItemWithEditNameFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'owner_id' => '\Pipedrive\Model\Owner', + 'name' => 'string', + 'active_flag' => 'bool', + 'picture_id' => '\Pipedrive\Model\PictureDataWithValue', + 'country_code' => 'string', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'label' => 'int', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'email_messages_count' => 'int', + 'people_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'address' => 'string', + 'address_subpremise' => 'string', + 'address_street_number' => 'string', + 'address_route' => 'string', + 'address_sublocality' => 'string', + 'address_locality' => 'string', + 'address_admin_area_level_1' => 'string', + 'address_admin_area_level_2' => 'string', + 'address_country' => 'string', + 'address_postal_code' => 'string', + 'address_formatted_address' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'edit_name' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'owner_id' => null, + 'name' => null, + 'active_flag' => null, + 'picture_id' => null, + 'country_code' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'label' => null, + 'owner_name' => null, + 'cc_email' => null, + 'email_messages_count' => null, + 'people_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'address' => null, + 'address_subpremise' => null, + 'address_street_number' => null, + 'address_route' => null, + 'address_sublocality' => null, + 'address_locality' => null, + 'address_admin_area_level_1' => null, + 'address_admin_area_level_2' => null, + 'address_country' => null, + 'address_postal_code' => null, + 'address_formatted_address' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'edit_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'owner_id' => 'owner_id', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'picture_id' => 'picture_id', + 'country_code' => 'country_code', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'label' => 'label', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'email_messages_count' => 'email_messages_count', + 'people_count' => 'people_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'address' => 'address', + 'address_subpremise' => 'address_subpremise', + 'address_street_number' => 'address_street_number', + 'address_route' => 'address_route', + 'address_sublocality' => 'address_sublocality', + 'address_locality' => 'address_locality', + 'address_admin_area_level_1' => 'address_admin_area_level_1', + 'address_admin_area_level_2' => 'address_admin_area_level_2', + 'address_country' => 'address_country', + 'address_postal_code' => 'address_postal_code', + 'address_formatted_address' => 'address_formatted_address', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'edit_name' => 'edit_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'owner_id' => 'setOwnerId', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'picture_id' => 'setPictureId', + 'country_code' => 'setCountryCode', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'label' => 'setLabel', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'email_messages_count' => 'setEmailMessagesCount', + 'people_count' => 'setPeopleCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'address' => 'setAddress', + 'address_subpremise' => 'setAddressSubpremise', + 'address_street_number' => 'setAddressStreetNumber', + 'address_route' => 'setAddressRoute', + 'address_sublocality' => 'setAddressSublocality', + 'address_locality' => 'setAddressLocality', + 'address_admin_area_level_1' => 'setAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'setAddressAdminAreaLevel2', + 'address_country' => 'setAddressCountry', + 'address_postal_code' => 'setAddressPostalCode', + 'address_formatted_address' => 'setAddressFormattedAddress', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'edit_name' => 'setEditName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'owner_id' => 'getOwnerId', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'picture_id' => 'getPictureId', + 'country_code' => 'getCountryCode', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'label' => 'getLabel', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'email_messages_count' => 'getEmailMessagesCount', + 'people_count' => 'getPeopleCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'address' => 'getAddress', + 'address_subpremise' => 'getAddressSubpremise', + 'address_street_number' => 'getAddressStreetNumber', + 'address_route' => 'getAddressRoute', + 'address_sublocality' => 'getAddressSublocality', + 'address_locality' => 'getAddressLocality', + 'address_admin_area_level_1' => 'getAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'getAddressAdminAreaLevel2', + 'address_country' => 'getAddressCountry', + 'address_postal_code' => 'getAddressPostalCode', + 'address_formatted_address' => 'getAddressFormattedAddress', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'edit_name' => 'getEditName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['address_subpremise'] = $data['address_subpremise'] ?? null; + $this->container['address_street_number'] = $data['address_street_number'] ?? null; + $this->container['address_route'] = $data['address_route'] ?? null; + $this->container['address_sublocality'] = $data['address_sublocality'] ?? null; + $this->container['address_locality'] = $data['address_locality'] ?? null; + $this->container['address_admin_area_level_1'] = $data['address_admin_area_level_1'] ?? null; + $this->container['address_admin_area_level_2'] = $data['address_admin_area_level_2'] ?? null; + $this->container['address_country'] = $data['address_country'] ?? null; + $this->container['address_postal_code'] = $data['address_postal_code'] ?? null; + $this->container['address_formatted_address'] = $data['address_formatted_address'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['edit_name'] = $data['edit_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the organization + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithValue|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithValue|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The country code of the organization + * + * @return self + */ + public function setCountryCode($country_code): self + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first character of the organization name + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the organization + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the organization + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The ID of the label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the organization owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the organization + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The count of persons related to the organization + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the organization + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the organization + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the organization + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the organization + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the organization + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the organization + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The full address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets address_subpremise + * + * @return string|null + */ + public function getAddressSubpremise() + { + return $this->container['address_subpremise']; + } + + /** + * Sets address_subpremise + * + * @param string|null $address_subpremise The sub-premise of the organization location + * + * @return self + */ + public function setAddressSubpremise($address_subpremise): self + { + $this->container['address_subpremise'] = $address_subpremise; + + return $this; + } + + /** + * Gets address_street_number + * + * @return string|null + */ + public function getAddressStreetNumber() + { + return $this->container['address_street_number']; + } + + /** + * Sets address_street_number + * + * @param string|null $address_street_number The street number of the organization location + * + * @return self + */ + public function setAddressStreetNumber($address_street_number): self + { + $this->container['address_street_number'] = $address_street_number; + + return $this; + } + + /** + * Gets address_route + * + * @return string|null + */ + public function getAddressRoute() + { + return $this->container['address_route']; + } + + /** + * Sets address_route + * + * @param string|null $address_route The route of the organization location + * + * @return self + */ + public function setAddressRoute($address_route): self + { + $this->container['address_route'] = $address_route; + + return $this; + } + + /** + * Gets address_sublocality + * + * @return string|null + */ + public function getAddressSublocality() + { + return $this->container['address_sublocality']; + } + + /** + * Sets address_sublocality + * + * @param string|null $address_sublocality The sub-locality of the organization location + * + * @return self + */ + public function setAddressSublocality($address_sublocality): self + { + $this->container['address_sublocality'] = $address_sublocality; + + return $this; + } + + /** + * Gets address_locality + * + * @return string|null + */ + public function getAddressLocality() + { + return $this->container['address_locality']; + } + + /** + * Sets address_locality + * + * @param string|null $address_locality The locality of the organization location + * + * @return self + */ + public function setAddressLocality($address_locality): self + { + $this->container['address_locality'] = $address_locality; + + return $this; + } + + /** + * Gets address_admin_area_level_1 + * + * @return string|null + */ + public function getAddressAdminAreaLevel1() + { + return $this->container['address_admin_area_level_1']; + } + + /** + * Sets address_admin_area_level_1 + * + * @param string|null $address_admin_area_level_1 The level 1 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel1($address_admin_area_level_1): self + { + $this->container['address_admin_area_level_1'] = $address_admin_area_level_1; + + return $this; + } + + /** + * Gets address_admin_area_level_2 + * + * @return string|null + */ + public function getAddressAdminAreaLevel2() + { + return $this->container['address_admin_area_level_2']; + } + + /** + * Sets address_admin_area_level_2 + * + * @param string|null $address_admin_area_level_2 The level 2 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel2($address_admin_area_level_2): self + { + $this->container['address_admin_area_level_2'] = $address_admin_area_level_2; + + return $this; + } + + /** + * Gets address_country + * + * @return string|null + */ + public function getAddressCountry() + { + return $this->container['address_country']; + } + + /** + * Sets address_country + * + * @param string|null $address_country The country of the organization location + * + * @return self + */ + public function setAddressCountry($address_country): self + { + $this->container['address_country'] = $address_country; + + return $this; + } + + /** + * Gets address_postal_code + * + * @return string|null + */ + public function getAddressPostalCode() + { + return $this->container['address_postal_code']; + } + + /** + * Sets address_postal_code + * + * @param string|null $address_postal_code The postal code of the organization location + * + * @return self + */ + public function setAddressPostalCode($address_postal_code): self + { + $this->container['address_postal_code'] = $address_postal_code; + + return $this; + } + + /** + * Gets address_formatted_address + * + * @return string|null + */ + public function getAddressFormattedAddress() + { + return $this->container['address_formatted_address']; + } + + /** + * Sets address_formatted_address + * + * @param string|null $address_formatted_address The formatted organization location + * + * @return self + */ + public function setAddressFormattedAddress($address_formatted_address): self + { + $this->container['address_formatted_address'] = $address_formatted_address; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets edit_name + * + * @return bool|null + */ + public function getEditName() + { + return $this->container['edit_name']; + } + + /** + * Sets edit_name + * + * @param bool|null $edit_name If the company ID of the organization and company ID of the request is same or not + * + * @return self + */ + public function setEditName($edit_name): self + { + $this->container['edit_name'] = $edit_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseOrganizationItemWithEditNameFlagAllOf.php b/lib/Model/BaseOrganizationItemWithEditNameFlagAllOf.php new file mode 100644 index 00000000..580d58a1 --- /dev/null +++ b/lib/Model/BaseOrganizationItemWithEditNameFlagAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseOrganizationItemWithEditNameFlagAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseOrganizationItemWithEditNameFlag_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'edit_name' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'edit_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'edit_name' => 'edit_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'edit_name' => 'setEditName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'edit_name' => 'getEditName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['edit_name'] = $data['edit_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets edit_name + * + * @return bool|null + */ + public function getEditName() + { + return $this->container['edit_name']; + } + + /** + * Sets edit_name + * + * @param bool|null $edit_name If the company ID of the organization and company ID of the request is same or not + * + * @return self + */ + public function setEditName($edit_name): self + { + $this->container['edit_name'] = $edit_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseOrganizationRelationshipItem.php b/lib/Model/BaseOrganizationRelationshipItem.php new file mode 100644 index 00000000..aa68064f --- /dev/null +++ b/lib/Model/BaseOrganizationRelationshipItem.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseOrganizationRelationshipItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseOrganizationRelationshipItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'rel_owner_org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItem', + 'rel_linked_org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItem', + 'add_time' => 'string', + 'update_time' => 'string', + 'active_flag' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'rel_owner_org_id' => null, + 'rel_linked_org_id' => null, + 'add_time' => null, + 'update_time' => null, + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'rel_owner_org_id' => 'rel_owner_org_id', + 'rel_linked_org_id' => 'rel_linked_org_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'rel_owner_org_id' => 'setRelOwnerOrgId', + 'rel_linked_org_id' => 'setRelLinkedOrgId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'rel_owner_org_id' => 'getRelOwnerOrgId', + 'rel_linked_org_id' => 'getRelLinkedOrgId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['rel_owner_org_id'] = $data['rel_owner_org_id'] ?? null; + $this->container['rel_linked_org_id'] = $data['rel_linked_org_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization relationship + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the relationship + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rel_owner_org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItem|null + */ + public function getRelOwnerOrgId() + { + return $this->container['rel_owner_org_id']; + } + + /** + * Sets rel_owner_org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItem|null $rel_owner_org_id rel_owner_org_id + * + * @return self + */ + public function setRelOwnerOrgId($rel_owner_org_id): self + { + $this->container['rel_owner_org_id'] = $rel_owner_org_id; + + return $this; + } + + /** + * Gets rel_linked_org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItem|null + */ + public function getRelLinkedOrgId() + { + return $this->container['rel_linked_org_id']; + } + + /** + * Sets rel_linked_org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItem|null $rel_linked_org_id rel_linked_org_id + * + * @return self + */ + public function setRelLinkedOrgId($rel_linked_org_id): self + { + $this->container['rel_linked_org_id'] = $rel_linked_org_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the relationship + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the relationship + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets active_flag + * + * @return string|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param string|null $active_flag Whether the relationship is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasePersonItem.php b/lib/Model/BasePersonItem.php new file mode 100644 index 00000000..9657be06 --- /dev/null +++ b/lib/Model/BasePersonItem.php @@ -0,0 +1,732 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasePersonItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasePersonItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'active_flag' => 'bool', + 'phone' => '\Pipedrive\Model\BasePersonItemPhone[]', + 'email' => '\Pipedrive\Model\BasePersonItemEmail[]', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'picture_id' => '\Pipedrive\Model\PictureDataWithID', + 'label' => 'int', + 'org_name' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'active_flag' => null, + 'phone' => null, + 'email' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'picture_id' => null, + 'label' => null, + 'org_name' => null, + 'owner_name' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'active_flag' => 'active_flag', + 'phone' => 'phone', + 'email' => 'email', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'picture_id' => 'picture_id', + 'label' => 'label', + 'org_name' => 'org_name', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'active_flag' => 'setActiveFlag', + 'phone' => 'setPhone', + 'email' => 'setEmail', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'picture_id' => 'setPictureId', + 'label' => 'setLabel', + 'org_name' => 'setOrgName', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'active_flag' => 'getActiveFlag', + 'phone' => 'getPhone', + 'email' => 'getEmail', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'picture_id' => 'getPictureId', + 'label' => 'getLabel', + 'org_name' => 'getOrgName', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the person + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\BasePersonItemEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\BasePersonItemEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first letter of the name of the person + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the person + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithID|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithID|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The label assigned to the person + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the person + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the owner associated with the person + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email associated with the person + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasePersonItemEmail.php b/lib/Model/BasePersonItemEmail.php new file mode 100644 index 00000000..44e8c6b5 --- /dev/null +++ b/lib/Model/BasePersonItemEmail.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasePersonItemEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasePersonItem_email'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'primary' => 'bool', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'primary' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'primary' => 'primary', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'primary' => 'setPrimary', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'primary' => 'getPrimary', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['label'] = $data['label'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Email + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Boolean that indicates if email is primary for the person or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label that indicates the type of the email. (Possible values - work, home or other) + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasePersonItemPhone.php b/lib/Model/BasePersonItemPhone.php new file mode 100644 index 00000000..195d2061 --- /dev/null +++ b/lib/Model/BasePersonItemPhone.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasePersonItemPhone implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasePersonItem_phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'primary' => 'bool', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'primary' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'primary' => 'primary', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'primary' => 'setPrimary', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'primary' => 'getPrimary', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['label'] = $data['label'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The phone number + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Boolean that indicates if phone number is primary for the person or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label that indicates the type of the phone number. (Possible values - work, home, mobile or other) + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasePipeline.php b/lib/Model/BasePipeline.php new file mode 100644 index 00000000..d72187d0 --- /dev/null +++ b/lib/Model/BasePipeline.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasePipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasePipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'url_title' => 'string', + 'order_nr' => 'int', + 'active' => 'bool', + 'deal_probability' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'url_title' => null, + 'order_nr' => null, + 'active' => null, + 'deal_probability' => null, + 'add_time' => null, + 'update_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'url_title' => 'url_title', + 'order_nr' => 'order_nr', + 'active' => 'active', + 'deal_probability' => 'deal_probability', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'url_title' => 'setUrlTitle', + 'order_nr' => 'setOrderNr', + 'active' => 'setActive', + 'deal_probability' => 'setDealProbability', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'url_title' => 'getUrlTitle', + 'order_nr' => 'getOrderNr', + 'active' => 'getActive', + 'deal_probability' => 'getDealProbability', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['url_title'] = $data['url_title'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the pipeline + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the pipeline + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url_title + * + * @return string|null + */ + public function getUrlTitle() + { + return $this->container['url_title']; + } + + /** + * Sets url_title + * + * @param string|null $url_title The pipeline title displayed in the URL + * + * @return self + */ + public function setUrlTitle($url_title): self + { + $this->container['url_title'] = $url_title; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether this pipeline will be made inactive (hidden) or active + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deal_probability + * + * @return bool|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param bool|null $deal_probability Whether deal probability is disabled or enabled for this pipeline + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasePipelineWithSelectedFlag.php b/lib/Model/BasePipelineWithSelectedFlag.php new file mode 100644 index 00000000..b4d84992 --- /dev/null +++ b/lib/Model/BasePipelineWithSelectedFlag.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasePipelineWithSelectedFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasePipelineWithSelectedFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'url_title' => 'string', + 'order_nr' => 'int', + 'active' => 'bool', + 'deal_probability' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string', + 'selected' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'url_title' => null, + 'order_nr' => null, + 'active' => null, + 'deal_probability' => null, + 'add_time' => null, + 'update_time' => null, + 'selected' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'url_title' => 'url_title', + 'order_nr' => 'order_nr', + 'active' => 'active', + 'deal_probability' => 'deal_probability', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'selected' => 'selected' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'url_title' => 'setUrlTitle', + 'order_nr' => 'setOrderNr', + 'active' => 'setActive', + 'deal_probability' => 'setDealProbability', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'selected' => 'setSelected' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'url_title' => 'getUrlTitle', + 'order_nr' => 'getOrderNr', + 'active' => 'getActive', + 'deal_probability' => 'getDealProbability', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'selected' => 'getSelected' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['url_title'] = $data['url_title'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['selected'] = $data['selected'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the pipeline + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the pipeline + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url_title + * + * @return string|null + */ + public function getUrlTitle() + { + return $this->container['url_title']; + } + + /** + * Sets url_title + * + * @param string|null $url_title The pipeline title displayed in the URL + * + * @return self + */ + public function setUrlTitle($url_title): self + { + $this->container['url_title'] = $url_title; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether this pipeline will be made inactive (hidden) or active + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deal_probability + * + * @return bool|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param bool|null $deal_probability Whether deal probability is disabled or enabled for this pipeline + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets selected + * + * @return bool|null + */ + public function getSelected() + { + return $this->container['selected']; + } + + /** + * Sets selected + * + * @param bool|null $selected A boolean that shows if the pipeline is selected from a filter or not + * + * @return self + */ + public function setSelected($selected): self + { + $this->container['selected'] = $selected; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasePipelineWithSelectedFlagAllOf.php b/lib/Model/BasePipelineWithSelectedFlagAllOf.php new file mode 100644 index 00000000..fed4f2ee --- /dev/null +++ b/lib/Model/BasePipelineWithSelectedFlagAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasePipelineWithSelectedFlagAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasePipelineWithSelectedFlag_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'selected' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'selected' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'selected' => 'selected' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'selected' => 'setSelected' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'selected' => 'getSelected' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['selected'] = $data['selected'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets selected + * + * @return bool|null + */ + public function getSelected() + { + return $this->container['selected']; + } + + /** + * Sets selected + * + * @param bool|null $selected A boolean that shows if the pipeline is selected from a filter or not + * + * @return self + */ + public function setSelected($selected): self + { + $this->container['selected'] = $selected; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseProduct.php b/lib/Model/BaseProduct.php new file mode 100644 index 00000000..02f455b5 --- /dev/null +++ b/lib/Model/BaseProduct.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'float', + 'name' => 'string', + 'code' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'code' => null, + 'unit' => null, + 'tax' => null, + 'active_flag' => null, + 'selectable' => null, + 'visible_to' => null, + 'owner_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'code' => 'code', + 'unit' => 'unit', + 'tax' => 'tax', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'code' => 'setCode', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'code' => 'getCode', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 float|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param float|null $id The ID of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The ax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product is selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to Visibility of the product + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return object|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param object|null $owner_id Information about the Pipedrive user who owns the product + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseResponse.php b/lib/Model/BaseResponse.php new file mode 100644 index 00000000..1ec29e10 --- /dev/null +++ b/lib/Model/BaseResponse.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'base-response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseResponseWithStatus.php b/lib/Model/BaseResponseWithStatus.php new file mode 100644 index 00000000..446c1df1 --- /dev/null +++ b/lib/Model/BaseResponseWithStatus.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseResponseWithStatus implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'base-response-with-status'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['status'] = $data['status'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the response + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseResponseWithStatusAllOf.php b/lib/Model/BaseResponseWithStatusAllOf.php new file mode 100644 index 00000000..d0b91da5 --- /dev/null +++ b/lib/Model/BaseResponseWithStatusAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseResponseWithStatusAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'base_response_with_status_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = $data['status'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the response + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseRole.php b/lib/Model/BaseRole.php new file mode 100644 index 00000000..d110cedf --- /dev/null +++ b/lib/Model/BaseRole.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'parent_role_id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'parent_role_id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'parent_role_id' => 'parent_role_id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'parent_role_id' => 'setParentRoleId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'parent_role_id' => 'getParentRoleId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['parent_role_id'] = $data['parent_role_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets parent_role_id + * + * @return int|null + */ + public function getParentRoleId() + { + return $this->container['parent_role_id']; + } + + /** + * Sets parent_role_id + * + * @param int|null $parent_role_id The ID of the parent role + * + * @return self + */ + public function setParentRoleId($parent_role_id): self + { + $this->container['parent_role_id'] = $parent_role_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the role + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseStage.php b/lib/Model/BaseStage.php new file mode 100644 index 00000000..9c0a3a83 --- /dev/null +++ b/lib/Model/BaseStage.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseStage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseStage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'order_nr' => 'int', + 'name' => 'string', + 'active_flag' => 'bool', + 'deal_probability' => 'int', + 'pipeline_id' => 'int', + 'rotten_flag' => 'bool', + 'rotten_days' => 'int', + 'add_time' => 'string', + 'update_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'order_nr' => null, + 'name' => null, + 'active_flag' => null, + 'deal_probability' => null, + 'pipeline_id' => null, + 'rotten_flag' => null, + 'rotten_days' => null, + 'add_time' => null, + 'update_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'order_nr' => 'order_nr', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'deal_probability' => 'deal_probability', + 'pipeline_id' => 'pipeline_id', + 'rotten_flag' => 'rotten_flag', + 'rotten_days' => 'rotten_days', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'order_nr' => 'setOrderNr', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'deal_probability' => 'setDealProbability', + 'pipeline_id' => 'setPipelineId', + 'rotten_flag' => 'setRottenFlag', + 'rotten_days' => 'setRottenDays', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'order_nr' => 'getOrderNr', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'deal_probability' => 'getDealProbability', + 'pipeline_id' => 'getPipelineId', + 'rotten_flag' => 'getRottenFlag', + 'rotten_days' => 'getRottenDays', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['rotten_flag'] = $data['rotten_flag'] ?? null; + $this->container['rotten_days'] = $data['rotten_days'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the stage + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of the stage + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the stage + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the stage is active or deleted + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deal_probability + * + * @return int|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param int|null $deal_probability The success probability percentage of the deal. Used/shown when the deal weighted values are used. + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline to add the stage to + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets rotten_flag + * + * @return bool|null + */ + public function getRottenFlag() + { + return $this->container['rotten_flag']; + } + + /** + * Sets rotten_flag + * + * @param bool|null $rotten_flag Whether deals in this stage can become rotten + * + * @return self + */ + public function setRottenFlag($rotten_flag): self + { + $this->container['rotten_flag'] = $rotten_flag; + + return $this; + } + + /** + * Gets rotten_days + * + * @return int|null + */ + public function getRottenDays() + { + return $this->container['rotten_days']; + } + + /** + * Sets rotten_days + * + * @param int|null $rotten_days The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. + * + * @return self + */ + public function setRottenDays($rotten_days): self + { + $this->container['rotten_days'] = $rotten_days; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The stage creation time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The stage update time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseTeam.php b/lib/Model/BaseTeam.php new file mode 100644 index 00000000..90bc80a9 --- /dev/null +++ b/lib/Model/BaseTeam.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseTeam implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseTeam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'description' => 'string', + 'manager_id' => 'int', + 'users' => 'int[]', + 'active_flag' => '\Pipedrive\Model\NumberBoolean', + 'deleted_flag' => '\Pipedrive\Model\NumberBoolean', + 'add_time' => 'string', + 'created_by_user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'description' => null, + 'manager_id' => null, + 'users' => null, + 'active_flag' => null, + 'deleted_flag' => null, + 'add_time' => null, + 'created_by_user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description', + 'manager_id' => 'manager_id', + 'users' => 'users', + 'active_flag' => 'active_flag', + 'deleted_flag' => 'deleted_flag', + 'add_time' => 'add_time', + 'created_by_user_id' => 'created_by_user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription', + 'manager_id' => 'setManagerId', + 'users' => 'setUsers', + 'active_flag' => 'setActiveFlag', + 'deleted_flag' => 'setDeletedFlag', + 'add_time' => 'setAddTime', + 'created_by_user_id' => 'setCreatedByUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription', + 'manager_id' => 'getManagerId', + 'users' => 'getUsers', + 'active_flag' => 'getActiveFlag', + 'deleted_flag' => 'getDeletedFlag', + 'add_time' => 'getAddTime', + 'created_by_user_id' => 'getCreatedByUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['manager_id'] = $data['manager_id'] ?? null; + $this->container['users'] = $data['users'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['created_by_user_id'] = $data['created_by_user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The team ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The team name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The team description + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets manager_id + * + * @return int|null + */ + public function getManagerId() + { + return $this->container['manager_id']; + } + + /** + * Sets manager_id + * + * @param int|null $manager_id The team manager ID + * + * @return self + */ + public function setManagerId($manager_id): self + { + $this->container['manager_id'] = $manager_id; + + return $this; + } + + /** + * Gets users + * + * @return int[]|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param int[]|null $users The list of user IDs + * + * @return self + */ + public function setUsers($users): self + { + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets active_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $active_flag Flag that indicates whether the team is active + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $deleted_flag Flag that indicates whether the team is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The team creation time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets created_by_user_id + * + * @return int|null + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param int|null $created_by_user_id The ID of the user who created the team + * + * @return self + */ + public function setCreatedByUserId($created_by_user_id): self + { + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseTeamAdditionalProperties.php b/lib/Model/BaseTeamAdditionalProperties.php new file mode 100644 index 00000000..fc22ea9e --- /dev/null +++ b/lib/Model/BaseTeamAdditionalProperties.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseTeamAdditionalProperties implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseTeamAdditionalProperties'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'add_time' => 'string', + 'created_by_user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'add_time' => null, + 'created_by_user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'add_time' => 'add_time', + 'created_by_user_id' => 'created_by_user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'add_time' => 'setAddTime', + 'created_by_user_id' => 'setCreatedByUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'add_time' => 'getAddTime', + 'created_by_user_id' => 'getCreatedByUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['created_by_user_id'] = $data['created_by_user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The team creation time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets created_by_user_id + * + * @return int|null + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param int|null $created_by_user_id The ID of the user who created the team + * + * @return self + */ + public function setCreatedByUserId($created_by_user_id): self + { + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseUser.php b/lib/Model/BaseUser.php new file mode 100644 index 00000000..bf21146e --- /dev/null +++ b/lib/Model/BaseUser.php @@ -0,0 +1,882 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseUser implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseUser'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'default_currency' => 'string', + 'locale' => 'string', + 'lang' => 'int', + 'email' => 'string', + 'phone' => 'string', + 'activated' => 'bool', + 'last_login' => 'string', + 'created' => 'string', + 'modified' => 'string', + 'has_created_company' => 'bool', + 'access' => '\Pipedrive\Model\UserAccess[]', + 'active_flag' => 'bool', + 'timezone_name' => 'string', + 'timezone_offset' => 'string', + 'role_id' => 'int', + 'icon_url' => 'string', + 'is_you' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'default_currency' => null, + 'locale' => null, + 'lang' => null, + 'email' => null, + 'phone' => null, + 'activated' => null, + 'last_login' => null, + 'created' => null, + 'modified' => null, + 'has_created_company' => null, + 'access' => null, + 'active_flag' => null, + 'timezone_name' => null, + 'timezone_offset' => null, + 'role_id' => null, + 'icon_url' => null, + 'is_you' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'default_currency' => 'default_currency', + 'locale' => 'locale', + 'lang' => 'lang', + 'email' => 'email', + 'phone' => 'phone', + 'activated' => 'activated', + 'last_login' => 'last_login', + 'created' => 'created', + 'modified' => 'modified', + 'has_created_company' => 'has_created_company', + 'access' => 'access', + 'active_flag' => 'active_flag', + 'timezone_name' => 'timezone_name', + 'timezone_offset' => 'timezone_offset', + 'role_id' => 'role_id', + 'icon_url' => 'icon_url', + 'is_you' => 'is_you' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'default_currency' => 'setDefaultCurrency', + 'locale' => 'setLocale', + 'lang' => 'setLang', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'activated' => 'setActivated', + 'last_login' => 'setLastLogin', + 'created' => 'setCreated', + 'modified' => 'setModified', + 'has_created_company' => 'setHasCreatedCompany', + 'access' => 'setAccess', + 'active_flag' => 'setActiveFlag', + 'timezone_name' => 'setTimezoneName', + 'timezone_offset' => 'setTimezoneOffset', + 'role_id' => 'setRoleId', + 'icon_url' => 'setIconUrl', + 'is_you' => 'setIsYou' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'default_currency' => 'getDefaultCurrency', + 'locale' => 'getLocale', + 'lang' => 'getLang', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'activated' => 'getActivated', + 'last_login' => 'getLastLogin', + 'created' => 'getCreated', + 'modified' => 'getModified', + 'has_created_company' => 'getHasCreatedCompany', + 'access' => 'getAccess', + 'active_flag' => 'getActiveFlag', + 'timezone_name' => 'getTimezoneName', + 'timezone_offset' => 'getTimezoneOffset', + 'role_id' => 'getRoleId', + 'icon_url' => 'getIconUrl', + 'is_you' => 'getIsYou' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['default_currency'] = $data['default_currency'] ?? null; + $this->container['locale'] = $data['locale'] ?? null; + $this->container['lang'] = $data['lang'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['activated'] = $data['activated'] ?? null; + $this->container['last_login'] = $data['last_login'] ?? null; + $this->container['created'] = $data['created'] ?? null; + $this->container['modified'] = $data['modified'] ?? null; + $this->container['has_created_company'] = $data['has_created_company'] ?? null; + $this->container['access'] = $data['access'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['timezone_name'] = $data['timezone_name'] ?? null; + $this->container['timezone_offset'] = $data['timezone_offset'] ?? null; + $this->container['role_id'] = $data['role_id'] ?? null; + $this->container['icon_url'] = $data['icon_url'] ?? null; + $this->container['is_you'] = $data['is_you'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The user ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The user name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets default_currency + * + * @return string|null + */ + public function getDefaultCurrency() + { + return $this->container['default_currency']; + } + + /** + * Sets default_currency + * + * @param string|null $default_currency The user default currency + * + * @return self + */ + public function setDefaultCurrency($default_currency): self + { + $this->container['default_currency'] = $default_currency; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The user locale + * + * @return self + */ + public function setLocale($locale): self + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets lang + * + * @return int|null + */ + public function getLang() + { + return $this->container['lang']; + } + + /** + * Sets lang + * + * @param int|null $lang The user language ID + * + * @return self + */ + public function setLang($lang): self + { + $this->container['lang'] = $lang; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The user email + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone The user phone + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets activated + * + * @return bool|null + */ + public function getActivated() + { + return $this->container['activated']; + } + + /** + * Sets activated + * + * @param bool|null $activated Boolean that indicates whether the user is activated + * + * @return self + */ + public function setActivated($activated): self + { + $this->container['activated'] = $activated; + + return $this; + } + + /** + * Gets last_login + * + * @return string|null + */ + public function getLastLogin() + { + return $this->container['last_login']; + } + + /** + * Sets last_login + * + * @param string|null $last_login The last login date and time of the user. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setLastLogin($last_login): self + { + $this->container['last_login'] = $last_login; + + return $this; + } + + /** + * Gets created + * + * @return string|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param string|null $created The creation date and time of the user. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setCreated($created): self + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets modified + * + * @return string|null + */ + public function getModified() + { + return $this->container['modified']; + } + + /** + * Sets modified + * + * @param string|null $modified The last modification date and time of the user. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setModified($modified): self + { + $this->container['modified'] = $modified; + + return $this; + } + + /** + * Gets has_created_company + * + * @return bool|null + */ + public function getHasCreatedCompany() + { + return $this->container['has_created_company']; + } + + /** + * Sets has_created_company + * + * @param bool|null $has_created_company Boolean that indicates whether the user has created a company + * + * @return self + */ + public function setHasCreatedCompany($has_created_company): self + { + $this->container['has_created_company'] = $has_created_company; + + return $this; + } + + /** + * Gets access + * + * @return \Pipedrive\Model\UserAccess[]|null + */ + public function getAccess() + { + return $this->container['access']; + } + + /** + * Sets access + * + * @param \Pipedrive\Model\UserAccess[]|null $access access + * + * @return self + */ + public function setAccess($access): self + { + $this->container['access'] = $access; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Boolean that indicates whether the user is activated + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets timezone_name + * + * @return string|null + */ + public function getTimezoneName() + { + return $this->container['timezone_name']; + } + + /** + * Sets timezone_name + * + * @param string|null $timezone_name The user timezone name + * + * @return self + */ + public function setTimezoneName($timezone_name): self + { + $this->container['timezone_name'] = $timezone_name; + + return $this; + } + + /** + * Gets timezone_offset + * + * @return string|null + */ + public function getTimezoneOffset() + { + return $this->container['timezone_offset']; + } + + /** + * Sets timezone_offset + * + * @param string|null $timezone_offset The user timezone offset + * + * @return self + */ + public function setTimezoneOffset($timezone_offset): self + { + $this->container['timezone_offset'] = $timezone_offset; + + return $this; + } + + /** + * Gets role_id + * + * @return int|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param int|null $role_id The ID of the user role + * + * @return self + */ + public function setRoleId($role_id): self + { + $this->container['role_id'] = $role_id; + + return $this; + } + + /** + * Gets icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url The user icon URL + * + * @return self + */ + public function setIconUrl($icon_url): self + { + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets is_you + * + * @return bool|null + */ + public function getIsYou() + { + return $this->container['is_you']; + } + + /** + * Sets is_you + * + * @param bool|null $is_you Boolean that indicates if the requested user is the same which is logged in (in this case, always true) + * + * @return self + */ + public function setIsYou($is_you): self + { + $this->container['is_you'] = $is_you; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseUserMe.php b/lib/Model/BaseUserMe.php new file mode 100644 index 00000000..93bff085 --- /dev/null +++ b/lib/Model/BaseUserMe.php @@ -0,0 +1,1062 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseUserMe implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseUserMe'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'default_currency' => 'string', + 'locale' => 'string', + 'lang' => 'int', + 'email' => 'string', + 'phone' => 'string', + 'activated' => 'bool', + 'last_login' => 'string', + 'created' => 'string', + 'modified' => 'string', + 'has_created_company' => 'bool', + 'access' => '\Pipedrive\Model\UserAccess[]', + 'active_flag' => 'bool', + 'timezone_name' => 'string', + 'timezone_offset' => 'string', + 'role_id' => 'int', + 'icon_url' => 'string', + 'is_you' => 'bool', + 'company_id' => 'int', + 'company_name' => 'string', + 'company_domain' => 'string', + 'company_country' => 'string', + 'company_industry' => 'string', + 'language' => '\Pipedrive\Model\BaseUserMeAllOfLanguage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'default_currency' => null, + 'locale' => null, + 'lang' => null, + 'email' => null, + 'phone' => null, + 'activated' => null, + 'last_login' => null, + 'created' => null, + 'modified' => null, + 'has_created_company' => null, + 'access' => null, + 'active_flag' => null, + 'timezone_name' => null, + 'timezone_offset' => null, + 'role_id' => null, + 'icon_url' => null, + 'is_you' => null, + 'company_id' => null, + 'company_name' => null, + 'company_domain' => null, + 'company_country' => null, + 'company_industry' => null, + 'language' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'default_currency' => 'default_currency', + 'locale' => 'locale', + 'lang' => 'lang', + 'email' => 'email', + 'phone' => 'phone', + 'activated' => 'activated', + 'last_login' => 'last_login', + 'created' => 'created', + 'modified' => 'modified', + 'has_created_company' => 'has_created_company', + 'access' => 'access', + 'active_flag' => 'active_flag', + 'timezone_name' => 'timezone_name', + 'timezone_offset' => 'timezone_offset', + 'role_id' => 'role_id', + 'icon_url' => 'icon_url', + 'is_you' => 'is_you', + 'company_id' => 'company_id', + 'company_name' => 'company_name', + 'company_domain' => 'company_domain', + 'company_country' => 'company_country', + 'company_industry' => 'company_industry', + 'language' => 'language' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'default_currency' => 'setDefaultCurrency', + 'locale' => 'setLocale', + 'lang' => 'setLang', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'activated' => 'setActivated', + 'last_login' => 'setLastLogin', + 'created' => 'setCreated', + 'modified' => 'setModified', + 'has_created_company' => 'setHasCreatedCompany', + 'access' => 'setAccess', + 'active_flag' => 'setActiveFlag', + 'timezone_name' => 'setTimezoneName', + 'timezone_offset' => 'setTimezoneOffset', + 'role_id' => 'setRoleId', + 'icon_url' => 'setIconUrl', + 'is_you' => 'setIsYou', + 'company_id' => 'setCompanyId', + 'company_name' => 'setCompanyName', + 'company_domain' => 'setCompanyDomain', + 'company_country' => 'setCompanyCountry', + 'company_industry' => 'setCompanyIndustry', + 'language' => 'setLanguage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'default_currency' => 'getDefaultCurrency', + 'locale' => 'getLocale', + 'lang' => 'getLang', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'activated' => 'getActivated', + 'last_login' => 'getLastLogin', + 'created' => 'getCreated', + 'modified' => 'getModified', + 'has_created_company' => 'getHasCreatedCompany', + 'access' => 'getAccess', + 'active_flag' => 'getActiveFlag', + 'timezone_name' => 'getTimezoneName', + 'timezone_offset' => 'getTimezoneOffset', + 'role_id' => 'getRoleId', + 'icon_url' => 'getIconUrl', + 'is_you' => 'getIsYou', + 'company_id' => 'getCompanyId', + 'company_name' => 'getCompanyName', + 'company_domain' => 'getCompanyDomain', + 'company_country' => 'getCompanyCountry', + 'company_industry' => 'getCompanyIndustry', + 'language' => 'getLanguage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['default_currency'] = $data['default_currency'] ?? null; + $this->container['locale'] = $data['locale'] ?? null; + $this->container['lang'] = $data['lang'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['activated'] = $data['activated'] ?? null; + $this->container['last_login'] = $data['last_login'] ?? null; + $this->container['created'] = $data['created'] ?? null; + $this->container['modified'] = $data['modified'] ?? null; + $this->container['has_created_company'] = $data['has_created_company'] ?? null; + $this->container['access'] = $data['access'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['timezone_name'] = $data['timezone_name'] ?? null; + $this->container['timezone_offset'] = $data['timezone_offset'] ?? null; + $this->container['role_id'] = $data['role_id'] ?? null; + $this->container['icon_url'] = $data['icon_url'] ?? null; + $this->container['is_you'] = $data['is_you'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['company_name'] = $data['company_name'] ?? null; + $this->container['company_domain'] = $data['company_domain'] ?? null; + $this->container['company_country'] = $data['company_country'] ?? null; + $this->container['company_industry'] = $data['company_industry'] ?? null; + $this->container['language'] = $data['language'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The user ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The user name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets default_currency + * + * @return string|null + */ + public function getDefaultCurrency() + { + return $this->container['default_currency']; + } + + /** + * Sets default_currency + * + * @param string|null $default_currency The user default currency + * + * @return self + */ + public function setDefaultCurrency($default_currency): self + { + $this->container['default_currency'] = $default_currency; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale The user locale + * + * @return self + */ + public function setLocale($locale): self + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets lang + * + * @return int|null + */ + public function getLang() + { + return $this->container['lang']; + } + + /** + * Sets lang + * + * @param int|null $lang The user language ID + * + * @return self + */ + public function setLang($lang): self + { + $this->container['lang'] = $lang; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The user email + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone The user phone + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets activated + * + * @return bool|null + */ + public function getActivated() + { + return $this->container['activated']; + } + + /** + * Sets activated + * + * @param bool|null $activated Boolean that indicates whether the user is activated + * + * @return self + */ + public function setActivated($activated): self + { + $this->container['activated'] = $activated; + + return $this; + } + + /** + * Gets last_login + * + * @return string|null + */ + public function getLastLogin() + { + return $this->container['last_login']; + } + + /** + * Sets last_login + * + * @param string|null $last_login The last login date and time of the user. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setLastLogin($last_login): self + { + $this->container['last_login'] = $last_login; + + return $this; + } + + /** + * Gets created + * + * @return string|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param string|null $created The creation date and time of the user. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setCreated($created): self + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets modified + * + * @return string|null + */ + public function getModified() + { + return $this->container['modified']; + } + + /** + * Sets modified + * + * @param string|null $modified The last modification date and time of the user. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setModified($modified): self + { + $this->container['modified'] = $modified; + + return $this; + } + + /** + * Gets has_created_company + * + * @return bool|null + */ + public function getHasCreatedCompany() + { + return $this->container['has_created_company']; + } + + /** + * Sets has_created_company + * + * @param bool|null $has_created_company Boolean that indicates whether the user has created a company + * + * @return self + */ + public function setHasCreatedCompany($has_created_company): self + { + $this->container['has_created_company'] = $has_created_company; + + return $this; + } + + /** + * Gets access + * + * @return \Pipedrive\Model\UserAccess[]|null + */ + public function getAccess() + { + return $this->container['access']; + } + + /** + * Sets access + * + * @param \Pipedrive\Model\UserAccess[]|null $access access + * + * @return self + */ + public function setAccess($access): self + { + $this->container['access'] = $access; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Boolean that indicates whether the user is activated + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets timezone_name + * + * @return string|null + */ + public function getTimezoneName() + { + return $this->container['timezone_name']; + } + + /** + * Sets timezone_name + * + * @param string|null $timezone_name The user timezone name + * + * @return self + */ + public function setTimezoneName($timezone_name): self + { + $this->container['timezone_name'] = $timezone_name; + + return $this; + } + + /** + * Gets timezone_offset + * + * @return string|null + */ + public function getTimezoneOffset() + { + return $this->container['timezone_offset']; + } + + /** + * Sets timezone_offset + * + * @param string|null $timezone_offset The user timezone offset + * + * @return self + */ + public function setTimezoneOffset($timezone_offset): self + { + $this->container['timezone_offset'] = $timezone_offset; + + return $this; + } + + /** + * Gets role_id + * + * @return int|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param int|null $role_id The ID of the user role + * + * @return self + */ + public function setRoleId($role_id): self + { + $this->container['role_id'] = $role_id; + + return $this; + } + + /** + * Gets icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url The user icon URL + * + * @return self + */ + public function setIconUrl($icon_url): self + { + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets is_you + * + * @return bool|null + */ + public function getIsYou() + { + return $this->container['is_you']; + } + + /** + * Sets is_you + * + * @param bool|null $is_you Boolean that indicates if the requested user is the same which is logged in (in this case, always true) + * + * @return self + */ + public function setIsYou($is_you): self + { + $this->container['is_you'] = $is_you; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The user company ID + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets company_name + * + * @return string|null + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param string|null $company_name The user company name + * + * @return self + */ + public function setCompanyName($company_name): self + { + $this->container['company_name'] = $company_name; + + return $this; + } + + /** + * Gets company_domain + * + * @return string|null + */ + public function getCompanyDomain() + { + return $this->container['company_domain']; + } + + /** + * Sets company_domain + * + * @param string|null $company_domain The user company domain + * + * @return self + */ + public function setCompanyDomain($company_domain): self + { + $this->container['company_domain'] = $company_domain; + + return $this; + } + + /** + * Gets company_country + * + * @return string|null + */ + public function getCompanyCountry() + { + return $this->container['company_country']; + } + + /** + * Sets company_country + * + * @param string|null $company_country The user company country + * + * @return self + */ + public function setCompanyCountry($company_country): self + { + $this->container['company_country'] = $company_country; + + return $this; + } + + /** + * Gets company_industry + * + * @return string|null + */ + public function getCompanyIndustry() + { + return $this->container['company_industry']; + } + + /** + * Sets company_industry + * + * @param string|null $company_industry The user company industry + * + * @return self + */ + public function setCompanyIndustry($company_industry): self + { + $this->container['company_industry'] = $company_industry; + + return $this; + } + + /** + * Gets language + * + * @return \Pipedrive\Model\BaseUserMeAllOfLanguage|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param \Pipedrive\Model\BaseUserMeAllOfLanguage|null $language language + * + * @return self + */ + public function setLanguage($language): self + { + $this->container['language'] = $language; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseUserMeAllOf.php b/lib/Model/BaseUserMeAllOf.php new file mode 100644 index 00000000..3fabe33c --- /dev/null +++ b/lib/Model/BaseUserMeAllOf.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseUserMeAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseUserMe_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'company_id' => 'int', + 'company_name' => 'string', + 'company_domain' => 'string', + 'company_country' => 'string', + 'company_industry' => 'string', + 'language' => '\Pipedrive\Model\BaseUserMeAllOfLanguage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'company_id' => null, + 'company_name' => null, + 'company_domain' => null, + 'company_country' => null, + 'company_industry' => null, + 'language' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'company_id' => 'company_id', + 'company_name' => 'company_name', + 'company_domain' => 'company_domain', + 'company_country' => 'company_country', + 'company_industry' => 'company_industry', + 'language' => 'language' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'company_id' => 'setCompanyId', + 'company_name' => 'setCompanyName', + 'company_domain' => 'setCompanyDomain', + 'company_country' => 'setCompanyCountry', + 'company_industry' => 'setCompanyIndustry', + 'language' => 'setLanguage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'company_id' => 'getCompanyId', + 'company_name' => 'getCompanyName', + 'company_domain' => 'getCompanyDomain', + 'company_country' => 'getCompanyCountry', + 'company_industry' => 'getCompanyIndustry', + 'language' => 'getLanguage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['company_name'] = $data['company_name'] ?? null; + $this->container['company_domain'] = $data['company_domain'] ?? null; + $this->container['company_country'] = $data['company_country'] ?? null; + $this->container['company_industry'] = $data['company_industry'] ?? null; + $this->container['language'] = $data['language'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The user company ID + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets company_name + * + * @return string|null + */ + public function getCompanyName() + { + return $this->container['company_name']; + } + + /** + * Sets company_name + * + * @param string|null $company_name The user company name + * + * @return self + */ + public function setCompanyName($company_name): self + { + $this->container['company_name'] = $company_name; + + return $this; + } + + /** + * Gets company_domain + * + * @return string|null + */ + public function getCompanyDomain() + { + return $this->container['company_domain']; + } + + /** + * Sets company_domain + * + * @param string|null $company_domain The user company domain + * + * @return self + */ + public function setCompanyDomain($company_domain): self + { + $this->container['company_domain'] = $company_domain; + + return $this; + } + + /** + * Gets company_country + * + * @return string|null + */ + public function getCompanyCountry() + { + return $this->container['company_country']; + } + + /** + * Sets company_country + * + * @param string|null $company_country The user company country + * + * @return self + */ + public function setCompanyCountry($company_country): self + { + $this->container['company_country'] = $company_country; + + return $this; + } + + /** + * Gets company_industry + * + * @return string|null + */ + public function getCompanyIndustry() + { + return $this->container['company_industry']; + } + + /** + * Sets company_industry + * + * @param string|null $company_industry The user company industry + * + * @return self + */ + public function setCompanyIndustry($company_industry): self + { + $this->container['company_industry'] = $company_industry; + + return $this; + } + + /** + * Gets language + * + * @return \Pipedrive\Model\BaseUserMeAllOfLanguage|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param \Pipedrive\Model\BaseUserMeAllOfLanguage|null $language language + * + * @return self + */ + public function setLanguage($language): self + { + $this->container['language'] = $language; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseUserMeAllOfLanguage.php b/lib/Model/BaseUserMeAllOfLanguage.php new file mode 100644 index 00000000..c1317ee7 --- /dev/null +++ b/lib/Model/BaseUserMeAllOfLanguage.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseUserMeAllOfLanguage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseUserMe_allOf_language'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'language_code' => 'string', + 'country_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'language_code' => null, + 'country_code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'language_code' => 'language_code', + 'country_code' => 'country_code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'language_code' => 'setLanguageCode', + 'country_code' => 'setCountryCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'language_code' => 'getLanguageCode', + 'country_code' => 'getCountryCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['language_code'] = $data['language_code'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets language_code + * + * @return string|null + */ + public function getLanguageCode() + { + return $this->container['language_code']; + } + + /** + * Sets language_code + * + * @param string|null $language_code The language code. E.g. en + * + * @return self + */ + public function setLanguageCode($language_code): self + { + $this->container['language_code'] = $language_code; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The country code. E.g. US + * + * @return self + */ + public function setCountryCode($country_code): self + { + $this->container['country_code'] = $country_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BaseWebhook.php b/lib/Model/BaseWebhook.php new file mode 100644 index 00000000..1937414e --- /dev/null +++ b/lib/Model/BaseWebhook.php @@ -0,0 +1,888 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseWebhook implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BaseWebhook'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'owner_id' => 'int', + 'user_id' => 'int', + 'event_action' => 'string', + 'event_object' => 'string', + 'subscription_url' => 'string', + 'is_active' => '\Pipedrive\Model\NumberBooleanDefault1', + 'add_time' => '\DateTime', + 'remove_time' => '\DateTime', + 'type' => 'string', + 'http_auth_user' => 'string', + 'http_auth_password' => 'string', + 'additional_data' => 'object', + 'remove_reason' => 'string', + 'last_delivery_time' => '\DateTime', + 'last_http_status' => 'int', + 'admin_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'owner_id' => null, + 'user_id' => null, + 'event_action' => null, + 'event_object' => null, + 'subscription_url' => null, + 'is_active' => null, + 'add_time' => 'date-time', + 'remove_time' => 'date-time', + 'type' => null, + 'http_auth_user' => null, + 'http_auth_password' => null, + 'additional_data' => null, + 'remove_reason' => null, + 'last_delivery_time' => 'date-time', + 'last_http_status' => null, + 'admin_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'owner_id' => 'owner_id', + 'user_id' => 'user_id', + 'event_action' => 'event_action', + 'event_object' => 'event_object', + 'subscription_url' => 'subscription_url', + 'is_active' => 'is_active', + 'add_time' => 'add_time', + 'remove_time' => 'remove_time', + 'type' => 'type', + 'http_auth_user' => 'http_auth_user', + 'http_auth_password' => 'http_auth_password', + 'additional_data' => 'additional_data', + 'remove_reason' => 'remove_reason', + 'last_delivery_time' => 'last_delivery_time', + 'last_http_status' => 'last_http_status', + 'admin_id' => 'admin_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'owner_id' => 'setOwnerId', + 'user_id' => 'setUserId', + 'event_action' => 'setEventAction', + 'event_object' => 'setEventObject', + 'subscription_url' => 'setSubscriptionUrl', + 'is_active' => 'setIsActive', + 'add_time' => 'setAddTime', + 'remove_time' => 'setRemoveTime', + 'type' => 'setType', + 'http_auth_user' => 'setHttpAuthUser', + 'http_auth_password' => 'setHttpAuthPassword', + 'additional_data' => 'setAdditionalData', + 'remove_reason' => 'setRemoveReason', + 'last_delivery_time' => 'setLastDeliveryTime', + 'last_http_status' => 'setLastHttpStatus', + 'admin_id' => 'setAdminId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'owner_id' => 'getOwnerId', + 'user_id' => 'getUserId', + 'event_action' => 'getEventAction', + 'event_object' => 'getEventObject', + 'subscription_url' => 'getSubscriptionUrl', + 'is_active' => 'getIsActive', + 'add_time' => 'getAddTime', + 'remove_time' => 'getRemoveTime', + 'type' => 'getType', + 'http_auth_user' => 'getHttpAuthUser', + 'http_auth_password' => 'getHttpAuthPassword', + 'additional_data' => 'getAdditionalData', + 'remove_reason' => 'getRemoveReason', + 'last_delivery_time' => 'getLastDeliveryTime', + 'last_http_status' => 'getLastHttpStatus', + 'admin_id' => 'getAdminId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const TYPE_GENERAL = 'general'; + const TYPE_APP = 'app'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getTypeAllowableValues(): array + { + return [ + self::TYPE_GENERAL, + self::TYPE_APP, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['event_action'] = $data['event_action'] ?? null; + $this->container['event_object'] = $data['event_object'] ?? null; + $this->container['subscription_url'] = $data['subscription_url'] ?? null; + $this->container['is_active'] = $data['is_active'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['remove_time'] = $data['remove_time'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['http_auth_user'] = $data['http_auth_user'] ?? null; + $this->container['http_auth_password'] = $data['http_auth_password'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['remove_reason'] = $data['remove_reason'] ?? null; + $this->container['last_delivery_time'] = $data['last_delivery_time'] ?? null; + $this->container['last_http_status'] = $data['last_http_status'] ?? null; + $this->container['admin_id'] = $data['admin_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the Webhook + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the Webhook + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who owns the Webhook + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user related to the Webhook + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets event_action + * + * @return string|null + */ + public function getEventAction() + { + return $this->container['event_action']; + } + + /** + * Sets event_action + * + * @param string|null $event_action The Webhook action + * + * @return self + */ + public function setEventAction($event_action): self + { + $this->container['event_action'] = $event_action; + + return $this; + } + + /** + * Gets event_object + * + * @return string|null + */ + public function getEventObject() + { + return $this->container['event_object']; + } + + /** + * Sets event_object + * + * @param string|null $event_object The Webhook object + * + * @return self + */ + public function setEventObject($event_object): self + { + $this->container['event_object'] = $event_object; + + return $this; + } + + /** + * Gets subscription_url + * + * @return string|null + */ + public function getSubscriptionUrl() + { + return $this->container['subscription_url']; + } + + /** + * Sets subscription_url + * + * @param string|null $subscription_url The subscription URL of the Webhook + * + * @return self + */ + public function setSubscriptionUrl($subscription_url): self + { + $this->container['subscription_url'] = $subscription_url; + + return $this; + } + + /** + * Gets is_active + * + * @return \Pipedrive\Model\NumberBooleanDefault1|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param \Pipedrive\Model\NumberBooleanDefault1|null $is_active The Webhook's status + * + * @return self + */ + public function setIsActive($is_active): self + { + $this->container['is_active'] = $is_active; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The date when the Webhook was added + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets remove_time + * + * @return \DateTime|null + */ + public function getRemoveTime() + { + return $this->container['remove_time']; + } + + /** + * Sets remove_time + * + * @param \DateTime|null $remove_time The date when the Webhook was removed (if removed) + * + * @return self + */ + public function setRemoveTime($remove_time): self + { + $this->container['remove_time'] = $remove_time; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the Webhook + * + * @return self + */ + public function setType($type): self + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets http_auth_user + * + * @return string|null + */ + public function getHttpAuthUser() + { + return $this->container['http_auth_user']; + } + + /** + * Sets http_auth_user + * + * @param string|null $http_auth_user The username of the `subscription_url` of the Webhook + * + * @return self + */ + public function setHttpAuthUser($http_auth_user): self + { + $this->container['http_auth_user'] = $http_auth_user; + + return $this; + } + + /** + * Gets http_auth_password + * + * @return string|null + */ + public function getHttpAuthPassword() + { + return $this->container['http_auth_password']; + } + + /** + * Sets http_auth_password + * + * @param string|null $http_auth_password The password of the `subscription_url` of the Webhook + * + * @return self + */ + public function setHttpAuthPassword($http_auth_password): self + { + $this->container['http_auth_password'] = $http_auth_password; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data Any additional data related to the Webhook + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets remove_reason + * + * @return string|null + */ + public function getRemoveReason() + { + return $this->container['remove_reason']; + } + + /** + * Sets remove_reason + * + * @param string|null $remove_reason The removal reason of the Webhook (if removed) + * + * @return self + */ + public function setRemoveReason($remove_reason): self + { + $this->container['remove_reason'] = $remove_reason; + + return $this; + } + + /** + * Gets last_delivery_time + * + * @return \DateTime|null + */ + public function getLastDeliveryTime() + { + return $this->container['last_delivery_time']; + } + + /** + * Sets last_delivery_time + * + * @param \DateTime|null $last_delivery_time The last delivery time of the Webhook + * + * @return self + */ + public function setLastDeliveryTime($last_delivery_time): self + { + $this->container['last_delivery_time'] = $last_delivery_time; + + return $this; + } + + /** + * Gets last_http_status + * + * @return int|null + */ + public function getLastHttpStatus() + { + return $this->container['last_http_status']; + } + + /** + * Sets last_http_status + * + * @param int|null $last_http_status The last delivery HTTP status of the Webhook + * + * @return self + */ + public function setLastHttpStatus($last_http_status): self + { + $this->container['last_http_status'] = $last_http_status; + + return $this; + } + + /** + * Gets admin_id + * + * @return int|null + */ + public function getAdminId() + { + return $this->container['admin_id']; + } + + /** + * Sets admin_id + * + * @param int|null $admin_id The ID of the admin of the Webhook + * + * @return self + */ + public function setAdminId($admin_id): self + { + $this->container['admin_id'] = $admin_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasicDeal.php b/lib/Model/BasicDeal.php new file mode 100644 index 00000000..7226c771 --- /dev/null +++ b/lib/Model/BasicDeal.php @@ -0,0 +1,712 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasicDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasicDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'currency' => 'string', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'pipeline_id' => 'int', + 'stage_id' => 'int', + 'status' => 'string', + 'expected_close_date' => '\DateTime', + 'probability' => 'float', + 'lost_reason' => 'string', + 'visible_to' => '\Pipedrive\Model\VisibleTo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'currency' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'pipeline_id' => null, + 'stage_id' => null, + 'status' => null, + 'expected_close_date' => 'date', + 'probability' => null, + 'lost_reason' => null, + 'visible_to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'currency' => 'currency', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'pipeline_id' => 'pipeline_id', + 'stage_id' => 'stage_id', + 'status' => 'status', + 'expected_close_date' => 'expected_close_date', + 'probability' => 'probability', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'pipeline_id' => 'setPipelineId', + 'stage_id' => 'setStageId', + 'status' => 'setStatus', + 'expected_close_date' => 'setExpectedCloseDate', + 'probability' => 'setProbability', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'pipeline_id' => 'getPipelineId', + 'stage_id' => 'getStageId', + 'status' => 'getStatus', + 'expected_close_date' => 'getExpectedCloseDate', + 'probability' => 'getProbability', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const STATUS_OPEN = 'open'; + const STATUS_WON = 'won'; + const STATUS_LOST = 'lost'; + const STATUS_DELETED = 'deleted'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getStatusAllowableValues(): array + { + return [ + self::STATUS_OPEN, + self::STATUS_WON, + self::STATUS_LOST, + self::STATUS_DELETED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value of the deal. If omitted, value will be set to 0. + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. + * + * @return self + */ + public function setStatus($status): self + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The optional message about why the deal was lost (to be used when status = lost) + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasicDealProduct.php b/lib/Model/BasicDealProduct.php new file mode 100644 index 00000000..b6f47e9c --- /dev/null +++ b/lib/Model/BasicDealProduct.php @@ -0,0 +1,621 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasicDealProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasicDealProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'product_id' => 'int', + 'item_price' => 'float', + 'quantity' => 'int', + 'discount_percentage' => 'float', + 'duration' => 'float', + 'duration_unit' => 'DealProductUnitDuration', + 'product_variation_id' => 'int', + 'comments' => 'string', + 'tax' => 'float', + 'enabled_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'item_price' => null, + 'quantity' => null, + 'discount_percentage' => null, + 'duration' => null, + 'duration_unit' => null, + 'product_variation_id' => null, + 'comments' => null, + 'tax' => null, + 'enabled_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'item_price' => 'item_price', + 'quantity' => 'quantity', + 'discount_percentage' => 'discount_percentage', + 'duration' => 'duration', + 'duration_unit' => 'duration_unit', + 'product_variation_id' => 'product_variation_id', + 'comments' => 'comments', + 'tax' => 'tax', + 'enabled_flag' => 'enabled_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'item_price' => 'setItemPrice', + 'quantity' => 'setQuantity', + 'discount_percentage' => 'setDiscountPercentage', + 'duration' => 'setDuration', + 'duration_unit' => 'setDurationUnit', + 'product_variation_id' => 'setProductVariationId', + 'comments' => 'setComments', + 'tax' => 'setTax', + 'enabled_flag' => 'setEnabledFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'item_price' => 'getItemPrice', + 'quantity' => 'getQuantity', + 'discount_percentage' => 'getDiscountPercentage', + 'duration' => 'getDuration', + 'duration_unit' => 'getDurationUnit', + 'product_variation_id' => 'getProductVariationId', + 'comments' => 'getComments', + 'tax' => 'getTax', + 'enabled_flag' => 'getEnabledFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['item_price'] = $data['item_price'] ?? null; + $this->container['quantity'] = $data['quantity'] ?? null; + $this->container['discount_percentage'] = $data['discount_percentage'] ?? 0; + $this->container['duration'] = $data['duration'] ?? 1; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['product_variation_id'] = $data['product_variation_id'] ?? null; + $this->container['comments'] = $data['comments'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['enabled_flag'] = $data['enabled_flag'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['item_price'] === null) { + $invalidProperties[] = "'item_price' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' 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 product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id The ID of the product to use + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets item_price + * + * @return float + */ + public function getItemPrice() + { + return $this->container['item_price']; + } + + /** + * Sets item_price + * + * @param float $item_price The price at which this product will be added to the deal + * + * @return self + */ + public function setItemPrice($item_price): self + { + $this->container['item_price'] = $item_price; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity Quantity – e.g. how many items of this product will be added to the deal + * + * @return self + */ + public function setQuantity($quantity): self + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets discount_percentage + * + * @return float|null + */ + public function getDiscountPercentage() + { + return $this->container['discount_percentage']; + } + + /** + * Sets discount_percentage + * + * @param float|null $discount_percentage The discount %. If omitted, will be set to 0. + * + * @return self + */ + public function setDiscountPercentage($discount_percentage): self + { + $this->container['discount_percentage'] = $discount_percentage; + + return $this; + } + + /** + * Gets duration + * + * @return float|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param float|null $duration The duration of the product. If omitted, will be set to 1. + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets duration_unit + * + * @return DealProductUnitDuration|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param DealProductUnitDuration|null $duration_unit The unit duration of the product + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets product_variation_id + * + * @return int|null + */ + public function getProductVariationId() + { + return $this->container['product_variation_id']; + } + + /** + * Sets product_variation_id + * + * @param int|null $product_variation_id The ID of the product variation to use. When omitted, no variation will be used. + * + * @return self + */ + public function setProductVariationId($product_variation_id): self + { + $this->container['product_variation_id'] = $product_variation_id; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments A textual comment associated with this product-deal attachment + * + * @return self + */ + public function setComments($comments): self + { + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets enabled_flag + * + * @return bool|null + */ + public function getEnabledFlag() + { + return $this->container['enabled_flag']; + } + + /** + * Sets enabled_flag + * + * @param bool|null $enabled_flag Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. + * + * @return self + */ + public function setEnabledFlag($enabled_flag): self + { + $this->container['enabled_flag'] = $enabled_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasicGoal.php b/lib/Model/BasicGoal.php new file mode 100644 index 00000000..06e17727 --- /dev/null +++ b/lib/Model/BasicGoal.php @@ -0,0 +1,532 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasicGoal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasicGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'assignee' => 'object', + 'type' => 'object', + 'expected_outcome' => 'object', + 'duration' => 'object', + 'interval' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'assignee' => null, + 'type' => null, + 'expected_outcome' => null, + 'duration' => null, + 'interval' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'assignee' => 'assignee', + 'type' => 'type', + 'expected_outcome' => 'expected_outcome', + 'duration' => 'duration', + 'interval' => 'interval' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'assignee' => 'setAssignee', + 'type' => 'setType', + 'expected_outcome' => 'setExpectedOutcome', + 'duration' => 'setDuration', + 'interval' => 'setInterval' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'assignee' => 'getAssignee', + 'type' => 'getType', + 'expected_outcome' => 'getExpectedOutcome', + 'duration' => 'getDuration', + 'interval' => 'getInterval' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const INTERVAL_WEEKLY = 'weekly'; + const INTERVAL_MONTHLY = 'monthly'; + const INTERVAL_QUARTERLY = 'quarterly'; + const INTERVAL_YEARLY = 'yearly'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getIntervalAllowableValues(): array + { + return [ + self::INTERVAL_WEEKLY, + self::INTERVAL_MONTHLY, + self::INTERVAL_QUARTERLY, + self::INTERVAL_YEARLY, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['assignee'] = $data['assignee'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['expected_outcome'] = $data['expected_outcome'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['interval'] = $data['interval'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the goal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets assignee + * + * @return object|null + */ + public function getAssignee() + { + return $this->container['assignee']; + } + + /** + * Sets assignee + * + * @param object|null $assignee Who this goal is assigned to. It requires the following JSON structure: `{ \"id\": \"1\", \"type\": \"person\" }`. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. + * + * @return self + */ + public function setAssignee($assignee): self + { + $this->container['assignee'] = $assignee; + + return $this; + } + + /** + * Gets type + * + * @return object|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param object|null $type The type of the goal. It requires the following JSON structure: `{ \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }`. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.” + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets expected_outcome + * + * @return object|null + */ + public function getExpectedOutcome() + { + return $this->container['expected_outcome']; + } + + /** + * Sets expected_outcome + * + * @param object|null $expected_outcome The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: `{ \"target\": \"50\", \"tracking_metric\": \"quantity\" }` or `{ \"target\": \"50\", \"tracking_metric\": \"sum\", \"currency_id\": 1 }`. `currency_id` should only be added to `sum` type of goals. + * + * @return self + */ + public function setExpectedOutcome($expected_outcome): self + { + $this->container['expected_outcome'] = $expected_outcome; + + return $this; + } + + /** + * Gets duration + * + * @return object|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param object|null $duration The date when the goal starts and ends. It requires the following JSON structure: `{ \"start\": \"2019-01-01\", \"end\": \"2022-12-31\" }`. Date in format of YYYY-MM-DD. \"end\" can be set to `null` for an infinite, open-ended goal. + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets interval + * + * @return string|null + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string|null $interval The interval of the goal + * + * @return self + */ + public function setInterval($interval): self + { + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($interval) && !in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['interval'] = $interval; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasicOrganization.php b/lib/Model/BasicOrganization.php new file mode 100644 index 00000000..316d462f --- /dev/null +++ b/lib/Model/BasicOrganization.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasicOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasicOrganization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => 'int', + 'visible_to' => '\Pipedrive\Model\VisibleTo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'visible_to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'visible_to' => 'visible_to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'visible_to' => 'setVisibleTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'visible_to' => 'getVisibleTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasicPerson.php b/lib/Model/BasicPerson.php new file mode 100644 index 00000000..663cda37 --- /dev/null +++ b/lib/Model/BasicPerson.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasicPerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasicPerson'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => 'int', + 'org_id' => 'int', + 'email' => '\Pipedrive\Model\BasicPersonEmail[]', + 'phone' => '\Pipedrive\Model\BasePersonItemPhone[]', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'marketing_status' => '\Pipedrive\Model\MarketingStatus', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null, + 'email' => null, + 'phone' => null, + 'visible_to' => null, + 'marketing_status' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'email' => 'email', + 'phone' => 'phone', + 'visible_to' => 'visible_to', + 'marketing_status' => 'marketing_status', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'visible_to' => 'setVisibleTo', + 'marketing_status' => 'setMarketingStatus', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'visible_to' => 'getVisibleTo', + 'marketing_status' => 'getMarketingStatus', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['marketing_status'] = $data['marketing_status'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this person will belong to + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\BasicPersonEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\BasicPersonEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets marketing_status + * + * @return MarketingStatus|null + */ + public function getMarketingStatus() + { + return $this->container['marketing_status']; + } + + /** + * Sets marketing_status + * + * @param MarketingStatus|null $marketing_status If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
+ * + * @return self + */ + public function setMarketingStatus($marketing_status): self + { + $this->container['marketing_status'] = $marketing_status; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BasicPersonEmail.php b/lib/Model/BasicPersonEmail.php new file mode 100644 index 00000000..26c2b35b --- /dev/null +++ b/lib/Model/BasicPersonEmail.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BasicPersonEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BasicPerson_email'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'string', + 'primary' => 'bool', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'primary' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'primary' => 'primary', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'primary' => 'setPrimary', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'primary' => 'getPrimary', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['label'] = $data['label'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The email + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Boolean that indicates if email is primary for the person or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label that indicates the type of the email. (Possible values - work, home or other) + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BulkDeleteResponse.php b/lib/Model/BulkDeleteResponse.php new file mode 100644 index 00000000..5f1e098e --- /dev/null +++ b/lib/Model/BulkDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BulkDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BulkDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BulkDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BulkDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BulkDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BulkDeleteResponseAllOf.php b/lib/Model/BulkDeleteResponseAllOf.php new file mode 100644 index 00000000..dce4bc7f --- /dev/null +++ b/lib/Model/BulkDeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BulkDeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BulkDeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BulkDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BulkDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BulkDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/BulkDeleteResponseAllOfData.php b/lib/Model/BulkDeleteResponseAllOfData.php new file mode 100644 index 00000000..22f711ae --- /dev/null +++ b/lib/Model/BulkDeleteResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BulkDeleteResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'BulkDeleteResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The list of deleted field IDs + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CalculatedFields.php b/lib/Model/CalculatedFields.php new file mode 100644 index 00000000..a4c20b19 --- /dev/null +++ b/lib/Model/CalculatedFields.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CalculatedFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CalculatedFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'calculated_type' => 'string', + 'calculated_related_org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'calculated_type' => null, + 'calculated_related_org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'calculated_type' => 'calculated_type', + 'calculated_related_org_id' => 'calculated_related_org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'calculated_type' => 'setCalculatedType', + 'calculated_related_org_id' => 'setCalculatedRelatedOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'calculated_type' => 'getCalculatedType', + 'calculated_related_org_id' => 'getCalculatedRelatedOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['calculated_type'] = $data['calculated_type'] ?? null; + $this->container['calculated_related_org_id'] = $data['calculated_related_org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets calculated_type + * + * @return string|null + */ + public function getCalculatedType() + { + return $this->container['calculated_type']; + } + + /** + * Sets calculated_type + * + * @param string|null $calculated_type The calculated type of the relationship with the linked organization + * + * @return self + */ + public function setCalculatedType($calculated_type): self + { + $this->container['calculated_type'] = $calculated_type; + + return $this; + } + + /** + * Gets calculated_related_org_id + * + * @return int|null + */ + public function getCalculatedRelatedOrgId() + { + return $this->container['calculated_related_org_id']; + } + + /** + * Sets calculated_related_org_id + * + * @param int|null $calculated_related_org_id The ID of the linked organization + * + * @return self + */ + public function setCalculatedRelatedOrgId($calculated_related_org_id): self + { + $this->container['calculated_related_org_id'] = $calculated_related_org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogObject.php b/lib/Model/CallLogObject.php new file mode 100644 index 00000000..614fc1a0 --- /dev/null +++ b/lib/Model/CallLogObject.php @@ -0,0 +1,758 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CallLogObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'activity_id' => 'int', + 'subject' => 'string', + 'duration' => 'string', + 'outcome' => 'string', + 'from_phone_number' => 'string', + 'to_phone_number' => 'string', + 'start_time' => '\DateTime', + 'end_time' => '\DateTime', + 'person_id' => 'int', + 'org_id' => 'int', + 'deal_id' => 'int', + 'note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'activity_id' => null, + 'subject' => null, + 'duration' => null, + 'outcome' => null, + 'from_phone_number' => null, + 'to_phone_number' => null, + 'start_time' => 'date-time', + 'end_time' => 'date-time', + 'person_id' => null, + 'org_id' => null, + 'deal_id' => null, + 'note' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'activity_id' => 'activity_id', + 'subject' => 'subject', + 'duration' => 'duration', + 'outcome' => 'outcome', + 'from_phone_number' => 'from_phone_number', + 'to_phone_number' => 'to_phone_number', + 'start_time' => 'start_time', + 'end_time' => 'end_time', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'deal_id' => 'deal_id', + 'note' => 'note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'activity_id' => 'setActivityId', + 'subject' => 'setSubject', + 'duration' => 'setDuration', + 'outcome' => 'setOutcome', + 'from_phone_number' => 'setFromPhoneNumber', + 'to_phone_number' => 'setToPhoneNumber', + 'start_time' => 'setStartTime', + 'end_time' => 'setEndTime', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'deal_id' => 'setDealId', + 'note' => 'setNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'activity_id' => 'getActivityId', + 'subject' => 'getSubject', + 'duration' => 'getDuration', + 'outcome' => 'getOutcome', + 'from_phone_number' => 'getFromPhoneNumber', + 'to_phone_number' => 'getToPhoneNumber', + 'start_time' => 'getStartTime', + 'end_time' => 'getEndTime', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'deal_id' => 'getDealId', + 'note' => 'getNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const OUTCOME_CONNECTED = 'connected'; + const OUTCOME_NO_ANSWER = 'no_answer'; + const OUTCOME_LEFT_MESSAGE = 'left_message'; + const OUTCOME_LEFT_VOICEMAIL = 'left_voicemail'; + const OUTCOME_WRONG_NUMBER = 'wrong_number'; + const OUTCOME_BUSY = 'busy'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getOutcomeAllowableValues(): array + { + return [ + self::OUTCOME_CONNECTED, + self::OUTCOME_NO_ANSWER, + self::OUTCOME_LEFT_MESSAGE, + self::OUTCOME_LEFT_VOICEMAIL, + self::OUTCOME_WRONG_NUMBER, + self::OUTCOME_BUSY, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['activity_id'] = $data['activity_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['outcome'] = $data['outcome'] ?? null; + $this->container['from_phone_number'] = $data['from_phone_number'] ?? null; + $this->container['to_phone_number'] = $data['to_phone_number'] ?? null; + $this->container['start_time'] = $data['start_time'] ?? null; + $this->container['end_time'] = $data['end_time'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['note'] = $data['note'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['outcome'] === null) { + $invalidProperties[] = "'outcome' can't be null"; + } + $allowedValues = $this->getOutcomeAllowableValues(); + if (!is_null($this->container['outcome']) && !in_array($this->container['outcome'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'outcome', must be one of '%s'", + $this->container['outcome'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['to_phone_number'] === null) { + $invalidProperties[] = "'to_phone_number' can't be null"; + } + if ($this->container['start_time'] === null) { + $invalidProperties[] = "'start_time' can't be null"; + } + if ($this->container['end_time'] === null) { + $invalidProperties[] = "'end_time' 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 user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets activity_id + * + * @return int|null + */ + public function getActivityId() + { + return $this->container['activity_id']; + } + + /** + * Sets activity_id + * + * @param int|null $activity_id If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. The `activity_id` must refer to a `call` type activity. + * + * @return self + */ + public function setActivityId($activity_id): self + { + $this->container['activity_id'] = $activity_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The name of the activity this call is attached to + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the call in seconds + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets outcome + * + * @return string + */ + public function getOutcome() + { + return $this->container['outcome']; + } + + /** + * Sets outcome + * + * @param string $outcome Describes the outcome of the call + * + * @return self + */ + public function setOutcome($outcome): self + { + $allowedValues = $this->getOutcomeAllowableValues(); + if (!in_array($outcome, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'outcome', must be one of '%s'", + $outcome, + implode("', '", $allowedValues) + ) + ); + } + $this->container['outcome'] = $outcome; + + return $this; + } + + /** + * Gets from_phone_number + * + * @return string|null + */ + public function getFromPhoneNumber() + { + return $this->container['from_phone_number']; + } + + /** + * Sets from_phone_number + * + * @param string|null $from_phone_number The number that made the call + * + * @return self + */ + public function setFromPhoneNumber($from_phone_number): self + { + $this->container['from_phone_number'] = $from_phone_number; + + return $this; + } + + /** + * Gets to_phone_number + * + * @return string + */ + public function getToPhoneNumber() + { + return $this->container['to_phone_number']; + } + + /** + * Sets to_phone_number + * + * @param string $to_phone_number The number called + * + * @return self + */ + public function setToPhoneNumber($to_phone_number): self + { + $this->container['to_phone_number'] = $to_phone_number; + + return $this; + } + + /** + * Gets start_time + * + * @return \DateTime + */ + public function getStartTime() + { + return $this->container['start_time']; + } + + /** + * Sets start_time + * + * @param \DateTime $start_time The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setStartTime($start_time): self + { + $this->container['start_time'] = $start_time; + + return $this; + } + + /** + * Gets end_time + * + * @return \DateTime + */ + public function getEndTime() + { + return $this->container['end_time']; + } + + /** + * Sets end_time + * + * @param \DateTime $end_time The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setEndTime($end_time): self + { + $this->container['end_time'] = $end_time; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this call is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this call is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this call is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note for the call log in HTML format + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse200.php b/lib/Model/CallLogResponse200.php new file mode 100644 index 00000000..faad4ddf --- /dev/null +++ b/lib/Model/CallLogResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CallLogResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ResponseCallLogObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ResponseCallLogObject|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ResponseCallLogObject|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse400.php b/lib/Model/CallLogResponse400.php new file mode 100644 index 00000000..ddb4577e --- /dev/null +++ b/lib/Model/CallLogResponse400.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse400 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'callLogResponse400'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse403.php b/lib/Model/CallLogResponse403.php new file mode 100644 index 00000000..6c48dd76 --- /dev/null +++ b/lib/Model/CallLogResponse403.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse403 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'callLogResponse403'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse404.php b/lib/Model/CallLogResponse404.php new file mode 100644 index 00000000..590b3c63 --- /dev/null +++ b/lib/Model/CallLogResponse404.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse404 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'callLogResponse404'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse409.php b/lib/Model/CallLogResponse409.php new file mode 100644 index 00000000..0307aba2 --- /dev/null +++ b/lib/Model/CallLogResponse409.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse409 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'callLogResponse409'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse410.php b/lib/Model/CallLogResponse410.php new file mode 100644 index 00000000..a3e2e9be --- /dev/null +++ b/lib/Model/CallLogResponse410.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse410 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'callLogResponse410'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogResponse500.php b/lib/Model/CallLogResponse500.php new file mode 100644 index 00000000..a75819ff --- /dev/null +++ b/lib/Model/CallLogResponse500.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogResponse500 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'callLogResponse500'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogsResponse.php b/lib/Model/CallLogsResponse.php new file mode 100644 index 00000000..0e280120 --- /dev/null +++ b/lib/Model/CallLogsResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CallLogsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ResponseCallLogObject[]', + 'additional_data' => '\Pipedrive\Model\CallLogsResponseAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ResponseCallLogObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ResponseCallLogObject[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\CallLogsResponseAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\CallLogsResponseAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CallLogsResponseAdditionalData.php b/lib/Model/CallLogsResponseAdditionalData.php new file mode 100644 index 00000000..c8125a2c --- /dev/null +++ b/lib/Model/CallLogsResponseAdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CallLogsResponseAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CallLogsResponse_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pagination' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Pipedrive\Model\AdditionalData|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ChannelObject.php b/lib/Model/ChannelObject.php new file mode 100644 index 00000000..c554a405 --- /dev/null +++ b/lib/Model/ChannelObject.php @@ -0,0 +1,506 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ChannelObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChannelObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'provider_channel_id' => 'string', + 'avatar_url' => 'string', + 'template_support' => 'bool', + 'provider_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'provider_channel_id' => null, + 'avatar_url' => 'url', + 'template_support' => null, + 'provider_type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'provider_channel_id' => 'provider_channel_id', + 'avatar_url' => 'avatar_url', + 'template_support' => 'template_support', + 'provider_type' => 'provider_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'provider_channel_id' => 'setProviderChannelId', + 'avatar_url' => 'setAvatarUrl', + 'template_support' => 'setTemplateSupport', + 'provider_type' => 'setProviderType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'provider_channel_id' => 'getProviderChannelId', + 'avatar_url' => 'getAvatarUrl', + 'template_support' => 'getTemplateSupport', + 'provider_type' => 'getProviderType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const PROVIDER_TYPE_FACEBOOK = 'facebook'; + const PROVIDER_TYPE_WHATSAPP = 'whatsapp'; + const PROVIDER_TYPE_OTHER = 'other'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getProviderTypeAllowableValues(): array + { + return [ + self::PROVIDER_TYPE_FACEBOOK, + self::PROVIDER_TYPE_WHATSAPP, + self::PROVIDER_TYPE_OTHER, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['provider_channel_id'] = $data['provider_channel_id'] ?? null; + $this->container['avatar_url'] = $data['avatar_url'] ?? null; + $this->container['template_support'] = $data['template_support'] ?? false; + $this->container['provider_type'] = $data['provider_type'] ?? 'other'; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['provider_channel_id'] === null) { + $invalidProperties[] = "'provider_channel_id' can't be null"; + } + $allowedValues = $this->getProviderTypeAllowableValues(); + if (!is_null($this->container['provider_type']) && !in_array($this->container['provider_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'provider_type', must be one of '%s'", + $this->container['provider_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the channel + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets provider_channel_id + * + * @return string + */ + public function getProviderChannelId() + { + return $this->container['provider_channel_id']; + } + + /** + * Sets provider_channel_id + * + * @param string $provider_channel_id The channel ID + * + * @return self + */ + public function setProviderChannelId($provider_channel_id): self + { + $this->container['provider_channel_id'] = $provider_channel_id; + + return $this; + } + + /** + * Gets avatar_url + * + * @return string|null + */ + public function getAvatarUrl() + { + return $this->container['avatar_url']; + } + + /** + * Sets avatar_url + * + * @param string|null $avatar_url The URL for an icon that represents your channel + * + * @return self + */ + public function setAvatarUrl($avatar_url): self + { + $this->container['avatar_url'] = $avatar_url; + + return $this; + } + + /** + * Gets template_support + * + * @return bool|null + */ + public function getTemplateSupport() + { + return $this->container['template_support']; + } + + /** + * Sets template_support + * + * @param bool|null $template_support If true, enables templates logic on UI. Requires getTemplates endpoint implemented. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension). + * + * @return self + */ + public function setTemplateSupport($template_support): self + { + $this->container['template_support'] = $template_support; + + return $this; + } + + /** + * Gets provider_type + * + * @return string|null + */ + public function getProviderType() + { + return $this->container['provider_type']; + } + + /** + * Sets provider_type + * + * @param string|null $provider_type It controls the icons (like the icon next to the conversation) + * + * @return self + */ + public function setProviderType($provider_type): self + { + $allowedValues = $this->getProviderTypeAllowableValues(); + if (!is_null($provider_type) && !in_array($provider_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'provider_type', must be one of '%s'", + $provider_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['provider_type'] = $provider_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ChannelObjectResponse.php b/lib/Model/ChannelObjectResponse.php new file mode 100644 index 00000000..daeda558 --- /dev/null +++ b/lib/Model/ChannelObjectResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ChannelObjectResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChannelObjectResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ChannelObjectResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ChannelObjectResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ChannelObjectResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ChannelObjectResponseData.php b/lib/Model/ChannelObjectResponseData.php new file mode 100644 index 00000000..d92106d8 --- /dev/null +++ b/lib/Model/ChannelObjectResponseData.php @@ -0,0 +1,650 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ChannelObjectResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ChannelObjectResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'avatar_url' => 'string', + 'provider_channel_id' => 'string', + 'marketplace_client_id' => 'string', + 'pd_company_id' => 'int', + 'pd_user_id' => 'int', + 'created_at' => '\DateTime', + 'provider_type' => 'string', + 'template_support' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'avatar_url' => null, + 'provider_channel_id' => 'string', + 'marketplace_client_id' => null, + 'pd_company_id' => null, + 'pd_user_id' => null, + 'created_at' => 'date-time', + 'provider_type' => null, + 'template_support' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'avatar_url' => 'avatar_url', + 'provider_channel_id' => 'provider_channel_id', + 'marketplace_client_id' => 'marketplace_client_id', + 'pd_company_id' => 'pd_company_id', + 'pd_user_id' => 'pd_user_id', + 'created_at' => 'created_at', + 'provider_type' => 'provider_type', + 'template_support' => 'template_support' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'avatar_url' => 'setAvatarUrl', + 'provider_channel_id' => 'setProviderChannelId', + 'marketplace_client_id' => 'setMarketplaceClientId', + 'pd_company_id' => 'setPdCompanyId', + 'pd_user_id' => 'setPdUserId', + 'created_at' => 'setCreatedAt', + 'provider_type' => 'setProviderType', + 'template_support' => 'setTemplateSupport' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'avatar_url' => 'getAvatarUrl', + 'provider_channel_id' => 'getProviderChannelId', + 'marketplace_client_id' => 'getMarketplaceClientId', + 'pd_company_id' => 'getPdCompanyId', + 'pd_user_id' => 'getPdUserId', + 'created_at' => 'getCreatedAt', + 'provider_type' => 'getProviderType', + 'template_support' => 'getTemplateSupport' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const PROVIDER_TYPE_FACEBOOK = 'facebook'; + const PROVIDER_TYPE_WHATSAPP = 'whatsapp'; + const PROVIDER_TYPE_OTHER = 'other'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getProviderTypeAllowableValues(): array + { + return [ + self::PROVIDER_TYPE_FACEBOOK, + self::PROVIDER_TYPE_WHATSAPP, + self::PROVIDER_TYPE_OTHER, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['avatar_url'] = $data['avatar_url'] ?? null; + $this->container['provider_channel_id'] = $data['provider_channel_id'] ?? null; + $this->container['marketplace_client_id'] = $data['marketplace_client_id'] ?? null; + $this->container['pd_company_id'] = $data['pd_company_id'] ?? null; + $this->container['pd_user_id'] = $data['pd_user_id'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['provider_type'] = $data['provider_type'] ?? null; + $this->container['template_support'] = $data['template_support'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getProviderTypeAllowableValues(); + if (!is_null($this->container['provider_type']) && !in_array($this->container['provider_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'provider_type', must be one of '%s'", + $this->container['provider_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique channel ID used internally in omnichannel-api and the frontend of the extension + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the channel + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets avatar_url + * + * @return string|null + */ + public function getAvatarUrl() + { + return $this->container['avatar_url']; + } + + /** + * Sets avatar_url + * + * @param string|null $avatar_url The URL for an icon that represents your channel + * + * @return self + */ + public function setAvatarUrl($avatar_url): self + { + $this->container['avatar_url'] = $avatar_url; + + return $this; + } + + /** + * Gets provider_channel_id + * + * @return string|null + */ + public function getProviderChannelId() + { + return $this->container['provider_channel_id']; + } + + /** + * Sets provider_channel_id + * + * @param string|null $provider_channel_id The channel ID you specified while creating the channel + * + * @return self + */ + public function setProviderChannelId($provider_channel_id): self + { + $this->container['provider_channel_id'] = $provider_channel_id; + + return $this; + } + + /** + * Gets marketplace_client_id + * + * @return string|null + */ + public function getMarketplaceClientId() + { + return $this->container['marketplace_client_id']; + } + + /** + * Sets marketplace_client_id + * + * @param string|null $marketplace_client_id The client_id of your app in Pipedrive marketplace + * + * @return self + */ + public function setMarketplaceClientId($marketplace_client_id): self + { + $this->container['marketplace_client_id'] = $marketplace_client_id; + + return $this; + } + + /** + * Gets pd_company_id + * + * @return int|null + */ + public function getPdCompanyId() + { + return $this->container['pd_company_id']; + } + + /** + * Sets pd_company_id + * + * @param int|null $pd_company_id The ID of the user's company in Pipedrive + * + * @return self + */ + public function setPdCompanyId($pd_company_id): self + { + $this->container['pd_company_id'] = $pd_company_id; + + return $this; + } + + /** + * Gets pd_user_id + * + * @return int|null + */ + public function getPdUserId() + { + return $this->container['pd_user_id']; + } + + /** + * Sets pd_user_id + * + * @param int|null $pd_user_id The ID of the user in Pipedrive + * + * @return self + */ + public function setPdUserId($pd_user_id): self + { + $this->container['pd_user_id'] = $pd_user_id; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at The date and time when your channel was created in the API + * + * @return self + */ + public function setCreatedAt($created_at): self + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets provider_type + * + * @return string|null + */ + public function getProviderType() + { + return $this->container['provider_type']; + } + + /** + * Sets provider_type + * + * @param string|null $provider_type Value of the provider_type sent to this endpoint + * + * @return self + */ + public function setProviderType($provider_type): self + { + $allowedValues = $this->getProviderTypeAllowableValues(); + if (!is_null($provider_type) && !in_array($provider_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'provider_type', must be one of '%s'", + $provider_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['provider_type'] = $provider_type; + + return $this; + } + + /** + * Gets template_support + * + * @return bool|null + */ + public function getTemplateSupport() + { + return $this->container['template_support']; + } + + /** + * Sets template_support + * + * @param bool|null $template_support Value of the template_support sent to this endpoint + * + * @return self + */ + public function setTemplateSupport($template_support): self + { + $this->container['template_support'] = $template_support; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CommentPostPutObject.php b/lib/Model/CommentPostPutObject.php new file mode 100644 index 00000000..c299fbd4 --- /dev/null +++ b/lib/Model/CommentPostPutObject.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CommentPostPutObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CommentPostPutObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'content' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = $data['content'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' 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 content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content The content of the comment in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CommonMailThread.php b/lib/Model/CommonMailThread.php new file mode 100644 index 00000000..bd778277 --- /dev/null +++ b/lib/Model/CommonMailThread.php @@ -0,0 +1,732 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CommonMailThread implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CommonMailThread'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'account_id' => 'string', + 'user_id' => 'int', + 'subject' => 'string', + 'snippet' => 'string', + 'read_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'mail_tracking_status' => 'string', + 'has_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_inline_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_real_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'synced_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'smart_bcc_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'mail_link_tracking_enabled_flag' => '\Pipedrive\Model\NumberBooleanDefault0' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'account_id' => null, + 'user_id' => null, + 'subject' => null, + 'snippet' => null, + 'read_flag' => null, + 'mail_tracking_status' => null, + 'has_attachments_flag' => null, + 'has_inline_attachments_flag' => null, + 'has_real_attachments_flag' => null, + 'deleted_flag' => null, + 'synced_flag' => null, + 'smart_bcc_flag' => null, + 'mail_link_tracking_enabled_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'account_id' => 'account_id', + 'user_id' => 'user_id', + 'subject' => 'subject', + 'snippet' => 'snippet', + 'read_flag' => 'read_flag', + 'mail_tracking_status' => 'mail_tracking_status', + 'has_attachments_flag' => 'has_attachments_flag', + 'has_inline_attachments_flag' => 'has_inline_attachments_flag', + 'has_real_attachments_flag' => 'has_real_attachments_flag', + 'deleted_flag' => 'deleted_flag', + 'synced_flag' => 'synced_flag', + 'smart_bcc_flag' => 'smart_bcc_flag', + 'mail_link_tracking_enabled_flag' => 'mail_link_tracking_enabled_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'account_id' => 'setAccountId', + 'user_id' => 'setUserId', + 'subject' => 'setSubject', + 'snippet' => 'setSnippet', + 'read_flag' => 'setReadFlag', + 'mail_tracking_status' => 'setMailTrackingStatus', + 'has_attachments_flag' => 'setHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'setHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'setHasRealAttachmentsFlag', + 'deleted_flag' => 'setDeletedFlag', + 'synced_flag' => 'setSyncedFlag', + 'smart_bcc_flag' => 'setSmartBccFlag', + 'mail_link_tracking_enabled_flag' => 'setMailLinkTrackingEnabledFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'account_id' => 'getAccountId', + 'user_id' => 'getUserId', + 'subject' => 'getSubject', + 'snippet' => 'getSnippet', + 'read_flag' => 'getReadFlag', + 'mail_tracking_status' => 'getMailTrackingStatus', + 'has_attachments_flag' => 'getHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'getHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'getHasRealAttachmentsFlag', + 'deleted_flag' => 'getDeletedFlag', + 'synced_flag' => 'getSyncedFlag', + 'smart_bcc_flag' => 'getSmartBccFlag', + 'mail_link_tracking_enabled_flag' => 'getMailLinkTrackingEnabledFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['account_id'] = $data['account_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['snippet'] = $data['snippet'] ?? null; + $this->container['read_flag'] = $data['read_flag'] ?? null; + $this->container['mail_tracking_status'] = $data['mail_tracking_status'] ?? null; + $this->container['has_attachments_flag'] = $data['has_attachments_flag'] ?? null; + $this->container['has_inline_attachments_flag'] = $data['has_inline_attachments_flag'] ?? null; + $this->container['has_real_attachments_flag'] = $data['has_real_attachments_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['synced_flag'] = $data['synced_flag'] ?? null; + $this->container['smart_bcc_flag'] = $data['smart_bcc_flag'] ?? null; + $this->container['mail_link_tracking_enabled_flag'] = $data['mail_link_tracking_enabled_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail thread + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id The connection account ID + * + * @return self + */ + public function setAccountId($account_id): self + { + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id ID of the user whom mail message will be assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets snippet + * + * @return string|null + */ + public function getSnippet() + { + return $this->container['snippet']; + } + + /** + * Sets snippet + * + * @param string|null $snippet A snippet + * + * @return self + */ + public function setSnippet($snippet): self + { + $this->container['snippet'] = $snippet; + + return $this; + } + + /** + * Gets read_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getReadFlag() + { + return $this->container['read_flag']; + } + + /** + * Sets read_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $read_flag Whether the mail thread is read + * + * @return self + */ + public function setReadFlag($read_flag): self + { + $this->container['read_flag'] = $read_flag; + + return $this; + } + + /** + * Gets mail_tracking_status + * + * @return string|null + */ + public function getMailTrackingStatus() + { + return $this->container['mail_tracking_status']; + } + + /** + * Sets mail_tracking_status + * + * @param string|null $mail_tracking_status Mail tracking status + * + * @return self + */ + public function setMailTrackingStatus($mail_tracking_status): self + { + $this->container['mail_tracking_status'] = $mail_tracking_status; + + return $this; + } + + /** + * Gets has_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasAttachmentsFlag() + { + return $this->container['has_attachments_flag']; + } + + /** + * Sets has_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_attachments_flag Whether the mail thread has an attachment + * + * @return self + */ + public function setHasAttachmentsFlag($has_attachments_flag): self + { + $this->container['has_attachments_flag'] = $has_attachments_flag; + + return $this; + } + + /** + * Gets has_inline_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasInlineAttachmentsFlag() + { + return $this->container['has_inline_attachments_flag']; + } + + /** + * Sets has_inline_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_inline_attachments_flag Whether the mail thread has inline attachments + * + * @return self + */ + public function setHasInlineAttachmentsFlag($has_inline_attachments_flag): self + { + $this->container['has_inline_attachments_flag'] = $has_inline_attachments_flag; + + return $this; + } + + /** + * Gets has_real_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasRealAttachmentsFlag() + { + return $this->container['has_real_attachments_flag']; + } + + /** + * Sets has_real_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_real_attachments_flag Whether the mail thread has real attachments (which are not inline) + * + * @return self + */ + public function setHasRealAttachmentsFlag($has_real_attachments_flag): self + { + $this->container['has_real_attachments_flag'] = $has_real_attachments_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $deleted_flag Whether the mail thread is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets synced_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSyncedFlag() + { + return $this->container['synced_flag']; + } + + /** + * Sets synced_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $synced_flag Whether the mail thread is synced + * + * @return self + */ + public function setSyncedFlag($synced_flag): self + { + $this->container['synced_flag'] = $synced_flag; + + return $this; + } + + /** + * Gets smart_bcc_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSmartBccFlag() + { + return $this->container['smart_bcc_flag']; + } + + /** + * Sets smart_bcc_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $smart_bcc_flag Whether one of the parties of the mail thread is Bcc + * + * @return self + */ + public function setSmartBccFlag($smart_bcc_flag): self + { + $this->container['smart_bcc_flag'] = $smart_bcc_flag; + + return $this; + } + + /** + * Gets mail_link_tracking_enabled_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getMailLinkTrackingEnabledFlag() + { + return $this->container['mail_link_tracking_enabled_flag']; + } + + /** + * Sets mail_link_tracking_enabled_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $mail_link_tracking_enabled_flag Whether the link tracking of the mail thread is enabled + * + * @return self + */ + public function setMailLinkTrackingEnabledFlag($mail_link_tracking_enabled_flag): self + { + $this->container['mail_link_tracking_enabled_flag'] = $mail_link_tracking_enabled_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CreateRemoteFileAndLinkItToItem.php b/lib/Model/CreateRemoteFileAndLinkItToItem.php new file mode 100644 index 00000000..f82d26d8 --- /dev/null +++ b/lib/Model/CreateRemoteFileAndLinkItToItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreateRemoteFileAndLinkItToItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CreateRemoteFileAndLinkItToItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/CreateTeam.php b/lib/Model/CreateTeam.php new file mode 100644 index 00000000..30c901fe --- /dev/null +++ b/lib/Model/CreateTeam.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreateTeam implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'CreateTeam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'manager_id' => 'int', + 'users' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'manager_id' => null, + 'users' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'manager_id' => 'manager_id', + 'users' => 'users' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'manager_id' => 'setManagerId', + 'users' => 'setUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'manager_id' => 'getManagerId', + 'users' => 'getUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['manager_id'] = $data['manager_id'] ?? null; + $this->container['users'] = $data['users'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The team name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The team description + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets manager_id + * + * @return int|null + */ + public function getManagerId() + { + return $this->container['manager_id']; + } + + /** + * Sets manager_id + * + * @param int|null $manager_id The team manager ID + * + * @return self + */ + public function setManagerId($manager_id): self + { + $this->container['manager_id'] = $manager_id; + + return $this; + } + + /** + * Gets users + * + * @return int[]|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param int[]|null $users The list of user IDs + * + * @return self + */ + public function setUsers($users): self + { + $this->container['users'] = $users; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Currencies.php b/lib/Model/Currencies.php new file mode 100644 index 00000000..3b875d22 --- /dev/null +++ b/lib/Model/Currencies.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Currencies implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Currencies'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseCurrency[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseCurrency[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseCurrency[]|null $data The array of currencies + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealCollectionResponseObject.php b/lib/Model/DealCollectionResponseObject.php new file mode 100644 index 00000000..9c795098 --- /dev/null +++ b/lib/Model/DealCollectionResponseObject.php @@ -0,0 +1,942 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealCollectionResponseObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealCollectionResponseObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => 'int', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'status' => 'string', + 'probability' => 'float', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'lost_time' => 'string', + 'expected_close_date' => '\DateTime', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'update_time' => null, + 'status' => null, + 'probability' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'lost_time' => null, + 'expected_close_date' => 'date', + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'status' => 'status', + 'probability' => 'probability', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'lost_time' => 'lost_time', + 'expected_close_date' => 'expected_close_date', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'lost_time' => 'setLostTime', + 'expected_close_date' => 'setExpectedCloseDate', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'lost_time' => 'getLostTime', + 'expected_close_date' => 'getExpectedCloseDate', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['label'] = $data['label'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return int|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param int|null $creator_user_id The ID of the deal creator + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person associated with the deal + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization associated with the deal + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last update date and time of the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status to won in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status to lost in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealCountAndActivityInfo.php b/lib/Model/DealCountAndActivityInfo.php new file mode 100644 index 00000000..641f9eb5 --- /dev/null +++ b/lib/Model/DealCountAndActivityInfo.php @@ -0,0 +1,702 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealCountAndActivityInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealCountAndActivityInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealFlowResponse.php b/lib/Model/DealFlowResponse.php new file mode 100644 index 00000000..ad0d8c8a --- /dev/null +++ b/lib/Model/DealFlowResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealFlowResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealFlowResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealFlowResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealFlowResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealFlowResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealFlowResponseAllOf.php b/lib/Model/DealFlowResponseAllOf.php new file mode 100644 index 00000000..d626bca6 --- /dev/null +++ b/lib/Model/DealFlowResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealFlowResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealFlowResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DealFlowResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DealFlowResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealFlowResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealFlowResponseAllOfData.php b/lib/Model/DealFlowResponseAllOfData.php new file mode 100644 index 00000000..ef05d3e1 --- /dev/null +++ b/lib/Model/DealFlowResponseAllOfData.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealFlowResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealFlowResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'object' => 'string', + 'timestamp' => 'string', + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'timestamp' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'timestamp' => 'timestamp', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'timestamp' => 'setTimestamp', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'timestamp' => 'getTimestamp', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['object'] = $data['object'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object The type of the deal update. (Possible object types - dealChange, note, activity, mailMessage, invoice, document, file) + * + * @return self + */ + public function setObject($object): self + { + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The creation date and time of the update + * + * @return self + */ + public function setTimestamp($timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data The data related to the update + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealFlowResponseAllOfRelatedObjects.php b/lib/Model/DealFlowResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..26f57d86 --- /dev/null +++ b/lib/Model/DealFlowResponseAllOfRelatedObjects.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealFlowResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealFlowResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal' => '\Pipedrive\Model\RelatedDealData', + 'organization' => '\Pipedrive\Model\RelatedOrganizationData', + 'user' => '\Pipedrive\Model\RelatedUserData', + 'person' => '\Pipedrive\Model\RelatedPersonDataWithActiveFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal' => null, + 'organization' => null, + 'user' => null, + 'person' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal' => 'deal', + 'organization' => 'organization', + 'user' => 'user', + 'person' => 'person' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal' => 'setDeal', + 'organization' => 'setOrganization', + 'user' => 'setUser', + 'person' => 'setPerson' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal' => 'getDeal', + 'organization' => 'getOrganization', + 'user' => 'getUser', + 'person' => 'getPerson' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal'] = $data['deal'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + $this->container['user'] = $data['user'] ?? null; + $this->container['person'] = $data['person'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deal + * + * @return \Pipedrive\Model\RelatedDealData|null + */ + public function getDeal() + { + return $this->container['deal']; + } + + /** + * Sets deal + * + * @param \Pipedrive\Model\RelatedDealData|null $deal deal + * + * @return self + */ + public function setDeal($deal): self + { + $this->container['deal'] = $deal; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationData|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationData|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealListActivitiesResponse.php b/lib/Model/DealListActivitiesResponse.php new file mode 100644 index 00000000..ee0f16a5 --- /dev/null +++ b/lib/Model/DealListActivitiesResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealListActivitiesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealListActivitiesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityResponseObject[]', + 'additional_data' => '\Pipedrive\Model\ActivityDistributionDataWithAdditionalData', + 'related_objects' => '\Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject[]|null $data The array of activities + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealListActivitiesResponseAllOf.php b/lib/Model/DealListActivitiesResponseAllOf.php new file mode 100644 index 00000000..1cdac405 --- /dev/null +++ b/lib/Model/DealListActivitiesResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealListActivitiesResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealListActivitiesResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ActivityResponseObject[]', + 'additional_data' => '\Pipedrive\Model\ActivityDistributionDataWithAdditionalData', + 'related_objects' => '\Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject[]|null $data The array of activities + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\DealListActivitiesResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealListActivitiesResponseAllOfRelatedObjects.php b/lib/Model/DealListActivitiesResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..277c21e1 --- /dev/null +++ b/lib/Model/DealListActivitiesResponseAllOfRelatedObjects.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealListActivitiesResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealListActivitiesResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization' => '\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag', + 'person' => '\Pipedrive\Model\RelatedPersonDataWithActiveFlag', + 'deal' => '\Pipedrive\Model\RelatedDealData', + 'user' => '\Pipedrive\Model\RelatedUserData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization' => null, + 'person' => null, + 'deal' => null, + 'user' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization' => 'organization', + 'person' => 'person', + 'deal' => 'deal', + 'user' => 'user' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization' => 'setOrganization', + 'person' => 'setPerson', + 'deal' => 'setDeal', + 'user' => 'setUser' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization' => 'getOrganization', + 'person' => 'getPerson', + 'deal' => 'getDeal', + 'user' => 'getUser' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization'] = $data['organization'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['deal'] = $data['deal'] ?? null; + $this->container['user'] = $data['user'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets deal + * + * @return \Pipedrive\Model\RelatedDealData|null + */ + public function getDeal() + { + return $this->container['deal']; + } + + /** + * Sets deal + * + * @param \Pipedrive\Model\RelatedDealData|null $deal deal + * + * @return self + */ + public function setDeal($deal): self + { + $this->container['deal'] = $deal; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrict.php b/lib/Model/DealNonStrict.php new file mode 100644 index 00000000..7d8e58c5 --- /dev/null +++ b/lib/Model/DealNonStrict.php @@ -0,0 +1,2022 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrict implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrict'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => '\Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId', + 'user_id' => '\Pipedrive\Model\DealUserDataWithId', + 'person_id' => '\Pipedrive\Model\DealPersonDataWithId', + 'org_id' => '\Pipedrive\Model\DealOrganizationDataWithId', + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'stage_change_time' => 'string', + 'active' => 'bool', + 'deleted' => 'bool', + 'status' => 'string', + 'probability' => 'float', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'first_won_time' => 'string', + 'lost_time' => 'string', + 'products_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'participants_count' => 'int', + 'expected_close_date' => '\DateTime', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'label' => 'string', + 'stage_order_nr' => 'int', + 'person_name' => 'string', + 'org_name' => 'string', + 'next_activity_subject' => 'string', + 'next_activity_type' => 'string', + 'next_activity_duration' => 'string', + 'next_activity_note' => 'string', + 'formatted_value' => 'string', + 'weighted_value' => 'float', + 'formatted_weighted_value' => 'string', + 'weighted_value_currency' => 'string', + 'rotten_time' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'org_hidden' => 'bool', + 'person_hidden' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'update_time' => null, + 'stage_change_time' => null, + 'active' => null, + 'deleted' => null, + 'status' => null, + 'probability' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'first_won_time' => null, + 'lost_time' => null, + 'products_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'participants_count' => null, + 'expected_close_date' => 'date', + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'label' => null, + 'stage_order_nr' => null, + 'person_name' => null, + 'org_name' => null, + 'next_activity_subject' => null, + 'next_activity_type' => null, + 'next_activity_duration' => null, + 'next_activity_note' => null, + 'formatted_value' => null, + 'weighted_value' => null, + 'formatted_weighted_value' => null, + 'weighted_value_currency' => null, + 'rotten_time' => null, + 'owner_name' => null, + 'cc_email' => null, + 'org_hidden' => null, + 'person_hidden' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'stage_change_time' => 'stage_change_time', + 'active' => 'active', + 'deleted' => 'deleted', + 'status' => 'status', + 'probability' => 'probability', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'first_won_time' => 'first_won_time', + 'lost_time' => 'lost_time', + 'products_count' => 'products_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'participants_count' => 'participants_count', + 'expected_close_date' => 'expected_close_date', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'label' => 'label', + 'stage_order_nr' => 'stage_order_nr', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'next_activity_subject' => 'next_activity_subject', + 'next_activity_type' => 'next_activity_type', + 'next_activity_duration' => 'next_activity_duration', + 'next_activity_note' => 'next_activity_note', + 'formatted_value' => 'formatted_value', + 'weighted_value' => 'weighted_value', + 'formatted_weighted_value' => 'formatted_weighted_value', + 'weighted_value_currency' => 'weighted_value_currency', + 'rotten_time' => 'rotten_time', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'org_hidden' => 'org_hidden', + 'person_hidden' => 'person_hidden' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'stage_change_time' => 'setStageChangeTime', + 'active' => 'setActive', + 'deleted' => 'setDeleted', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'first_won_time' => 'setFirstWonTime', + 'lost_time' => 'setLostTime', + 'products_count' => 'setProductsCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'participants_count' => 'setParticipantsCount', + 'expected_close_date' => 'setExpectedCloseDate', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'label' => 'setLabel', + 'stage_order_nr' => 'setStageOrderNr', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'next_activity_subject' => 'setNextActivitySubject', + 'next_activity_type' => 'setNextActivityType', + 'next_activity_duration' => 'setNextActivityDuration', + 'next_activity_note' => 'setNextActivityNote', + 'formatted_value' => 'setFormattedValue', + 'weighted_value' => 'setWeightedValue', + 'formatted_weighted_value' => 'setFormattedWeightedValue', + 'weighted_value_currency' => 'setWeightedValueCurrency', + 'rotten_time' => 'setRottenTime', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'org_hidden' => 'setOrgHidden', + 'person_hidden' => 'setPersonHidden' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'stage_change_time' => 'getStageChangeTime', + 'active' => 'getActive', + 'deleted' => 'getDeleted', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'first_won_time' => 'getFirstWonTime', + 'lost_time' => 'getLostTime', + 'products_count' => 'getProductsCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'participants_count' => 'getParticipantsCount', + 'expected_close_date' => 'getExpectedCloseDate', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'label' => 'getLabel', + 'stage_order_nr' => 'getStageOrderNr', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'next_activity_subject' => 'getNextActivitySubject', + 'next_activity_type' => 'getNextActivityType', + 'next_activity_duration' => 'getNextActivityDuration', + 'next_activity_note' => 'getNextActivityNote', + 'formatted_value' => 'getFormattedValue', + 'weighted_value' => 'getWeightedValue', + 'formatted_weighted_value' => 'getFormattedWeightedValue', + 'weighted_value_currency' => 'getWeightedValueCurrency', + 'rotten_time' => 'getRottenTime', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'org_hidden' => 'getOrgHidden', + 'person_hidden' => 'getPersonHidden' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deleted'] = $data['deleted'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['first_won_time'] = $data['first_won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['products_count'] = $data['products_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['participants_count'] = $data['participants_count'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['stage_order_nr'] = $data['stage_order_nr'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['next_activity_subject'] = $data['next_activity_subject'] ?? null; + $this->container['next_activity_type'] = $data['next_activity_type'] ?? null; + $this->container['next_activity_duration'] = $data['next_activity_duration'] ?? null; + $this->container['next_activity_note'] = $data['next_activity_note'] ?? null; + $this->container['formatted_value'] = $data['formatted_value'] ?? null; + $this->container['weighted_value'] = $data['weighted_value'] ?? null; + $this->container['formatted_weighted_value'] = $data['formatted_weighted_value'] ?? null; + $this->container['weighted_value_currency'] = $data['weighted_value_currency'] ?? null; + $this->container['rotten_time'] = $data['rotten_time'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['org_hidden'] = $data['org_hidden'] ?? null; + $this->container['person_hidden'] = $data['person_hidden'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return \Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param \Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId|null $creator_user_id creator_user_id + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return \Pipedrive\Model\DealUserDataWithId|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param \Pipedrive\Model\DealUserDataWithId|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return \Pipedrive\Model\DealPersonDataWithId|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param \Pipedrive\Model\DealPersonDataWithId|null $person_id person_id + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\DealOrganizationDataWithId|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\DealOrganizationDataWithId|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets stage_change_time + * + * @return string|null + */ + public function getStageChangeTime() + { + return $this->container['stage_change_time']; + } + + /** + * Sets stage_change_time + * + * @param string|null $stage_change_time The last updated date and time of the deal stage + * + * @return self + */ + public function setStageChangeTime($stage_change_time): self + { + $this->container['stage_change_time'] = $stage_change_time; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether the deal is active or not + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deleted + * + * @return bool|null + */ + public function getDeleted() + { + return $this->container['deleted']; + } + + /** + * Sets deleted + * + * @param bool|null $deleted Whether the deal is deleted or not + * + * @return self + */ + public function setDeleted($deleted): self + { + $this->container['deleted'] = $deleted; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status as won + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets first_won_time + * + * @return string|null + */ + public function getFirstWonTime() + { + return $this->container['first_won_time']; + } + + /** + * Sets first_won_time + * + * @param string|null $first_won_time The date and time of the first time changing the deal status as won + * + * @return self + */ + public function setFirstWonTime($first_won_time): self + { + $this->container['first_won_time'] = $first_won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status as lost + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets products_count + * + * @return int|null + */ + public function getProductsCount() + { + return $this->container['products_count']; + } + + /** + * Sets products_count + * + * @param int|null $products_count The number of products associated with the deal + * + * @return self + */ + public function setProductsCount($products_count): self + { + $this->container['products_count'] = $products_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The number of files associated with the deal + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The number of notes associated with the deal + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The number of followers associated with the deal + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The number of emails associated with the deal + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The number of activities associated with the deal + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The number of completed activities associated with the deal + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The number of incomplete activities associated with the deal + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets participants_count + * + * @return int|null + */ + public function getParticipantsCount() + { + return $this->container['participants_count']; + } + + /** + * Sets participants_count + * + * @param int|null $participants_count The number of participants associated with the deal + * + * @return self + */ + public function setParticipantsCount($participants_count): self + { + $this->container['participants_count'] = $participants_count; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the deal + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the deal + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets stage_order_nr + * + * @return int|null + */ + public function getStageOrderNr() + { + return $this->container['stage_order_nr']; + } + + /** + * Sets stage_order_nr + * + * @param int|null $stage_order_nr The order number of the deal stage associated with the deal + * + * @return self + */ + public function setStageOrderNr($stage_order_nr): self + { + $this->container['stage_order_nr'] = $stage_order_nr; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the deal + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the deal + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets next_activity_subject + * + * @return string|null + */ + public function getNextActivitySubject() + { + return $this->container['next_activity_subject']; + } + + /** + * Sets next_activity_subject + * + * @param string|null $next_activity_subject The subject of the next activity associated with the deal + * + * @return self + */ + public function setNextActivitySubject($next_activity_subject): self + { + $this->container['next_activity_subject'] = $next_activity_subject; + + return $this; + } + + /** + * Gets next_activity_type + * + * @return string|null + */ + public function getNextActivityType() + { + return $this->container['next_activity_type']; + } + + /** + * Sets next_activity_type + * + * @param string|null $next_activity_type The type of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityType($next_activity_type): self + { + $this->container['next_activity_type'] = $next_activity_type; + + return $this; + } + + /** + * Gets next_activity_duration + * + * @return string|null + */ + public function getNextActivityDuration() + { + return $this->container['next_activity_duration']; + } + + /** + * Sets next_activity_duration + * + * @param string|null $next_activity_duration The duration of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDuration($next_activity_duration): self + { + $this->container['next_activity_duration'] = $next_activity_duration; + + return $this; + } + + /** + * Gets next_activity_note + * + * @return string|null + */ + public function getNextActivityNote() + { + return $this->container['next_activity_note']; + } + + /** + * Sets next_activity_note + * + * @param string|null $next_activity_note The note of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityNote($next_activity_note): self + { + $this->container['next_activity_note'] = $next_activity_note; + + return $this; + } + + /** + * Gets formatted_value + * + * @return string|null + */ + public function getFormattedValue() + { + return $this->container['formatted_value']; + } + + /** + * Sets formatted_value + * + * @param string|null $formatted_value The deal value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedValue($formatted_value): self + { + $this->container['formatted_value'] = $formatted_value; + + return $this; + } + + /** + * Gets weighted_value + * + * @return float|null + */ + public function getWeightedValue() + { + return $this->container['weighted_value']; + } + + /** + * Sets weighted_value + * + * @param float|null $weighted_value Probability times deal value. Probability can either be deal probability or if not set, then stage probability. + * + * @return self + */ + public function setWeightedValue($weighted_value): self + { + $this->container['weighted_value'] = $weighted_value; + + return $this; + } + + /** + * Gets formatted_weighted_value + * + * @return string|null + */ + public function getFormattedWeightedValue() + { + return $this->container['formatted_weighted_value']; + } + + /** + * Sets formatted_weighted_value + * + * @param string|null $formatted_weighted_value The weighted_value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedWeightedValue($formatted_weighted_value): self + { + $this->container['formatted_weighted_value'] = $formatted_weighted_value; + + return $this; + } + + /** + * Gets weighted_value_currency + * + * @return string|null + */ + public function getWeightedValueCurrency() + { + return $this->container['weighted_value_currency']; + } + + /** + * Sets weighted_value_currency + * + * @param string|null $weighted_value_currency The currency associated with the deal + * + * @return self + */ + public function setWeightedValueCurrency($weighted_value_currency): self + { + $this->container['weighted_value_currency'] = $weighted_value_currency; + + return $this; + } + + /** + * Gets rotten_time + * + * @return string|null + */ + public function getRottenTime() + { + return $this->container['rotten_time']; + } + + /** + * Sets rotten_time + * + * @param string|null $rotten_time The date and time of changing the deal status as rotten + * + * @return self + */ + public function setRottenTime($rotten_time): self + { + $this->container['rotten_time'] = $rotten_time; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the deal owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets org_hidden + * + * @return bool|null + */ + public function getOrgHidden() + { + return $this->container['org_hidden']; + } + + /** + * Sets org_hidden + * + * @param bool|null $org_hidden If the organization that is associated with the deal is hidden or not + * + * @return self + */ + public function setOrgHidden($org_hidden): self + { + $this->container['org_hidden'] = $org_hidden; + + return $this; + } + + /** + * Gets person_hidden + * + * @return bool|null + */ + public function getPersonHidden() + { + return $this->container['person_hidden']; + } + + /** + * Sets person_hidden + * + * @param bool|null $person_hidden If the person that is associated with the deal is hidden or not + * + * @return self + */ + public function setPersonHidden($person_hidden): self + { + $this->container['person_hidden'] = $person_hidden; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictModeFields.php b/lib/Model/DealNonStrictModeFields.php new file mode 100644 index 00000000..c41c2d27 --- /dev/null +++ b/lib/Model/DealNonStrictModeFields.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictModeFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictModeFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => '\Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId', + 'user_id' => '\Pipedrive\Model\DealUserDataWithId', + 'person_id' => '\Pipedrive\Model\DealPersonDataWithId', + 'org_id' => '\Pipedrive\Model\DealOrganizationDataWithId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return \Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param \Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId|null $creator_user_id creator_user_id + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return \Pipedrive\Model\DealUserDataWithId|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param \Pipedrive\Model\DealUserDataWithId|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return \Pipedrive\Model\DealPersonDataWithId|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param \Pipedrive\Model\DealPersonDataWithId|null $person_id person_id + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\DealOrganizationDataWithId|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\DealOrganizationDataWithId|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictModeFieldsCreatorUserId.php b/lib/Model/DealNonStrictModeFieldsCreatorUserId.php new file mode 100644 index 00000000..ddffcae4 --- /dev/null +++ b/lib/Model/DealNonStrictModeFieldsCreatorUserId.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictModeFieldsCreatorUserId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictModeFields_creator_user_id'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'has_pic' => 'bool', + 'pic_hash' => 'string', + 'active_flag' => 'bool', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'has_pic' => null, + 'pic_hash' => null, + 'active_flag' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'has_pic' => 'has_pic', + 'pic_hash' => 'pic_hash', + 'active_flag' => 'active_flag', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'has_pic' => 'setHasPic', + 'pic_hash' => 'setPicHash', + 'active_flag' => 'setActiveFlag', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'has_pic' => 'getHasPic', + 'pic_hash' => 'getPicHash', + 'active_flag' => 'getActiveFlag', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['has_pic'] = $data['has_pic'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal creator + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the deal creator + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the deal creator + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets has_pic + * + * @return bool|null + */ + public function getHasPic() + { + return $this->container['has_pic']; + } + + /** + * Sets has_pic + * + * @param bool|null $has_pic If the creator has a picture or not + * + * @return self + */ + public function setHasPic($has_pic): self + { + $this->container['has_pic'] = $has_pic; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The creator picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the creator is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the deal creator + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictWithDetails.php b/lib/Model/DealNonStrictWithDetails.php new file mode 100644 index 00000000..c3d6d343 --- /dev/null +++ b/lib/Model/DealNonStrictWithDetails.php @@ -0,0 +1,2202 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictWithDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictWithDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => '\Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId', + 'user_id' => '\Pipedrive\Model\DealUserDataWithId', + 'person_id' => '\Pipedrive\Model\DealPersonDataWithId', + 'org_id' => '\Pipedrive\Model\DealOrganizationDataWithId', + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'stage_change_time' => 'string', + 'active' => 'bool', + 'deleted' => 'bool', + 'status' => 'string', + 'probability' => 'float', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'first_won_time' => 'string', + 'lost_time' => 'string', + 'products_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'participants_count' => 'int', + 'expected_close_date' => '\DateTime', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'label' => 'string', + 'stage_order_nr' => 'int', + 'person_name' => 'string', + 'org_name' => 'string', + 'next_activity_subject' => 'string', + 'next_activity_type' => 'string', + 'next_activity_duration' => 'string', + 'next_activity_note' => 'string', + 'formatted_value' => 'string', + 'weighted_value' => 'float', + 'formatted_weighted_value' => 'string', + 'weighted_value_currency' => 'string', + 'rotten_time' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'org_hidden' => 'bool', + 'person_hidden' => 'bool', + 'average_time_to_won' => '\Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon', + 'average_stage_progress' => 'float', + 'age' => '\Pipedrive\Model\DealNonStrictWithDetailsAllOfAge', + 'stay_in_pipeline_stages' => '\Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages', + 'last_activity' => 'object', + 'next_activity' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'update_time' => null, + 'stage_change_time' => null, + 'active' => null, + 'deleted' => null, + 'status' => null, + 'probability' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'first_won_time' => null, + 'lost_time' => null, + 'products_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'participants_count' => null, + 'expected_close_date' => 'date', + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'label' => null, + 'stage_order_nr' => null, + 'person_name' => null, + 'org_name' => null, + 'next_activity_subject' => null, + 'next_activity_type' => null, + 'next_activity_duration' => null, + 'next_activity_note' => null, + 'formatted_value' => null, + 'weighted_value' => null, + 'formatted_weighted_value' => null, + 'weighted_value_currency' => null, + 'rotten_time' => null, + 'owner_name' => null, + 'cc_email' => null, + 'org_hidden' => null, + 'person_hidden' => null, + 'average_time_to_won' => null, + 'average_stage_progress' => null, + 'age' => null, + 'stay_in_pipeline_stages' => null, + 'last_activity' => null, + 'next_activity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'stage_change_time' => 'stage_change_time', + 'active' => 'active', + 'deleted' => 'deleted', + 'status' => 'status', + 'probability' => 'probability', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'first_won_time' => 'first_won_time', + 'lost_time' => 'lost_time', + 'products_count' => 'products_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'participants_count' => 'participants_count', + 'expected_close_date' => 'expected_close_date', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'label' => 'label', + 'stage_order_nr' => 'stage_order_nr', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'next_activity_subject' => 'next_activity_subject', + 'next_activity_type' => 'next_activity_type', + 'next_activity_duration' => 'next_activity_duration', + 'next_activity_note' => 'next_activity_note', + 'formatted_value' => 'formatted_value', + 'weighted_value' => 'weighted_value', + 'formatted_weighted_value' => 'formatted_weighted_value', + 'weighted_value_currency' => 'weighted_value_currency', + 'rotten_time' => 'rotten_time', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'org_hidden' => 'org_hidden', + 'person_hidden' => 'person_hidden', + 'average_time_to_won' => 'average_time_to_won', + 'average_stage_progress' => 'average_stage_progress', + 'age' => 'age', + 'stay_in_pipeline_stages' => 'stay_in_pipeline_stages', + 'last_activity' => 'last_activity', + 'next_activity' => 'next_activity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'stage_change_time' => 'setStageChangeTime', + 'active' => 'setActive', + 'deleted' => 'setDeleted', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'first_won_time' => 'setFirstWonTime', + 'lost_time' => 'setLostTime', + 'products_count' => 'setProductsCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'participants_count' => 'setParticipantsCount', + 'expected_close_date' => 'setExpectedCloseDate', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'label' => 'setLabel', + 'stage_order_nr' => 'setStageOrderNr', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'next_activity_subject' => 'setNextActivitySubject', + 'next_activity_type' => 'setNextActivityType', + 'next_activity_duration' => 'setNextActivityDuration', + 'next_activity_note' => 'setNextActivityNote', + 'formatted_value' => 'setFormattedValue', + 'weighted_value' => 'setWeightedValue', + 'formatted_weighted_value' => 'setFormattedWeightedValue', + 'weighted_value_currency' => 'setWeightedValueCurrency', + 'rotten_time' => 'setRottenTime', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'org_hidden' => 'setOrgHidden', + 'person_hidden' => 'setPersonHidden', + 'average_time_to_won' => 'setAverageTimeToWon', + 'average_stage_progress' => 'setAverageStageProgress', + 'age' => 'setAge', + 'stay_in_pipeline_stages' => 'setStayInPipelineStages', + 'last_activity' => 'setLastActivity', + 'next_activity' => 'setNextActivity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'stage_change_time' => 'getStageChangeTime', + 'active' => 'getActive', + 'deleted' => 'getDeleted', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'first_won_time' => 'getFirstWonTime', + 'lost_time' => 'getLostTime', + 'products_count' => 'getProductsCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'participants_count' => 'getParticipantsCount', + 'expected_close_date' => 'getExpectedCloseDate', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'label' => 'getLabel', + 'stage_order_nr' => 'getStageOrderNr', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'next_activity_subject' => 'getNextActivitySubject', + 'next_activity_type' => 'getNextActivityType', + 'next_activity_duration' => 'getNextActivityDuration', + 'next_activity_note' => 'getNextActivityNote', + 'formatted_value' => 'getFormattedValue', + 'weighted_value' => 'getWeightedValue', + 'formatted_weighted_value' => 'getFormattedWeightedValue', + 'weighted_value_currency' => 'getWeightedValueCurrency', + 'rotten_time' => 'getRottenTime', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'org_hidden' => 'getOrgHidden', + 'person_hidden' => 'getPersonHidden', + 'average_time_to_won' => 'getAverageTimeToWon', + 'average_stage_progress' => 'getAverageStageProgress', + 'age' => 'getAge', + 'stay_in_pipeline_stages' => 'getStayInPipelineStages', + 'last_activity' => 'getLastActivity', + 'next_activity' => 'getNextActivity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deleted'] = $data['deleted'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['first_won_time'] = $data['first_won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['products_count'] = $data['products_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['participants_count'] = $data['participants_count'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['stage_order_nr'] = $data['stage_order_nr'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['next_activity_subject'] = $data['next_activity_subject'] ?? null; + $this->container['next_activity_type'] = $data['next_activity_type'] ?? null; + $this->container['next_activity_duration'] = $data['next_activity_duration'] ?? null; + $this->container['next_activity_note'] = $data['next_activity_note'] ?? null; + $this->container['formatted_value'] = $data['formatted_value'] ?? null; + $this->container['weighted_value'] = $data['weighted_value'] ?? null; + $this->container['formatted_weighted_value'] = $data['formatted_weighted_value'] ?? null; + $this->container['weighted_value_currency'] = $data['weighted_value_currency'] ?? null; + $this->container['rotten_time'] = $data['rotten_time'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['org_hidden'] = $data['org_hidden'] ?? null; + $this->container['person_hidden'] = $data['person_hidden'] ?? null; + $this->container['average_time_to_won'] = $data['average_time_to_won'] ?? null; + $this->container['average_stage_progress'] = $data['average_stage_progress'] ?? null; + $this->container['age'] = $data['age'] ?? null; + $this->container['stay_in_pipeline_stages'] = $data['stay_in_pipeline_stages'] ?? null; + $this->container['last_activity'] = $data['last_activity'] ?? null; + $this->container['next_activity'] = $data['next_activity'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return \Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param \Pipedrive\Model\DealNonStrictModeFieldsCreatorUserId|null $creator_user_id creator_user_id + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return \Pipedrive\Model\DealUserDataWithId|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param \Pipedrive\Model\DealUserDataWithId|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return \Pipedrive\Model\DealPersonDataWithId|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param \Pipedrive\Model\DealPersonDataWithId|null $person_id person_id + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\DealOrganizationDataWithId|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\DealOrganizationDataWithId|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets stage_change_time + * + * @return string|null + */ + public function getStageChangeTime() + { + return $this->container['stage_change_time']; + } + + /** + * Sets stage_change_time + * + * @param string|null $stage_change_time The last updated date and time of the deal stage + * + * @return self + */ + public function setStageChangeTime($stage_change_time): self + { + $this->container['stage_change_time'] = $stage_change_time; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether the deal is active or not + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deleted + * + * @return bool|null + */ + public function getDeleted() + { + return $this->container['deleted']; + } + + /** + * Sets deleted + * + * @param bool|null $deleted Whether the deal is deleted or not + * + * @return self + */ + public function setDeleted($deleted): self + { + $this->container['deleted'] = $deleted; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status as won + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets first_won_time + * + * @return string|null + */ + public function getFirstWonTime() + { + return $this->container['first_won_time']; + } + + /** + * Sets first_won_time + * + * @param string|null $first_won_time The date and time of the first time changing the deal status as won + * + * @return self + */ + public function setFirstWonTime($first_won_time): self + { + $this->container['first_won_time'] = $first_won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status as lost + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets products_count + * + * @return int|null + */ + public function getProductsCount() + { + return $this->container['products_count']; + } + + /** + * Sets products_count + * + * @param int|null $products_count The number of products associated with the deal + * + * @return self + */ + public function setProductsCount($products_count): self + { + $this->container['products_count'] = $products_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The number of files associated with the deal + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The number of notes associated with the deal + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The number of followers associated with the deal + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The number of emails associated with the deal + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The number of activities associated with the deal + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The number of completed activities associated with the deal + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The number of incomplete activities associated with the deal + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets participants_count + * + * @return int|null + */ + public function getParticipantsCount() + { + return $this->container['participants_count']; + } + + /** + * Sets participants_count + * + * @param int|null $participants_count The number of participants associated with the deal + * + * @return self + */ + public function setParticipantsCount($participants_count): self + { + $this->container['participants_count'] = $participants_count; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the deal + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the deal + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets stage_order_nr + * + * @return int|null + */ + public function getStageOrderNr() + { + return $this->container['stage_order_nr']; + } + + /** + * Sets stage_order_nr + * + * @param int|null $stage_order_nr The order number of the deal stage associated with the deal + * + * @return self + */ + public function setStageOrderNr($stage_order_nr): self + { + $this->container['stage_order_nr'] = $stage_order_nr; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the deal + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the deal + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets next_activity_subject + * + * @return string|null + */ + public function getNextActivitySubject() + { + return $this->container['next_activity_subject']; + } + + /** + * Sets next_activity_subject + * + * @param string|null $next_activity_subject The subject of the next activity associated with the deal + * + * @return self + */ + public function setNextActivitySubject($next_activity_subject): self + { + $this->container['next_activity_subject'] = $next_activity_subject; + + return $this; + } + + /** + * Gets next_activity_type + * + * @return string|null + */ + public function getNextActivityType() + { + return $this->container['next_activity_type']; + } + + /** + * Sets next_activity_type + * + * @param string|null $next_activity_type The type of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityType($next_activity_type): self + { + $this->container['next_activity_type'] = $next_activity_type; + + return $this; + } + + /** + * Gets next_activity_duration + * + * @return string|null + */ + public function getNextActivityDuration() + { + return $this->container['next_activity_duration']; + } + + /** + * Sets next_activity_duration + * + * @param string|null $next_activity_duration The duration of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDuration($next_activity_duration): self + { + $this->container['next_activity_duration'] = $next_activity_duration; + + return $this; + } + + /** + * Gets next_activity_note + * + * @return string|null + */ + public function getNextActivityNote() + { + return $this->container['next_activity_note']; + } + + /** + * Sets next_activity_note + * + * @param string|null $next_activity_note The note of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityNote($next_activity_note): self + { + $this->container['next_activity_note'] = $next_activity_note; + + return $this; + } + + /** + * Gets formatted_value + * + * @return string|null + */ + public function getFormattedValue() + { + return $this->container['formatted_value']; + } + + /** + * Sets formatted_value + * + * @param string|null $formatted_value The deal value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedValue($formatted_value): self + { + $this->container['formatted_value'] = $formatted_value; + + return $this; + } + + /** + * Gets weighted_value + * + * @return float|null + */ + public function getWeightedValue() + { + return $this->container['weighted_value']; + } + + /** + * Sets weighted_value + * + * @param float|null $weighted_value Probability times deal value. Probability can either be deal probability or if not set, then stage probability. + * + * @return self + */ + public function setWeightedValue($weighted_value): self + { + $this->container['weighted_value'] = $weighted_value; + + return $this; + } + + /** + * Gets formatted_weighted_value + * + * @return string|null + */ + public function getFormattedWeightedValue() + { + return $this->container['formatted_weighted_value']; + } + + /** + * Sets formatted_weighted_value + * + * @param string|null $formatted_weighted_value The weighted_value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedWeightedValue($formatted_weighted_value): self + { + $this->container['formatted_weighted_value'] = $formatted_weighted_value; + + return $this; + } + + /** + * Gets weighted_value_currency + * + * @return string|null + */ + public function getWeightedValueCurrency() + { + return $this->container['weighted_value_currency']; + } + + /** + * Sets weighted_value_currency + * + * @param string|null $weighted_value_currency The currency associated with the deal + * + * @return self + */ + public function setWeightedValueCurrency($weighted_value_currency): self + { + $this->container['weighted_value_currency'] = $weighted_value_currency; + + return $this; + } + + /** + * Gets rotten_time + * + * @return string|null + */ + public function getRottenTime() + { + return $this->container['rotten_time']; + } + + /** + * Sets rotten_time + * + * @param string|null $rotten_time The date and time of changing the deal status as rotten + * + * @return self + */ + public function setRottenTime($rotten_time): self + { + $this->container['rotten_time'] = $rotten_time; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the deal owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets org_hidden + * + * @return bool|null + */ + public function getOrgHidden() + { + return $this->container['org_hidden']; + } + + /** + * Sets org_hidden + * + * @param bool|null $org_hidden If the organization that is associated with the deal is hidden or not + * + * @return self + */ + public function setOrgHidden($org_hidden): self + { + $this->container['org_hidden'] = $org_hidden; + + return $this; + } + + /** + * Gets person_hidden + * + * @return bool|null + */ + public function getPersonHidden() + { + return $this->container['person_hidden']; + } + + /** + * Sets person_hidden + * + * @param bool|null $person_hidden If the person that is associated with the deal is hidden or not + * + * @return self + */ + public function setPersonHidden($person_hidden): self + { + $this->container['person_hidden'] = $person_hidden; + + return $this; + } + + /** + * Gets average_time_to_won + * + * @return \Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon|null + */ + public function getAverageTimeToWon() + { + return $this->container['average_time_to_won']; + } + + /** + * Sets average_time_to_won + * + * @param \Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon|null $average_time_to_won average_time_to_won + * + * @return self + */ + public function setAverageTimeToWon($average_time_to_won): self + { + $this->container['average_time_to_won'] = $average_time_to_won; + + return $this; + } + + /** + * Gets average_stage_progress + * + * @return float|null + */ + public function getAverageStageProgress() + { + return $this->container['average_stage_progress']; + } + + /** + * Sets average_stage_progress + * + * @param float|null $average_stage_progress The average of the deal stage progression + * + * @return self + */ + public function setAverageStageProgress($average_stage_progress): self + { + $this->container['average_stage_progress'] = $average_stage_progress; + + return $this; + } + + /** + * Gets age + * + * @return \Pipedrive\Model\DealNonStrictWithDetailsAllOfAge|null + */ + public function getAge() + { + return $this->container['age']; + } + + /** + * Sets age + * + * @param \Pipedrive\Model\DealNonStrictWithDetailsAllOfAge|null $age age + * + * @return self + */ + public function setAge($age): self + { + $this->container['age'] = $age; + + return $this; + } + + /** + * Gets stay_in_pipeline_stages + * + * @return \Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages|null + */ + public function getStayInPipelineStages() + { + return $this->container['stay_in_pipeline_stages']; + } + + /** + * Sets stay_in_pipeline_stages + * + * @param \Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages|null $stay_in_pipeline_stages stay_in_pipeline_stages + * + * @return self + */ + public function setStayInPipelineStages($stay_in_pipeline_stages): self + { + $this->container['stay_in_pipeline_stages'] = $stay_in_pipeline_stages; + + return $this; + } + + /** + * Gets last_activity + * + * @return object|null + */ + public function getLastActivity() + { + return $this->container['last_activity']; + } + + /** + * Sets last_activity + * + * @param object|null $last_activity The details of the last activity associated with the deal + * + * @return self + */ + public function setLastActivity($last_activity): self + { + $this->container['last_activity'] = $last_activity; + + return $this; + } + + /** + * Gets next_activity + * + * @return object|null + */ + public function getNextActivity() + { + return $this->container['next_activity']; + } + + /** + * Sets next_activity + * + * @param object|null $next_activity The details of the next activity associated with the deal + * + * @return self + */ + public function setNextActivity($next_activity): self + { + $this->container['next_activity'] = $next_activity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictWithDetailsAllOf.php b/lib/Model/DealNonStrictWithDetailsAllOf.php new file mode 100644 index 00000000..378516b8 --- /dev/null +++ b/lib/Model/DealNonStrictWithDetailsAllOf.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictWithDetailsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictWithDetails_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'average_time_to_won' => '\Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon', + 'average_stage_progress' => 'float', + 'age' => '\Pipedrive\Model\DealNonStrictWithDetailsAllOfAge', + 'stay_in_pipeline_stages' => '\Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages', + 'last_activity' => 'object', + 'next_activity' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'average_time_to_won' => null, + 'average_stage_progress' => null, + 'age' => null, + 'stay_in_pipeline_stages' => null, + 'last_activity' => null, + 'next_activity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'average_time_to_won' => 'average_time_to_won', + 'average_stage_progress' => 'average_stage_progress', + 'age' => 'age', + 'stay_in_pipeline_stages' => 'stay_in_pipeline_stages', + 'last_activity' => 'last_activity', + 'next_activity' => 'next_activity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'average_time_to_won' => 'setAverageTimeToWon', + 'average_stage_progress' => 'setAverageStageProgress', + 'age' => 'setAge', + 'stay_in_pipeline_stages' => 'setStayInPipelineStages', + 'last_activity' => 'setLastActivity', + 'next_activity' => 'setNextActivity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'average_time_to_won' => 'getAverageTimeToWon', + 'average_stage_progress' => 'getAverageStageProgress', + 'age' => 'getAge', + 'stay_in_pipeline_stages' => 'getStayInPipelineStages', + 'last_activity' => 'getLastActivity', + 'next_activity' => 'getNextActivity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['average_time_to_won'] = $data['average_time_to_won'] ?? null; + $this->container['average_stage_progress'] = $data['average_stage_progress'] ?? null; + $this->container['age'] = $data['age'] ?? null; + $this->container['stay_in_pipeline_stages'] = $data['stay_in_pipeline_stages'] ?? null; + $this->container['last_activity'] = $data['last_activity'] ?? null; + $this->container['next_activity'] = $data['next_activity'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets average_time_to_won + * + * @return \Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon|null + */ + public function getAverageTimeToWon() + { + return $this->container['average_time_to_won']; + } + + /** + * Sets average_time_to_won + * + * @param \Pipedrive\Model\DealNonStrictWithDetailsAllOfAverageTimeToWon|null $average_time_to_won average_time_to_won + * + * @return self + */ + public function setAverageTimeToWon($average_time_to_won): self + { + $this->container['average_time_to_won'] = $average_time_to_won; + + return $this; + } + + /** + * Gets average_stage_progress + * + * @return float|null + */ + public function getAverageStageProgress() + { + return $this->container['average_stage_progress']; + } + + /** + * Sets average_stage_progress + * + * @param float|null $average_stage_progress The average of the deal stage progression + * + * @return self + */ + public function setAverageStageProgress($average_stage_progress): self + { + $this->container['average_stage_progress'] = $average_stage_progress; + + return $this; + } + + /** + * Gets age + * + * @return \Pipedrive\Model\DealNonStrictWithDetailsAllOfAge|null + */ + public function getAge() + { + return $this->container['age']; + } + + /** + * Sets age + * + * @param \Pipedrive\Model\DealNonStrictWithDetailsAllOfAge|null $age age + * + * @return self + */ + public function setAge($age): self + { + $this->container['age'] = $age; + + return $this; + } + + /** + * Gets stay_in_pipeline_stages + * + * @return \Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages|null + */ + public function getStayInPipelineStages() + { + return $this->container['stay_in_pipeline_stages']; + } + + /** + * Sets stay_in_pipeline_stages + * + * @param \Pipedrive\Model\DealNonStrictWithDetailsAllOfStayInPipelineStages|null $stay_in_pipeline_stages stay_in_pipeline_stages + * + * @return self + */ + public function setStayInPipelineStages($stay_in_pipeline_stages): self + { + $this->container['stay_in_pipeline_stages'] = $stay_in_pipeline_stages; + + return $this; + } + + /** + * Gets last_activity + * + * @return object|null + */ + public function getLastActivity() + { + return $this->container['last_activity']; + } + + /** + * Sets last_activity + * + * @param object|null $last_activity The details of the last activity associated with the deal + * + * @return self + */ + public function setLastActivity($last_activity): self + { + $this->container['last_activity'] = $last_activity; + + return $this; + } + + /** + * Gets next_activity + * + * @return object|null + */ + public function getNextActivity() + { + return $this->container['next_activity']; + } + + /** + * Sets next_activity + * + * @param object|null $next_activity The details of the next activity associated with the deal + * + * @return self + */ + public function setNextActivity($next_activity): self + { + $this->container['next_activity'] = $next_activity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictWithDetailsAllOfAge.php b/lib/Model/DealNonStrictWithDetailsAllOfAge.php new file mode 100644 index 00000000..4b85f5ed --- /dev/null +++ b/lib/Model/DealNonStrictWithDetailsAllOfAge.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictWithDetailsAllOfAge implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictWithDetails_allOf_age'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'y' => 'int', + 'm' => 'int', + 'd' => 'int', + 'h' => 'int', + 'i' => 'int', + 's' => 'int', + 'total_seconds' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'y' => null, + 'm' => null, + 'd' => null, + 'h' => null, + 'i' => null, + 's' => null, + 'total_seconds' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'y' => 'y', + 'm' => 'm', + 'd' => 'd', + 'h' => 'h', + 'i' => 'i', + 's' => 's', + 'total_seconds' => 'total_seconds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'y' => 'setY', + 'm' => 'setM', + 'd' => 'setD', + 'h' => 'setH', + 'i' => 'setI', + 's' => 'setS', + 'total_seconds' => 'setTotalSeconds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'y' => 'getY', + 'm' => 'getM', + 'd' => 'getD', + 'h' => 'getH', + 'i' => 'getI', + 's' => 'getS', + 'total_seconds' => 'getTotalSeconds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['y'] = $data['y'] ?? null; + $this->container['m'] = $data['m'] ?? null; + $this->container['d'] = $data['d'] ?? null; + $this->container['h'] = $data['h'] ?? null; + $this->container['i'] = $data['i'] ?? null; + $this->container['s'] = $data['s'] ?? null; + $this->container['total_seconds'] = $data['total_seconds'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets y + * + * @return int|null + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int|null $y Years + * + * @return self + */ + public function setY($y): self + { + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets m + * + * @return int|null + */ + public function getM() + { + return $this->container['m']; + } + + /** + * Sets m + * + * @param int|null $m Months + * + * @return self + */ + public function setM($m): self + { + $this->container['m'] = $m; + + return $this; + } + + /** + * Gets d + * + * @return int|null + */ + public function getD() + { + return $this->container['d']; + } + + /** + * Sets d + * + * @param int|null $d Days + * + * @return self + */ + public function setD($d): self + { + $this->container['d'] = $d; + + return $this; + } + + /** + * Gets h + * + * @return int|null + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param int|null $h Hours + * + * @return self + */ + public function setH($h): self + { + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets i + * + * @return int|null + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param int|null $i Minutes + * + * @return self + */ + public function setI($i): self + { + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets s + * + * @return int|null + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int|null $s Seconds + * + * @return self + */ + public function setS($s): self + { + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets total_seconds + * + * @return int|null + */ + public function getTotalSeconds() + { + return $this->container['total_seconds']; + } + + /** + * Sets total_seconds + * + * @param int|null $total_seconds The total time in seconds + * + * @return self + */ + public function setTotalSeconds($total_seconds): self + { + $this->container['total_seconds'] = $total_seconds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.php b/lib/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.php new file mode 100644 index 00000000..e898b368 --- /dev/null +++ b/lib/Model/DealNonStrictWithDetailsAllOfAverageTimeToWon.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictWithDetailsAllOfAverageTimeToWon implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictWithDetails_allOf_average_time_to_won'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'y' => 'int', + 'm' => 'int', + 'd' => 'int', + 'h' => 'int', + 'i' => 'int', + 's' => 'int', + 'total_seconds' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'y' => null, + 'm' => null, + 'd' => null, + 'h' => null, + 'i' => null, + 's' => null, + 'total_seconds' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'y' => 'y', + 'm' => 'm', + 'd' => 'd', + 'h' => 'h', + 'i' => 'i', + 's' => 's', + 'total_seconds' => 'total_seconds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'y' => 'setY', + 'm' => 'setM', + 'd' => 'setD', + 'h' => 'setH', + 'i' => 'setI', + 's' => 'setS', + 'total_seconds' => 'setTotalSeconds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'y' => 'getY', + 'm' => 'getM', + 'd' => 'getD', + 'h' => 'getH', + 'i' => 'getI', + 's' => 'getS', + 'total_seconds' => 'getTotalSeconds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['y'] = $data['y'] ?? null; + $this->container['m'] = $data['m'] ?? null; + $this->container['d'] = $data['d'] ?? null; + $this->container['h'] = $data['h'] ?? null; + $this->container['i'] = $data['i'] ?? null; + $this->container['s'] = $data['s'] ?? null; + $this->container['total_seconds'] = $data['total_seconds'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets y + * + * @return int|null + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param int|null $y Years + * + * @return self + */ + public function setY($y): self + { + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets m + * + * @return int|null + */ + public function getM() + { + return $this->container['m']; + } + + /** + * Sets m + * + * @param int|null $m Months + * + * @return self + */ + public function setM($m): self + { + $this->container['m'] = $m; + + return $this; + } + + /** + * Gets d + * + * @return int|null + */ + public function getD() + { + return $this->container['d']; + } + + /** + * Sets d + * + * @param int|null $d Days + * + * @return self + */ + public function setD($d): self + { + $this->container['d'] = $d; + + return $this; + } + + /** + * Gets h + * + * @return int|null + */ + public function getH() + { + return $this->container['h']; + } + + /** + * Sets h + * + * @param int|null $h Hours + * + * @return self + */ + public function setH($h): self + { + $this->container['h'] = $h; + + return $this; + } + + /** + * Gets i + * + * @return int|null + */ + public function getI() + { + return $this->container['i']; + } + + /** + * Sets i + * + * @param int|null $i Minutes + * + * @return self + */ + public function setI($i): self + { + $this->container['i'] = $i; + + return $this; + } + + /** + * Gets s + * + * @return int|null + */ + public function getS() + { + return $this->container['s']; + } + + /** + * Sets s + * + * @param int|null $s Seconds + * + * @return self + */ + public function setS($s): self + { + $this->container['s'] = $s; + + return $this; + } + + /** + * Gets total_seconds + * + * @return int|null + */ + public function getTotalSeconds() + { + return $this->container['total_seconds']; + } + + /** + * Sets total_seconds + * + * @param int|null $total_seconds The total time in seconds + * + * @return self + */ + public function setTotalSeconds($total_seconds): self + { + $this->container['total_seconds'] = $total_seconds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.php b/lib/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.php new file mode 100644 index 00000000..655967bd --- /dev/null +++ b/lib/Model/DealNonStrictWithDetailsAllOfStayInPipelineStages.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealNonStrictWithDetailsAllOfStayInPipelineStages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealNonStrictWithDetails_allOf_stay_in_pipeline_stages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'times_in_stages' => 'object', + 'order_of_stages' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'times_in_stages' => null, + 'order_of_stages' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'times_in_stages' => 'times_in_stages', + 'order_of_stages' => 'order_of_stages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'times_in_stages' => 'setTimesInStages', + 'order_of_stages' => 'setOrderOfStages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'times_in_stages' => 'getTimesInStages', + 'order_of_stages' => 'getOrderOfStages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['times_in_stages'] = $data['times_in_stages'] ?? null; + $this->container['order_of_stages'] = $data['order_of_stages'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets times_in_stages + * + * @return object|null + */ + public function getTimesInStages() + { + return $this->container['times_in_stages']; + } + + /** + * Sets times_in_stages + * + * @param object|null $times_in_stages The number of seconds a deal has been in each stage of the pipeline + * + * @return self + */ + public function setTimesInStages($times_in_stages): self + { + $this->container['times_in_stages'] = $times_in_stages; + + return $this; + } + + /** + * Gets order_of_stages + * + * @return int[]|null + */ + public function getOrderOfStages() + { + return $this->container['order_of_stages']; + } + + /** + * Sets order_of_stages + * + * @param int[]|null $order_of_stages The order of the deal progression through the pipeline stages + * + * @return self + */ + public function setOrderOfStages($order_of_stages): self + { + $this->container['order_of_stages'] = $order_of_stages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealOrganizationData.php b/lib/Model/DealOrganizationData.php new file mode 100644 index 00000000..bcaabacf --- /dev/null +++ b/lib/Model/DealOrganizationData.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealOrganizationData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealOrganizationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'active_flag' => 'bool', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'active_flag' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'active_flag' => 'active_flag', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'active_flag' => 'setActiveFlag', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'active_flag' => 'getActiveFlag', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the deal + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the deal + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the deal + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization that is associated with the deal + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealOrganizationDataWithId.php b/lib/Model/DealOrganizationDataWithId.php new file mode 100644 index 00000000..0e43a1f8 --- /dev/null +++ b/lib/Model/DealOrganizationDataWithId.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealOrganizationDataWithId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealOrganizationDataWithId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'active_flag' => 'bool', + 'cc_email' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'active_flag' => null, + 'cc_email' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'active_flag' => 'active_flag', + 'cc_email' => 'cc_email', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'active_flag' => 'setActiveFlag', + 'cc_email' => 'setCcEmail', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'active_flag' => 'getActiveFlag', + 'cc_email' => 'getCcEmail', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the deal + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the deal + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the deal + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization that is associated with the deal + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the organization associated with the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealOrganizationDataWithIdAllOf.php b/lib/Model/DealOrganizationDataWithIdAllOf.php new file mode 100644 index 00000000..dea0eed2 --- /dev/null +++ b/lib/Model/DealOrganizationDataWithIdAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealOrganizationDataWithIdAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealOrganizationDataWithId_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the organization associated with the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealParticipantCountInfo.php b/lib/Model/DealParticipantCountInfo.php new file mode 100644 index 00000000..d51f2f18 --- /dev/null +++ b/lib/Model/DealParticipantCountInfo.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealParticipantCountInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealParticipantCountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'participant_open_deals_count' => 'int', + 'participant_closed_deals_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'participant_open_deals_count' => null, + 'participant_closed_deals_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'participant_open_deals_count' => 'participant_open_deals_count', + 'participant_closed_deals_count' => 'participant_closed_deals_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'participant_open_deals_count' => 'setParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'setParticipantClosedDealsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'participant_open_deals_count' => 'getParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'getParticipantClosedDealsCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['participant_open_deals_count'] = $data['participant_open_deals_count'] ?? null; + $this->container['participant_closed_deals_count'] = $data['participant_closed_deals_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets participant_open_deals_count + * + * @return int|null + */ + public function getParticipantOpenDealsCount() + { + return $this->container['participant_open_deals_count']; + } + + /** + * Sets participant_open_deals_count + * + * @param int|null $participant_open_deals_count The count of open participant deals related with the item + * + * @return self + */ + public function setParticipantOpenDealsCount($participant_open_deals_count): self + { + $this->container['participant_open_deals_count'] = $participant_open_deals_count; + + return $this; + } + + /** + * Gets participant_closed_deals_count + * + * @return int|null + */ + public function getParticipantClosedDealsCount() + { + return $this->container['participant_closed_deals_count']; + } + + /** + * Sets participant_closed_deals_count + * + * @param int|null $participant_closed_deals_count The count of closed participant deals related with the item + * + * @return self + */ + public function setParticipantClosedDealsCount($participant_closed_deals_count): self + { + $this->container['participant_closed_deals_count'] = $participant_closed_deals_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealParticipants.php b/lib/Model/DealParticipants.php new file mode 100644 index 00000000..21c3df10 --- /dev/null +++ b/lib/Model/DealParticipants.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealParticipants implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealParticipants'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\GetDealsRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem[]|null $data The array of participants + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetDealsRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetDealsRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealPersonData.php b/lib/Model/DealPersonData.php new file mode 100644 index 00000000..cc267c1d --- /dev/null +++ b/lib/Model/DealPersonData.php @@ -0,0 +1,463 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealPersonData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealPersonData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool', + 'name' => 'string', + 'email' => '\Pipedrive\Model\DealPersonDataEmail[]', + 'phone' => '\Pipedrive\Model\DealPersonDataPhone[]', + 'owner_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null, + 'name' => null, + 'email' => null, + 'phone' => null, + 'owner_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag', + 'name' => 'name', + 'email' => 'email', + 'phone' => 'phone', + 'owner_id' => 'owner_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag', + 'name' => 'setName', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'owner_id' => 'setOwnerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag', + 'name' => 'getName', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'owner_id' => 'getOwnerId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person associated with the deal + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\DealPersonDataEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\DealPersonDataEmail[]|null $email The emails of the person associated with the deal + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\DealPersonDataPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\DealPersonDataPhone[]|null $phone The phone numbers of the person associated with the deal + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the person that is associated with the deal + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealPersonDataEmail.php b/lib/Model/DealPersonDataEmail.php new file mode 100644 index 00000000..153c8ba5 --- /dev/null +++ b/lib/Model/DealPersonDataEmail.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealPersonDataEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealPersonData_email'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'label' => 'string', + 'value' => 'string', + 'primary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'label' => null, + 'value' => null, + 'primary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'value' => 'value', + 'primary' => 'primary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'value' => 'setValue', + 'primary' => 'setPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'value' => 'getValue', + 'primary' => 'getPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['label'] = $data['label'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The type of the email + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The email of the associated person + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary If this is the primary email or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealPersonDataPhone.php b/lib/Model/DealPersonDataPhone.php new file mode 100644 index 00000000..11ba6df3 --- /dev/null +++ b/lib/Model/DealPersonDataPhone.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealPersonDataPhone implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealPersonData_phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'label' => 'string', + 'value' => 'string', + 'primary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'label' => null, + 'value' => null, + 'primary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'value' => 'value', + 'primary' => 'primary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'value' => 'setValue', + 'primary' => 'setPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'value' => 'getValue', + 'primary' => 'getPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['label'] = $data['label'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The type of the phone number + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The phone number of the person associated with the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary If this is the primary phone number or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealPersonDataWithId.php b/lib/Model/DealPersonDataWithId.php new file mode 100644 index 00000000..f765fd1f --- /dev/null +++ b/lib/Model/DealPersonDataWithId.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealPersonDataWithId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealPersonDataWithId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool', + 'name' => 'string', + 'email' => '\Pipedrive\Model\DealPersonDataEmail[]', + 'phone' => '\Pipedrive\Model\DealPersonDataPhone[]', + 'owner_id' => 'int', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null, + 'name' => null, + 'email' => null, + 'phone' => null, + 'owner_id' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag', + 'name' => 'name', + 'email' => 'email', + 'phone' => 'phone', + 'owner_id' => 'owner_id', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag', + 'name' => 'setName', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'owner_id' => 'setOwnerId', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag', + 'name' => 'getName', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'owner_id' => 'getOwnerId', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person associated with the deal + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\DealPersonDataEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\DealPersonDataEmail[]|null $email The emails of the person associated with the deal + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\DealPersonDataPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\DealPersonDataPhone[]|null $phone The phone numbers of the person associated with the deal + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the person that is associated with the deal + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the person associated with the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealPersonDataWithIdAllOf.php b/lib/Model/DealPersonDataWithIdAllOf.php new file mode 100644 index 00000000..22d75050 --- /dev/null +++ b/lib/Model/DealPersonDataWithIdAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealPersonDataWithIdAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealPersonDataWithId_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the person associated with the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealProductUnitDuration.php b/lib/Model/DealProductUnitDuration.php new file mode 100644 index 00000000..3c5c1448 --- /dev/null +++ b/lib/Model/DealProductUnitDuration.php @@ -0,0 +1,71 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'result_score' => 'float', + 'item' => '\Pipedrive\Model\DealSearchItemItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result_score' => null, + 'item' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result_score' => 'result_score', + 'item' => 'item' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result_score' => 'setResultScore', + 'item' => 'setItem' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result_score' => 'getResultScore', + 'item' => 'getItem' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result_score'] = $data['result_score'] ?? null; + $this->container['item'] = $data['item'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_score + * + * @return float|null + */ + public function getResultScore() + { + return $this->container['result_score']; + } + + /** + * Sets result_score + * + * @param float|null $result_score Search result relevancy + * + * @return self + */ + public function setResultScore($result_score): self + { + $this->container['result_score'] = $result_score; + + return $this; + } + + /** + * Gets item + * + * @return \Pipedrive\Model\DealSearchItemItem|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \Pipedrive\Model\DealSearchItemItem|null $item item + * + * @return self + */ + public function setItem($item): self + { + $this->container['item'] = $item; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchItemItem.php b/lib/Model/DealSearchItemItem.php new file mode 100644 index 00000000..2450b7d1 --- /dev/null +++ b/lib/Model/DealSearchItemItem.php @@ -0,0 +1,702 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchItem_item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'title' => 'string', + 'value' => 'int', + 'currency' => 'string', + 'status' => 'string', + 'visible_to' => 'int', + 'owner' => '\Pipedrive\Model\DealSearchItemItemOwner', + 'stage' => '\Pipedrive\Model\DealSearchItemItemStage', + 'person' => '\Pipedrive\Model\DealSearchItemItemPerson', + 'organization' => '\Pipedrive\Model\DealSearchItemItemOrganization', + 'custom_fields' => 'string[]', + 'notes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'status' => null, + 'visible_to' => null, + 'owner' => null, + 'stage' => null, + 'person' => null, + 'organization' => null, + 'custom_fields' => null, + 'notes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'status' => 'status', + 'visible_to' => 'visible_to', + 'owner' => 'owner', + 'stage' => 'stage', + 'person' => 'person', + 'organization' => 'organization', + 'custom_fields' => 'custom_fields', + 'notes' => 'notes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'status' => 'setStatus', + 'visible_to' => 'setVisibleTo', + 'owner' => 'setOwner', + 'stage' => 'setStage', + 'person' => 'setPerson', + 'organization' => 'setOrganization', + 'custom_fields' => 'setCustomFields', + 'notes' => 'setNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'status' => 'getStatus', + 'visible_to' => 'getVisibleTo', + 'owner' => 'getOwner', + 'stage' => 'getStage', + 'person' => 'getPerson', + 'organization' => 'getOrganization', + 'custom_fields' => 'getCustomFields', + 'notes' => 'getNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner'] = $data['owner'] ?? null; + $this->container['stage'] = $data['stage'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the item + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner + * + * @return \Pipedrive\Model\DealSearchItemItemOwner|null + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * + * @param \Pipedrive\Model\DealSearchItemItemOwner|null $owner owner + * + * @return self + */ + public function setOwner($owner): self + { + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets stage + * + * @return \Pipedrive\Model\DealSearchItemItemStage|null + */ + public function getStage() + { + return $this->container['stage']; + } + + /** + * Sets stage + * + * @param \Pipedrive\Model\DealSearchItemItemStage|null $stage stage + * + * @return self + */ + public function setStage($stage): self + { + $this->container['stage'] = $stage; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\DealSearchItemItemPerson|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\DealSearchItemItemPerson|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\DealSearchItemItemOrganization|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\DealSearchItemItemOrganization|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets custom_fields + * + * @return string[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param string[]|null $custom_fields Custom fields + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets notes + * + * @return string[]|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string[]|null $notes An array of notes + * + * @return self + */ + public function setNotes($notes): self + { + $this->container['notes'] = $notes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchItemItemOrganization.php b/lib/Model/DealSearchItemItemOrganization.php new file mode 100644 index 00000000..eb0abe3e --- /dev/null +++ b/lib/Model/DealSearchItemItemOrganization.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchItemItemOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchItem_item_organization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization the deal is associated with + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization the deal is associated with + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchItemItemOwner.php b/lib/Model/DealSearchItemItemOwner.php new file mode 100644 index 00000000..e1fc26e4 --- /dev/null +++ b/lib/Model/DealSearchItemItemOwner.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchItemItemOwner implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchItem_item_owner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the owner of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchItemItemPerson.php b/lib/Model/DealSearchItemItemPerson.php new file mode 100644 index 00000000..9e7473f4 --- /dev/null +++ b/lib/Model/DealSearchItemItemPerson.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchItemItemPerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchItem_item_person'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person the deal is associated with + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person the deal is associated with + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchItemItemStage.php b/lib/Model/DealSearchItemItemStage.php new file mode 100644 index 00000000..df13dfff --- /dev/null +++ b/lib/Model/DealSearchItemItemStage.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchItemItemStage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchItem_item_stage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the stage of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the stage of the deal + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchResponse.php b/lib/Model/DealSearchResponse.php new file mode 100644 index 00000000..6597a6c4 --- /dev/null +++ b/lib/Model/DealSearchResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchResponseAllOf.php b/lib/Model/DealSearchResponseAllOf.php new file mode 100644 index 00000000..e6a1629b --- /dev/null +++ b/lib/Model/DealSearchResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DealSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DealSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSearchResponseAllOfData.php b/lib/Model/DealSearchResponseAllOfData.php new file mode 100644 index 00000000..3f909e6c --- /dev/null +++ b/lib/Model/DealSearchResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSearchResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSearchResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\DealSearchItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\DealSearchItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\DealSearchItem[]|null $items The array of deals + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealStrict.php b/lib/Model/DealStrict.php new file mode 100644 index 00000000..eaa2a129 --- /dev/null +++ b/lib/Model/DealStrict.php @@ -0,0 +1,2022 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealStrict implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealStrict'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => 'int', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'stage_change_time' => 'string', + 'active' => 'bool', + 'deleted' => 'bool', + 'status' => 'string', + 'probability' => 'float', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'first_won_time' => 'string', + 'lost_time' => 'string', + 'products_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'participants_count' => 'int', + 'expected_close_date' => '\DateTime', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'label' => 'string', + 'stage_order_nr' => 'int', + 'person_name' => 'string', + 'org_name' => 'string', + 'next_activity_subject' => 'string', + 'next_activity_type' => 'string', + 'next_activity_duration' => 'string', + 'next_activity_note' => 'string', + 'formatted_value' => 'string', + 'weighted_value' => 'float', + 'formatted_weighted_value' => 'string', + 'weighted_value_currency' => 'string', + 'rotten_time' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'org_hidden' => 'bool', + 'person_hidden' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'update_time' => null, + 'stage_change_time' => null, + 'active' => null, + 'deleted' => null, + 'status' => null, + 'probability' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'first_won_time' => null, + 'lost_time' => null, + 'products_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'participants_count' => null, + 'expected_close_date' => 'date', + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'label' => null, + 'stage_order_nr' => null, + 'person_name' => null, + 'org_name' => null, + 'next_activity_subject' => null, + 'next_activity_type' => null, + 'next_activity_duration' => null, + 'next_activity_note' => null, + 'formatted_value' => null, + 'weighted_value' => null, + 'formatted_weighted_value' => null, + 'weighted_value_currency' => null, + 'rotten_time' => null, + 'owner_name' => null, + 'cc_email' => null, + 'org_hidden' => null, + 'person_hidden' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'stage_change_time' => 'stage_change_time', + 'active' => 'active', + 'deleted' => 'deleted', + 'status' => 'status', + 'probability' => 'probability', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'first_won_time' => 'first_won_time', + 'lost_time' => 'lost_time', + 'products_count' => 'products_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'participants_count' => 'participants_count', + 'expected_close_date' => 'expected_close_date', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'label' => 'label', + 'stage_order_nr' => 'stage_order_nr', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'next_activity_subject' => 'next_activity_subject', + 'next_activity_type' => 'next_activity_type', + 'next_activity_duration' => 'next_activity_duration', + 'next_activity_note' => 'next_activity_note', + 'formatted_value' => 'formatted_value', + 'weighted_value' => 'weighted_value', + 'formatted_weighted_value' => 'formatted_weighted_value', + 'weighted_value_currency' => 'weighted_value_currency', + 'rotten_time' => 'rotten_time', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'org_hidden' => 'org_hidden', + 'person_hidden' => 'person_hidden' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'stage_change_time' => 'setStageChangeTime', + 'active' => 'setActive', + 'deleted' => 'setDeleted', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'first_won_time' => 'setFirstWonTime', + 'lost_time' => 'setLostTime', + 'products_count' => 'setProductsCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'participants_count' => 'setParticipantsCount', + 'expected_close_date' => 'setExpectedCloseDate', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'label' => 'setLabel', + 'stage_order_nr' => 'setStageOrderNr', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'next_activity_subject' => 'setNextActivitySubject', + 'next_activity_type' => 'setNextActivityType', + 'next_activity_duration' => 'setNextActivityDuration', + 'next_activity_note' => 'setNextActivityNote', + 'formatted_value' => 'setFormattedValue', + 'weighted_value' => 'setWeightedValue', + 'formatted_weighted_value' => 'setFormattedWeightedValue', + 'weighted_value_currency' => 'setWeightedValueCurrency', + 'rotten_time' => 'setRottenTime', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'org_hidden' => 'setOrgHidden', + 'person_hidden' => 'setPersonHidden' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'stage_change_time' => 'getStageChangeTime', + 'active' => 'getActive', + 'deleted' => 'getDeleted', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'first_won_time' => 'getFirstWonTime', + 'lost_time' => 'getLostTime', + 'products_count' => 'getProductsCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'participants_count' => 'getParticipantsCount', + 'expected_close_date' => 'getExpectedCloseDate', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'label' => 'getLabel', + 'stage_order_nr' => 'getStageOrderNr', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'next_activity_subject' => 'getNextActivitySubject', + 'next_activity_type' => 'getNextActivityType', + 'next_activity_duration' => 'getNextActivityDuration', + 'next_activity_note' => 'getNextActivityNote', + 'formatted_value' => 'getFormattedValue', + 'weighted_value' => 'getWeightedValue', + 'formatted_weighted_value' => 'getFormattedWeightedValue', + 'weighted_value_currency' => 'getWeightedValueCurrency', + 'rotten_time' => 'getRottenTime', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'org_hidden' => 'getOrgHidden', + 'person_hidden' => 'getPersonHidden' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deleted'] = $data['deleted'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['first_won_time'] = $data['first_won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['products_count'] = $data['products_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['participants_count'] = $data['participants_count'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['stage_order_nr'] = $data['stage_order_nr'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['next_activity_subject'] = $data['next_activity_subject'] ?? null; + $this->container['next_activity_type'] = $data['next_activity_type'] ?? null; + $this->container['next_activity_duration'] = $data['next_activity_duration'] ?? null; + $this->container['next_activity_note'] = $data['next_activity_note'] ?? null; + $this->container['formatted_value'] = $data['formatted_value'] ?? null; + $this->container['weighted_value'] = $data['weighted_value'] ?? null; + $this->container['formatted_weighted_value'] = $data['formatted_weighted_value'] ?? null; + $this->container['weighted_value_currency'] = $data['weighted_value_currency'] ?? null; + $this->container['rotten_time'] = $data['rotten_time'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['org_hidden'] = $data['org_hidden'] ?? null; + $this->container['person_hidden'] = $data['person_hidden'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return int|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param int|null $creator_user_id The ID of the deal creator + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person associated with the deal + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization associated with the deal + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets stage_change_time + * + * @return string|null + */ + public function getStageChangeTime() + { + return $this->container['stage_change_time']; + } + + /** + * Sets stage_change_time + * + * @param string|null $stage_change_time The last updated date and time of the deal stage + * + * @return self + */ + public function setStageChangeTime($stage_change_time): self + { + $this->container['stage_change_time'] = $stage_change_time; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether the deal is active or not + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deleted + * + * @return bool|null + */ + public function getDeleted() + { + return $this->container['deleted']; + } + + /** + * Sets deleted + * + * @param bool|null $deleted Whether the deal is deleted or not + * + * @return self + */ + public function setDeleted($deleted): self + { + $this->container['deleted'] = $deleted; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status as won + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets first_won_time + * + * @return string|null + */ + public function getFirstWonTime() + { + return $this->container['first_won_time']; + } + + /** + * Sets first_won_time + * + * @param string|null $first_won_time The date and time of the first time changing the deal status as won + * + * @return self + */ + public function setFirstWonTime($first_won_time): self + { + $this->container['first_won_time'] = $first_won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status as lost + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets products_count + * + * @return int|null + */ + public function getProductsCount() + { + return $this->container['products_count']; + } + + /** + * Sets products_count + * + * @param int|null $products_count The number of products associated with the deal + * + * @return self + */ + public function setProductsCount($products_count): self + { + $this->container['products_count'] = $products_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The number of files associated with the deal + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The number of notes associated with the deal + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The number of followers associated with the deal + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The number of emails associated with the deal + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The number of activities associated with the deal + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The number of completed activities associated with the deal + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The number of incomplete activities associated with the deal + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets participants_count + * + * @return int|null + */ + public function getParticipantsCount() + { + return $this->container['participants_count']; + } + + /** + * Sets participants_count + * + * @param int|null $participants_count The number of participants associated with the deal + * + * @return self + */ + public function setParticipantsCount($participants_count): self + { + $this->container['participants_count'] = $participants_count; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the deal + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the deal + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets stage_order_nr + * + * @return int|null + */ + public function getStageOrderNr() + { + return $this->container['stage_order_nr']; + } + + /** + * Sets stage_order_nr + * + * @param int|null $stage_order_nr The order number of the deal stage associated with the deal + * + * @return self + */ + public function setStageOrderNr($stage_order_nr): self + { + $this->container['stage_order_nr'] = $stage_order_nr; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the deal + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the deal + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets next_activity_subject + * + * @return string|null + */ + public function getNextActivitySubject() + { + return $this->container['next_activity_subject']; + } + + /** + * Sets next_activity_subject + * + * @param string|null $next_activity_subject The subject of the next activity associated with the deal + * + * @return self + */ + public function setNextActivitySubject($next_activity_subject): self + { + $this->container['next_activity_subject'] = $next_activity_subject; + + return $this; + } + + /** + * Gets next_activity_type + * + * @return string|null + */ + public function getNextActivityType() + { + return $this->container['next_activity_type']; + } + + /** + * Sets next_activity_type + * + * @param string|null $next_activity_type The type of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityType($next_activity_type): self + { + $this->container['next_activity_type'] = $next_activity_type; + + return $this; + } + + /** + * Gets next_activity_duration + * + * @return string|null + */ + public function getNextActivityDuration() + { + return $this->container['next_activity_duration']; + } + + /** + * Sets next_activity_duration + * + * @param string|null $next_activity_duration The duration of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDuration($next_activity_duration): self + { + $this->container['next_activity_duration'] = $next_activity_duration; + + return $this; + } + + /** + * Gets next_activity_note + * + * @return string|null + */ + public function getNextActivityNote() + { + return $this->container['next_activity_note']; + } + + /** + * Sets next_activity_note + * + * @param string|null $next_activity_note The note of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityNote($next_activity_note): self + { + $this->container['next_activity_note'] = $next_activity_note; + + return $this; + } + + /** + * Gets formatted_value + * + * @return string|null + */ + public function getFormattedValue() + { + return $this->container['formatted_value']; + } + + /** + * Sets formatted_value + * + * @param string|null $formatted_value The deal value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedValue($formatted_value): self + { + $this->container['formatted_value'] = $formatted_value; + + return $this; + } + + /** + * Gets weighted_value + * + * @return float|null + */ + public function getWeightedValue() + { + return $this->container['weighted_value']; + } + + /** + * Sets weighted_value + * + * @param float|null $weighted_value Probability times deal value. Probability can either be deal probability or if not set, then stage probability. + * + * @return self + */ + public function setWeightedValue($weighted_value): self + { + $this->container['weighted_value'] = $weighted_value; + + return $this; + } + + /** + * Gets formatted_weighted_value + * + * @return string|null + */ + public function getFormattedWeightedValue() + { + return $this->container['formatted_weighted_value']; + } + + /** + * Sets formatted_weighted_value + * + * @param string|null $formatted_weighted_value The weighted_value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedWeightedValue($formatted_weighted_value): self + { + $this->container['formatted_weighted_value'] = $formatted_weighted_value; + + return $this; + } + + /** + * Gets weighted_value_currency + * + * @return string|null + */ + public function getWeightedValueCurrency() + { + return $this->container['weighted_value_currency']; + } + + /** + * Sets weighted_value_currency + * + * @param string|null $weighted_value_currency The currency associated with the deal + * + * @return self + */ + public function setWeightedValueCurrency($weighted_value_currency): self + { + $this->container['weighted_value_currency'] = $weighted_value_currency; + + return $this; + } + + /** + * Gets rotten_time + * + * @return string|null + */ + public function getRottenTime() + { + return $this->container['rotten_time']; + } + + /** + * Sets rotten_time + * + * @param string|null $rotten_time The date and time of changing the deal status as rotten + * + * @return self + */ + public function setRottenTime($rotten_time): self + { + $this->container['rotten_time'] = $rotten_time; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the deal owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets org_hidden + * + * @return bool|null + */ + public function getOrgHidden() + { + return $this->container['org_hidden']; + } + + /** + * Sets org_hidden + * + * @param bool|null $org_hidden If the organization that is associated with the deal is hidden or not + * + * @return self + */ + public function setOrgHidden($org_hidden): self + { + $this->container['org_hidden'] = $org_hidden; + + return $this; + } + + /** + * Gets person_hidden + * + * @return bool|null + */ + public function getPersonHidden() + { + return $this->container['person_hidden']; + } + + /** + * Sets person_hidden + * + * @param bool|null $person_hidden If the person that is associated with the deal is hidden or not + * + * @return self + */ + public function setPersonHidden($person_hidden): self + { + $this->container['person_hidden'] = $person_hidden; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealStrictModeFields.php b/lib/Model/DealStrictModeFields.php new file mode 100644 index 00000000..b414c40a --- /dev/null +++ b/lib/Model/DealStrictModeFields.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealStrictModeFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealStrictModeFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => 'int', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return int|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param int|null $creator_user_id The ID of the deal creator + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person associated with the deal + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization associated with the deal + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealStrictWithMergeId.php b/lib/Model/DealStrictWithMergeId.php new file mode 100644 index 00000000..381af543 --- /dev/null +++ b/lib/Model/DealStrictWithMergeId.php @@ -0,0 +1,2052 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealStrictWithMergeId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealStrictWithMergeId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'creator_user_id' => 'int', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'stage_change_time' => 'string', + 'active' => 'bool', + 'deleted' => 'bool', + 'status' => 'string', + 'probability' => 'float', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'first_won_time' => 'string', + 'lost_time' => 'string', + 'products_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'participants_count' => 'int', + 'expected_close_date' => '\DateTime', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'label' => 'string', + 'stage_order_nr' => 'int', + 'person_name' => 'string', + 'org_name' => 'string', + 'next_activity_subject' => 'string', + 'next_activity_type' => 'string', + 'next_activity_duration' => 'string', + 'next_activity_note' => 'string', + 'formatted_value' => 'string', + 'weighted_value' => 'float', + 'formatted_weighted_value' => 'string', + 'weighted_value_currency' => 'string', + 'rotten_time' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'org_hidden' => 'bool', + 'person_hidden' => 'bool', + 'merge_what_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'update_time' => null, + 'stage_change_time' => null, + 'active' => null, + 'deleted' => null, + 'status' => null, + 'probability' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'first_won_time' => null, + 'lost_time' => null, + 'products_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'participants_count' => null, + 'expected_close_date' => 'date', + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'label' => null, + 'stage_order_nr' => null, + 'person_name' => null, + 'org_name' => null, + 'next_activity_subject' => null, + 'next_activity_type' => null, + 'next_activity_duration' => null, + 'next_activity_note' => null, + 'formatted_value' => null, + 'weighted_value' => null, + 'formatted_weighted_value' => null, + 'weighted_value_currency' => null, + 'rotten_time' => null, + 'owner_name' => null, + 'cc_email' => null, + 'org_hidden' => null, + 'person_hidden' => null, + 'merge_what_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'stage_change_time' => 'stage_change_time', + 'active' => 'active', + 'deleted' => 'deleted', + 'status' => 'status', + 'probability' => 'probability', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'first_won_time' => 'first_won_time', + 'lost_time' => 'lost_time', + 'products_count' => 'products_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'participants_count' => 'participants_count', + 'expected_close_date' => 'expected_close_date', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'label' => 'label', + 'stage_order_nr' => 'stage_order_nr', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'next_activity_subject' => 'next_activity_subject', + 'next_activity_type' => 'next_activity_type', + 'next_activity_duration' => 'next_activity_duration', + 'next_activity_note' => 'next_activity_note', + 'formatted_value' => 'formatted_value', + 'weighted_value' => 'weighted_value', + 'formatted_weighted_value' => 'formatted_weighted_value', + 'weighted_value_currency' => 'weighted_value_currency', + 'rotten_time' => 'rotten_time', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'org_hidden' => 'org_hidden', + 'person_hidden' => 'person_hidden', + 'merge_what_id' => 'merge_what_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'stage_change_time' => 'setStageChangeTime', + 'active' => 'setActive', + 'deleted' => 'setDeleted', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'first_won_time' => 'setFirstWonTime', + 'lost_time' => 'setLostTime', + 'products_count' => 'setProductsCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'participants_count' => 'setParticipantsCount', + 'expected_close_date' => 'setExpectedCloseDate', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'label' => 'setLabel', + 'stage_order_nr' => 'setStageOrderNr', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'next_activity_subject' => 'setNextActivitySubject', + 'next_activity_type' => 'setNextActivityType', + 'next_activity_duration' => 'setNextActivityDuration', + 'next_activity_note' => 'setNextActivityNote', + 'formatted_value' => 'setFormattedValue', + 'weighted_value' => 'setWeightedValue', + 'formatted_weighted_value' => 'setFormattedWeightedValue', + 'weighted_value_currency' => 'setWeightedValueCurrency', + 'rotten_time' => 'setRottenTime', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'org_hidden' => 'setOrgHidden', + 'person_hidden' => 'setPersonHidden', + 'merge_what_id' => 'setMergeWhatId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'stage_change_time' => 'getStageChangeTime', + 'active' => 'getActive', + 'deleted' => 'getDeleted', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'first_won_time' => 'getFirstWonTime', + 'lost_time' => 'getLostTime', + 'products_count' => 'getProductsCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'participants_count' => 'getParticipantsCount', + 'expected_close_date' => 'getExpectedCloseDate', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'label' => 'getLabel', + 'stage_order_nr' => 'getStageOrderNr', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'next_activity_subject' => 'getNextActivitySubject', + 'next_activity_type' => 'getNextActivityType', + 'next_activity_duration' => 'getNextActivityDuration', + 'next_activity_note' => 'getNextActivityNote', + 'formatted_value' => 'getFormattedValue', + 'weighted_value' => 'getWeightedValue', + 'formatted_weighted_value' => 'getFormattedWeightedValue', + 'weighted_value_currency' => 'getWeightedValueCurrency', + 'rotten_time' => 'getRottenTime', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'org_hidden' => 'getOrgHidden', + 'person_hidden' => 'getPersonHidden', + 'merge_what_id' => 'getMergeWhatId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deleted'] = $data['deleted'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['first_won_time'] = $data['first_won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['products_count'] = $data['products_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['participants_count'] = $data['participants_count'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['stage_order_nr'] = $data['stage_order_nr'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['next_activity_subject'] = $data['next_activity_subject'] ?? null; + $this->container['next_activity_type'] = $data['next_activity_type'] ?? null; + $this->container['next_activity_duration'] = $data['next_activity_duration'] ?? null; + $this->container['next_activity_note'] = $data['next_activity_note'] ?? null; + $this->container['formatted_value'] = $data['formatted_value'] ?? null; + $this->container['weighted_value'] = $data['weighted_value'] ?? null; + $this->container['formatted_weighted_value'] = $data['formatted_weighted_value'] ?? null; + $this->container['weighted_value_currency'] = $data['weighted_value_currency'] ?? null; + $this->container['rotten_time'] = $data['rotten_time'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['org_hidden'] = $data['org_hidden'] ?? null; + $this->container['person_hidden'] = $data['person_hidden'] ?? null; + $this->container['merge_what_id'] = $data['merge_what_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return int|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param int|null $creator_user_id The ID of the deal creator + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person associated with the deal + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization associated with the deal + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets stage_change_time + * + * @return string|null + */ + public function getStageChangeTime() + { + return $this->container['stage_change_time']; + } + + /** + * Sets stage_change_time + * + * @param string|null $stage_change_time The last updated date and time of the deal stage + * + * @return self + */ + public function setStageChangeTime($stage_change_time): self + { + $this->container['stage_change_time'] = $stage_change_time; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether the deal is active or not + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deleted + * + * @return bool|null + */ + public function getDeleted() + { + return $this->container['deleted']; + } + + /** + * Sets deleted + * + * @param bool|null $deleted Whether the deal is deleted or not + * + * @return self + */ + public function setDeleted($deleted): self + { + $this->container['deleted'] = $deleted; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status as won + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets first_won_time + * + * @return string|null + */ + public function getFirstWonTime() + { + return $this->container['first_won_time']; + } + + /** + * Sets first_won_time + * + * @param string|null $first_won_time The date and time of the first time changing the deal status as won + * + * @return self + */ + public function setFirstWonTime($first_won_time): self + { + $this->container['first_won_time'] = $first_won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status as lost + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets products_count + * + * @return int|null + */ + public function getProductsCount() + { + return $this->container['products_count']; + } + + /** + * Sets products_count + * + * @param int|null $products_count The number of products associated with the deal + * + * @return self + */ + public function setProductsCount($products_count): self + { + $this->container['products_count'] = $products_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The number of files associated with the deal + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The number of notes associated with the deal + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The number of followers associated with the deal + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The number of emails associated with the deal + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The number of activities associated with the deal + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The number of completed activities associated with the deal + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The number of incomplete activities associated with the deal + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets participants_count + * + * @return int|null + */ + public function getParticipantsCount() + { + return $this->container['participants_count']; + } + + /** + * Sets participants_count + * + * @param int|null $participants_count The number of participants associated with the deal + * + * @return self + */ + public function setParticipantsCount($participants_count): self + { + $this->container['participants_count'] = $participants_count; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the deal + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the deal + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets stage_order_nr + * + * @return int|null + */ + public function getStageOrderNr() + { + return $this->container['stage_order_nr']; + } + + /** + * Sets stage_order_nr + * + * @param int|null $stage_order_nr The order number of the deal stage associated with the deal + * + * @return self + */ + public function setStageOrderNr($stage_order_nr): self + { + $this->container['stage_order_nr'] = $stage_order_nr; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the deal + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the deal + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets next_activity_subject + * + * @return string|null + */ + public function getNextActivitySubject() + { + return $this->container['next_activity_subject']; + } + + /** + * Sets next_activity_subject + * + * @param string|null $next_activity_subject The subject of the next activity associated with the deal + * + * @return self + */ + public function setNextActivitySubject($next_activity_subject): self + { + $this->container['next_activity_subject'] = $next_activity_subject; + + return $this; + } + + /** + * Gets next_activity_type + * + * @return string|null + */ + public function getNextActivityType() + { + return $this->container['next_activity_type']; + } + + /** + * Sets next_activity_type + * + * @param string|null $next_activity_type The type of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityType($next_activity_type): self + { + $this->container['next_activity_type'] = $next_activity_type; + + return $this; + } + + /** + * Gets next_activity_duration + * + * @return string|null + */ + public function getNextActivityDuration() + { + return $this->container['next_activity_duration']; + } + + /** + * Sets next_activity_duration + * + * @param string|null $next_activity_duration The duration of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDuration($next_activity_duration): self + { + $this->container['next_activity_duration'] = $next_activity_duration; + + return $this; + } + + /** + * Gets next_activity_note + * + * @return string|null + */ + public function getNextActivityNote() + { + return $this->container['next_activity_note']; + } + + /** + * Sets next_activity_note + * + * @param string|null $next_activity_note The note of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityNote($next_activity_note): self + { + $this->container['next_activity_note'] = $next_activity_note; + + return $this; + } + + /** + * Gets formatted_value + * + * @return string|null + */ + public function getFormattedValue() + { + return $this->container['formatted_value']; + } + + /** + * Sets formatted_value + * + * @param string|null $formatted_value The deal value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedValue($formatted_value): self + { + $this->container['formatted_value'] = $formatted_value; + + return $this; + } + + /** + * Gets weighted_value + * + * @return float|null + */ + public function getWeightedValue() + { + return $this->container['weighted_value']; + } + + /** + * Sets weighted_value + * + * @param float|null $weighted_value Probability times deal value. Probability can either be deal probability or if not set, then stage probability. + * + * @return self + */ + public function setWeightedValue($weighted_value): self + { + $this->container['weighted_value'] = $weighted_value; + + return $this; + } + + /** + * Gets formatted_weighted_value + * + * @return string|null + */ + public function getFormattedWeightedValue() + { + return $this->container['formatted_weighted_value']; + } + + /** + * Sets formatted_weighted_value + * + * @param string|null $formatted_weighted_value The weighted_value formatted with selected currency. E.g. US$500 + * + * @return self + */ + public function setFormattedWeightedValue($formatted_weighted_value): self + { + $this->container['formatted_weighted_value'] = $formatted_weighted_value; + + return $this; + } + + /** + * Gets weighted_value_currency + * + * @return string|null + */ + public function getWeightedValueCurrency() + { + return $this->container['weighted_value_currency']; + } + + /** + * Sets weighted_value_currency + * + * @param string|null $weighted_value_currency The currency associated with the deal + * + * @return self + */ + public function setWeightedValueCurrency($weighted_value_currency): self + { + $this->container['weighted_value_currency'] = $weighted_value_currency; + + return $this; + } + + /** + * Gets rotten_time + * + * @return string|null + */ + public function getRottenTime() + { + return $this->container['rotten_time']; + } + + /** + * Sets rotten_time + * + * @param string|null $rotten_time The date and time of changing the deal status as rotten + * + * @return self + */ + public function setRottenTime($rotten_time): self + { + $this->container['rotten_time'] = $rotten_time; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the deal owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the deal + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets org_hidden + * + * @return bool|null + */ + public function getOrgHidden() + { + return $this->container['org_hidden']; + } + + /** + * Sets org_hidden + * + * @param bool|null $org_hidden If the organization that is associated with the deal is hidden or not + * + * @return self + */ + public function setOrgHidden($org_hidden): self + { + $this->container['org_hidden'] = $org_hidden; + + return $this; + } + + /** + * Gets person_hidden + * + * @return bool|null + */ + public function getPersonHidden() + { + return $this->container['person_hidden']; + } + + /** + * Sets person_hidden + * + * @param bool|null $person_hidden If the person that is associated with the deal is hidden or not + * + * @return self + */ + public function setPersonHidden($person_hidden): self + { + $this->container['person_hidden'] = $person_hidden; + + return $this; + } + + /** + * Gets merge_what_id + * + * @return int|null + */ + public function getMergeWhatId() + { + return $this->container['merge_what_id']; + } + + /** + * Sets merge_what_id + * + * @param int|null $merge_what_id The deal ID of the deal which the original deal was merged with + * + * @return self + */ + public function setMergeWhatId($merge_what_id): self + { + $this->container['merge_what_id'] = $merge_what_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealStrictWithMergeIdAllOf.php b/lib/Model/DealStrictWithMergeIdAllOf.php new file mode 100644 index 00000000..3b28576d --- /dev/null +++ b/lib/Model/DealStrictWithMergeIdAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealStrictWithMergeIdAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealStrictWithMergeId_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'merge_what_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merge_what_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merge_what_id' => 'merge_what_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merge_what_id' => 'setMergeWhatId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merge_what_id' => 'getMergeWhatId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['merge_what_id'] = $data['merge_what_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merge_what_id + * + * @return int|null + */ + public function getMergeWhatId() + { + return $this->container['merge_what_id']; + } + + /** + * Sets merge_what_id + * + * @param int|null $merge_what_id The deal ID of the deal which the original deal was merged with + * + * @return self + */ + public function setMergeWhatId($merge_what_id): self + { + $this->container['merge_what_id'] = $merge_what_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummary.php b/lib/Model/DealSummary.php new file mode 100644 index 00000000..7292860e --- /dev/null +++ b/lib/Model/DealSummary.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'per_stages' => '\Pipedrive\Model\DealSummaryPerStages', + 'per_currency' => '\Pipedrive\Model\DealSummaryPerCurrency', + 'total_count' => 'int', + 'per_currency_full' => '\Pipedrive\Model\DealSummaryPerCurrencyFull' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'per_stages' => null, + 'per_currency' => null, + 'total_count' => null, + 'per_currency_full' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'per_stages' => 'per_stages', + 'per_currency' => 'per_currency', + 'total_count' => 'total_count', + 'per_currency_full' => 'per_currency_full' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'per_stages' => 'setPerStages', + 'per_currency' => 'setPerCurrency', + 'total_count' => 'setTotalCount', + 'per_currency_full' => 'setPerCurrencyFull' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'per_stages' => 'getPerStages', + 'per_currency' => 'getPerCurrency', + 'total_count' => 'getTotalCount', + 'per_currency_full' => 'getPerCurrencyFull' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['per_stages'] = $data['per_stages'] ?? null; + $this->container['per_currency'] = $data['per_currency'] ?? null; + $this->container['total_count'] = $data['total_count'] ?? null; + $this->container['per_currency_full'] = $data['per_currency_full'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets per_stages + * + * @return \Pipedrive\Model\DealSummaryPerStages|null + */ + public function getPerStages() + { + return $this->container['per_stages']; + } + + /** + * Sets per_stages + * + * @param \Pipedrive\Model\DealSummaryPerStages|null $per_stages per_stages + * + * @return self + */ + public function setPerStages($per_stages): self + { + $this->container['per_stages'] = $per_stages; + + return $this; + } + + /** + * Gets per_currency + * + * @return \Pipedrive\Model\DealSummaryPerCurrency|null + */ + public function getPerCurrency() + { + return $this->container['per_currency']; + } + + /** + * Sets per_currency + * + * @param \Pipedrive\Model\DealSummaryPerCurrency|null $per_currency per_currency + * + * @return self + */ + public function setPerCurrency($per_currency): self + { + $this->container['per_currency'] = $per_currency; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count Deals count + * + * @return self + */ + public function setTotalCount($total_count): self + { + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets per_currency_full + * + * @return \Pipedrive\Model\DealSummaryPerCurrencyFull|null + */ + public function getPerCurrencyFull() + { + return $this->container['per_currency_full']; + } + + /** + * Sets per_currency_full + * + * @param \Pipedrive\Model\DealSummaryPerCurrencyFull|null $per_currency_full per_currency_full + * + * @return self + */ + public function setPerCurrencyFull($per_currency_full): self + { + $this->container['per_currency_full'] = $per_currency_full; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummaryPerCurrency.php b/lib/Model/DealSummaryPerCurrency.php new file mode 100644 index 00000000..ff57cbfd --- /dev/null +++ b/lib/Model/DealSummaryPerCurrency.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummaryPerCurrency implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary_per_currency'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'currency_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_id' => 'CURRENCY_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_id' => 'setCurrencyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_id' => 'getCurrencyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_id'] = $data['currency_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_id + * + * @return int|null + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param int|null $currency_id Deals count per currency. This parameter is dynamic and changes according to `currency_id` value. + * + * @return self + */ + public function setCurrencyId($currency_id): self + { + $this->container['currency_id'] = $currency_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummaryPerCurrencyFull.php b/lib/Model/DealSummaryPerCurrencyFull.php new file mode 100644 index 00000000..17b24b94 --- /dev/null +++ b/lib/Model/DealSummaryPerCurrencyFull.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummaryPerCurrencyFull implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary_per_currency_full'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'currency_id' => '\Pipedrive\Model\DealSummaryPerCurrencyFullCURRENCYID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_id' => 'CURRENCY_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_id' => 'setCurrencyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_id' => 'getCurrencyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_id'] = $data['currency_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_id + * + * @return \Pipedrive\Model\DealSummaryPerCurrencyFullCURRENCYID|null + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param \Pipedrive\Model\DealSummaryPerCurrencyFullCURRENCYID|null $currency_id currency_id + * + * @return self + */ + public function setCurrencyId($currency_id): self + { + $this->container['currency_id'] = $currency_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummaryPerCurrencyFullCURRENCYID.php b/lib/Model/DealSummaryPerCurrencyFullCURRENCYID.php new file mode 100644 index 00000000..80a31b8b --- /dev/null +++ b/lib/Model/DealSummaryPerCurrencyFullCURRENCYID.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummaryPerCurrencyFullCURRENCYID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary_per_currency_full_CURRENCY_ID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'count' => 'int', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count Deals count per currency + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value Deals value per currency + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummaryPerStages.php b/lib/Model/DealSummaryPerStages.php new file mode 100644 index 00000000..9e09c6ea --- /dev/null +++ b/lib/Model/DealSummaryPerStages.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummaryPerStages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary_per_stages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'stage_id' => '\Pipedrive\Model\DealSummaryPerStagesSTAGEID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'stage_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'stage_id' => 'STAGE_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'stage_id' => 'setStageId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'stage_id' => 'getStageId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['stage_id'] = $data['stage_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets stage_id + * + * @return \Pipedrive\Model\DealSummaryPerStagesSTAGEID|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param \Pipedrive\Model\DealSummaryPerStagesSTAGEID|null $stage_id stage_id + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummaryPerStagesSTAGEID.php b/lib/Model/DealSummaryPerStagesSTAGEID.php new file mode 100644 index 00000000..5053db9b --- /dev/null +++ b/lib/Model/DealSummaryPerStagesSTAGEID.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummaryPerStagesSTAGEID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary_per_stages_STAGE_ID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'currency_id' => '\Pipedrive\Model\DealSummaryPerStagesSTAGEIDCURRENCYID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_id' => 'CURRENCY_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_id' => 'setCurrencyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_id' => 'getCurrencyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_id'] = $data['currency_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_id + * + * @return \Pipedrive\Model\DealSummaryPerStagesSTAGEIDCURRENCYID|null + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param \Pipedrive\Model\DealSummaryPerStagesSTAGEIDCURRENCYID|null $currency_id currency_id + * + * @return self + */ + public function setCurrencyId($currency_id): self + { + $this->container['currency_id'] = $currency_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.php b/lib/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.php new file mode 100644 index 00000000..ec33f7ee --- /dev/null +++ b/lib/Model/DealSummaryPerStagesSTAGEIDCURRENCYID.php @@ -0,0 +1,463 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealSummaryPerStagesSTAGEIDCURRENCYID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealSummary_per_stages_STAGE_ID_CURRENCY_ID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'count' => 'int', + 'value' => 'int', + 'value_formatted' => 'string', + 'weighted_value' => 'int', + 'weighted_value_formatted' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'value' => null, + 'value_formatted' => null, + 'weighted_value' => null, + 'weighted_value_formatted' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'value' => 'value', + 'value_formatted' => 'value_formatted', + 'weighted_value' => 'weighted_value', + 'weighted_value_formatted' => 'weighted_value_formatted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'value' => 'setValue', + 'value_formatted' => 'setValueFormatted', + 'weighted_value' => 'setWeightedValue', + 'weighted_value_formatted' => 'setWeightedValueFormatted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'value' => 'getValue', + 'value_formatted' => 'getValueFormatted', + 'weighted_value' => 'getWeightedValue', + 'weighted_value_formatted' => 'getWeightedValueFormatted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['value_formatted'] = $data['value_formatted'] ?? null; + $this->container['weighted_value'] = $data['weighted_value'] ?? null; + $this->container['weighted_value_formatted'] = $data['weighted_value_formatted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count Deals count per currency + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value Deals value per currency + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets value_formatted + * + * @return string|null + */ + public function getValueFormatted() + { + return $this->container['value_formatted']; + } + + /** + * Sets value_formatted + * + * @param string|null $value_formatted Deals value formatted per currency + * + * @return self + */ + public function setValueFormatted($value_formatted): self + { + $this->container['value_formatted'] = $value_formatted; + + return $this; + } + + /** + * Gets weighted_value + * + * @return int|null + */ + public function getWeightedValue() + { + return $this->container['weighted_value']; + } + + /** + * Sets weighted_value + * + * @param int|null $weighted_value Deals weighted value per currency + * + * @return self + */ + public function setWeightedValue($weighted_value): self + { + $this->container['weighted_value'] = $weighted_value; + + return $this; + } + + /** + * Gets weighted_value_formatted + * + * @return string|null + */ + public function getWeightedValueFormatted() + { + return $this->container['weighted_value_formatted']; + } + + /** + * Sets weighted_value_formatted + * + * @param string|null $weighted_value_formatted Deals weighted value formatted per currency + * + * @return self + */ + public function setWeightedValueFormatted($weighted_value_formatted): self + { + $this->container['weighted_value_formatted'] = $weighted_value_formatted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealTitleParameter.php b/lib/Model/DealTitleParameter.php new file mode 100644 index 00000000..227f4683 --- /dev/null +++ b/lib/Model/DealTitleParameter.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealTitleParameter implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealTitleParameter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealUserData.php b/lib/Model/DealUserData.php new file mode 100644 index 00000000..922a5a38 --- /dev/null +++ b/lib/Model/DealUserData.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealUserData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealUserData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'has_pic' => 'bool', + 'pic_hash' => 'string', + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'has_pic' => null, + 'pic_hash' => null, + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'has_pic' => 'has_pic', + 'pic_hash' => 'pic_hash', + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'has_pic' => 'setHasPic', + 'pic_hash' => 'setPicHash', + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'has_pic' => 'getHasPic', + 'pic_hash' => 'getPicHash', + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['has_pic'] = $data['has_pic'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the user + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the user + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets has_pic + * + * @return bool|null + */ + public function getHasPic() + { + return $this->container['has_pic']; + } + + /** + * Sets has_pic + * + * @param bool|null $has_pic If the user has a picture or not + * + * @return self + */ + public function setHasPic($has_pic): self + { + $this->container['has_pic'] = $has_pic; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The user picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealUserDataWithId.php b/lib/Model/DealUserDataWithId.php new file mode 100644 index 00000000..e8fabc7e --- /dev/null +++ b/lib/Model/DealUserDataWithId.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealUserDataWithId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealUserDataWithId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'has_pic' => 'bool', + 'pic_hash' => 'string', + 'active_flag' => 'bool', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'has_pic' => null, + 'pic_hash' => null, + 'active_flag' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'has_pic' => 'has_pic', + 'pic_hash' => 'pic_hash', + 'active_flag' => 'active_flag', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'has_pic' => 'setHasPic', + 'pic_hash' => 'setPicHash', + 'active_flag' => 'setActiveFlag', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'has_pic' => 'getHasPic', + 'pic_hash' => 'getPicHash', + 'active_flag' => 'getActiveFlag', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['has_pic'] = $data['has_pic'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the user + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the user + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets has_pic + * + * @return bool|null + */ + public function getHasPic() + { + return $this->container['has_pic']; + } + + /** + * Sets has_pic + * + * @param bool|null $has_pic If the user has a picture or not + * + * @return self + */ + public function setHasPic($has_pic): self + { + $this->container['has_pic'] = $has_pic; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The user picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the user + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealUserDataWithIdAllOf.php b/lib/Model/DealUserDataWithIdAllOf.php new file mode 100644 index 00000000..c94e0577 --- /dev/null +++ b/lib/Model/DealUserDataWithIdAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealUserDataWithIdAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealUserDataWithId_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the user + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealsCountAndActivityInfo.php b/lib/Model/DealsCountAndActivityInfo.php new file mode 100644 index 00000000..994e570b --- /dev/null +++ b/lib/Model/DealsCountAndActivityInfo.php @@ -0,0 +1,702 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealsCountAndActivityInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealsCountAndActivityInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealsCountInfo.php b/lib/Model/DealsCountInfo.php new file mode 100644 index 00000000..d8b4a9df --- /dev/null +++ b/lib/Model/DealsCountInfo.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealsCountInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealsCountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealsMovementsInfo.php b/lib/Model/DealsMovementsInfo.php new file mode 100644 index 00000000..cb4ed0bd --- /dev/null +++ b/lib/Model/DealsMovementsInfo.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealsMovementsInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealsMovementsInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'count' => 'int', + 'deals_ids' => 'int[]', + 'values' => '\Pipedrive\Model\DealsMovementsInfoValues', + 'formatted_values' => '\Pipedrive\Model\DealsMovementsInfoFormattedValues' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'deals_ids' => null, + 'values' => null, + 'formatted_values' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'deals_ids' => 'deals_ids', + 'values' => 'values', + 'formatted_values' => 'formatted_values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'deals_ids' => 'setDealsIds', + 'values' => 'setValues', + 'formatted_values' => 'setFormattedValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'deals_ids' => 'getDealsIds', + 'values' => 'getValues', + 'formatted_values' => 'getFormattedValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['deals_ids'] = $data['deals_ids'] ?? null; + $this->container['values'] = $data['values'] ?? null; + $this->container['formatted_values'] = $data['formatted_values'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The count of the deals + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets deals_ids + * + * @return int[]|null + */ + public function getDealsIds() + { + return $this->container['deals_ids']; + } + + /** + * Sets deals_ids + * + * @param int[]|null $deals_ids The IDs of the deals that have been moved + * + * @return self + */ + public function setDealsIds($deals_ids): self + { + $this->container['deals_ids'] = $deals_ids; + + return $this; + } + + /** + * Gets values + * + * @return \Pipedrive\Model\DealsMovementsInfoValues|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Pipedrive\Model\DealsMovementsInfoValues|null $values values + * + * @return self + */ + public function setValues($values): self + { + $this->container['values'] = $values; + + return $this; + } + + /** + * Gets formatted_values + * + * @return \Pipedrive\Model\DealsMovementsInfoFormattedValues|null + */ + public function getFormattedValues() + { + return $this->container['formatted_values']; + } + + /** + * Sets formatted_values + * + * @param \Pipedrive\Model\DealsMovementsInfoFormattedValues|null $formatted_values formatted_values + * + * @return self + */ + public function setFormattedValues($formatted_values): self + { + $this->container['formatted_values'] = $formatted_values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealsMovementsInfoFormattedValues.php b/lib/Model/DealsMovementsInfoFormattedValues.php new file mode 100644 index 00000000..87c71d3f --- /dev/null +++ b/lib/Model/DealsMovementsInfoFormattedValues.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealsMovementsInfoFormattedValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealsMovementsInfo_formatted_values'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'currency_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_id' => 'CURRENCY_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_id' => 'setCurrencyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_id' => 'getCurrencyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_id'] = $data['currency_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_id + * + * @return string|null + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param string|null $currency_id The formatted values of the deals + * + * @return self + */ + public function setCurrencyId($currency_id): self + { + $this->container['currency_id'] = $currency_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DealsMovementsInfoValues.php b/lib/Model/DealsMovementsInfoValues.php new file mode 100644 index 00000000..f2c087e1 --- /dev/null +++ b/lib/Model/DealsMovementsInfoValues.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DealsMovementsInfoValues implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DealsMovementsInfo_values'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'currency_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_id' => 'CURRENCY_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_id' => 'setCurrencyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_id' => 'getCurrencyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['currency_id'] = $data['currency_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_id + * + * @return int|null + */ + public function getCurrencyId() + { + return $this->container['currency_id']; + } + + /** + * Sets currency_id + * + * @param int|null $currency_id The value of the deals + * + * @return self + */ + public function setCurrencyId($currency_id): self + { + $this->container['currency_id'] = $currency_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteActivitiesResponse200.php b/lib/Model/DeleteActivitiesResponse200.php new file mode 100644 index 00000000..2a0b9462 --- /dev/null +++ b/lib/Model/DeleteActivitiesResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteActivitiesResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteActivitiesResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteActivitiesResponse200Data' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteActivitiesResponse200Data|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteActivitiesResponse200Data|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteActivitiesResponse200Data.php b/lib/Model/DeleteActivitiesResponse200Data.php new file mode 100644 index 00000000..a3db798e --- /dev/null +++ b/lib/Model/DeleteActivitiesResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteActivitiesResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteActivitiesResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id An array of the IDs of activities that were deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteActivityResponse200.php b/lib/Model/DeleteActivityResponse200.php new file mode 100644 index 00000000..e109fffe --- /dev/null +++ b/lib/Model/DeleteActivityResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteActivityResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteActivityResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteActivityResponse200Data' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteActivityResponse200Data|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteActivityResponse200Data|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteActivityResponse200Data.php b/lib/Model/DeleteActivityResponse200Data.php new file mode 100644 index 00000000..d21aed6f --- /dev/null +++ b/lib/Model/DeleteActivityResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteActivityResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteActivityResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the activity that was deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteChannelSuccess.php b/lib/Model/DeleteChannelSuccess.php new file mode 100644 index 00000000..70e36437 --- /dev/null +++ b/lib/Model/DeleteChannelSuccess.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteChannelSuccess implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteChannelSuccess'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteComment.php b/lib/Model/DeleteComment.php new file mode 100644 index 00000000..ecebcadb --- /dev/null +++ b/lib/Model/DeleteComment.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteComment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteComment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return bool|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param bool|null $data If the response is successful or not + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteConversationSuccess.php b/lib/Model/DeleteConversationSuccess.php new file mode 100644 index 00000000..3a2d2d09 --- /dev/null +++ b/lib/Model/DeleteConversationSuccess.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteConversationSuccess implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteConversationSuccess'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDeal.php b/lib/Model/DeleteDeal.php new file mode 100644 index 00000000..09ba851f --- /dev/null +++ b/lib/Model/DeleteDeal.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteDealData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteDealData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteDealData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealData.php b/lib/Model/DeleteDealData.php new file mode 100644 index 00000000..e1787b9b --- /dev/null +++ b/lib/Model/DeleteDealData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDeal_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal that was deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealFollower.php b/lib/Model/DeleteDealFollower.php new file mode 100644 index 00000000..df825f11 --- /dev/null +++ b/lib/Model/DeleteDealFollower.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealFollower implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDealFollower'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteDealFollowerData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteDealFollowerData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteDealFollowerData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealFollowerData.php b/lib/Model/DeleteDealFollowerData.php new file mode 100644 index 00000000..21b23d33 --- /dev/null +++ b/lib/Model/DeleteDealFollowerData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealFollowerData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDealFollower_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal follower that was deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealParticipant.php b/lib/Model/DeleteDealParticipant.php new file mode 100644 index 00000000..2db2a805 --- /dev/null +++ b/lib/Model/DeleteDealParticipant.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealParticipant implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDealParticipant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteDealParticipantData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteDealParticipantData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteDealParticipantData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealParticipantData.php b/lib/Model/DeleteDealParticipantData.php new file mode 100644 index 00000000..e9cd0c0e --- /dev/null +++ b/lib/Model/DeleteDealParticipantData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealParticipantData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDealParticipant_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal participant that was deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealProduct.php b/lib/Model/DeleteDealProduct.php new file mode 100644 index 00000000..5e1a2a15 --- /dev/null +++ b/lib/Model/DeleteDealProduct.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDealProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteDealProductData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteDealProductData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteDealProductData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteDealProductData.php b/lib/Model/DeleteDealProductData.php new file mode 100644 index 00000000..e97bb705 --- /dev/null +++ b/lib/Model/DeleteDealProductData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteDealProductData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteDealProduct_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of an attached product that was deleted from the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteFile.php b/lib/Model/DeleteFile.php new file mode 100644 index 00000000..a9b0f168 --- /dev/null +++ b/lib/Model/DeleteFile.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteFile implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteFileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteFileData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteFileData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteFileData.php b/lib/Model/DeleteFileData.php new file mode 100644 index 00000000..da620ec7 --- /dev/null +++ b/lib/Model/DeleteFileData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteFileData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteFile_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the file + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteGoalResponse200.php b/lib/Model/DeleteGoalResponse200.php new file mode 100644 index 00000000..23684b56 --- /dev/null +++ b/lib/Model/DeleteGoalResponse200.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteGoalResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteGoalResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteMultipleDeals.php b/lib/Model/DeleteMultipleDeals.php new file mode 100644 index 00000000..72e85341 --- /dev/null +++ b/lib/Model/DeleteMultipleDeals.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteMultipleDeals implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteMultipleDeals'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteMultipleDealsData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteMultipleDealsData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteMultipleDealsData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteMultipleDealsData.php b/lib/Model/DeleteMultipleDealsData.php new file mode 100644 index 00000000..d6ce8199 --- /dev/null +++ b/lib/Model/DeleteMultipleDealsData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteMultipleDealsData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteMultipleDeals_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The list of deleted deals IDs + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteMultipleProductFieldsResponse.php b/lib/Model/DeleteMultipleProductFieldsResponse.php new file mode 100644 index 00000000..ef59a507 --- /dev/null +++ b/lib/Model/DeleteMultipleProductFieldsResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteMultipleProductFieldsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteMultipleProductFieldsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteMultipleProductFieldsResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteMultipleProductFieldsResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteMultipleProductFieldsResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteMultipleProductFieldsResponseData.php b/lib/Model/DeleteMultipleProductFieldsResponseData.php new file mode 100644 index 00000000..062a6e47 --- /dev/null +++ b/lib/Model/DeleteMultipleProductFieldsResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteMultipleProductFieldsResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteMultipleProductFieldsResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id Array of all the IDs of the deleted product fields + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteNote.php b/lib/Model/DeleteNote.php new file mode 100644 index 00000000..b1f92e0e --- /dev/null +++ b/lib/Model/DeleteNote.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteNote implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteNote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return bool|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param bool|null $data If the response is successful or not + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePersonResponse.php b/lib/Model/DeletePersonResponse.php new file mode 100644 index 00000000..38bbc9c5 --- /dev/null +++ b/lib/Model/DeletePersonResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePersonResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeletePersonResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeletePersonResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeletePersonResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeletePersonResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePersonResponseAllOf.php b/lib/Model/DeletePersonResponseAllOf.php new file mode 100644 index 00000000..ba9f60c3 --- /dev/null +++ b/lib/Model/DeletePersonResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePersonResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeletePersonResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DeletePersonResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DeletePersonResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeletePersonResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePersonResponseAllOfData.php b/lib/Model/DeletePersonResponseAllOfData.php new file mode 100644 index 00000000..a7d61665 --- /dev/null +++ b/lib/Model/DeletePersonResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePersonResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeletePersonResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deleted person + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePersonsInBulkResponse.php b/lib/Model/DeletePersonsInBulkResponse.php new file mode 100644 index 00000000..7fbb724e --- /dev/null +++ b/lib/Model/DeletePersonsInBulkResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePersonsInBulkResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeletePersonsInBulkResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeletePersonsInBulkResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeletePersonsInBulkResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeletePersonsInBulkResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePersonsInBulkResponseAllOf.php b/lib/Model/DeletePersonsInBulkResponseAllOf.php new file mode 100644 index 00000000..426e94fe --- /dev/null +++ b/lib/Model/DeletePersonsInBulkResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePersonsInBulkResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeletePersonsInBulkResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DeletePersonsInBulkResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DeletePersonsInBulkResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeletePersonsInBulkResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePersonsInBulkResponseAllOfData.php b/lib/Model/DeletePersonsInBulkResponseAllOfData.php new file mode 100644 index 00000000..3aed25e3 --- /dev/null +++ b/lib/Model/DeletePersonsInBulkResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePersonsInBulkResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeletePersonsInBulkResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The list of deleted persons IDs + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePipelineResponse200.php b/lib/Model/DeletePipelineResponse200.php new file mode 100644 index 00000000..b211057d --- /dev/null +++ b/lib/Model/DeletePipelineResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePipelineResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deletePipelineResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeletePipelineResponse200Data' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeletePipelineResponse200Data|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeletePipelineResponse200Data|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeletePipelineResponse200Data.php b/lib/Model/DeletePipelineResponse200Data.php new file mode 100644 index 00000000..f453cc4b --- /dev/null +++ b/lib/Model/DeletePipelineResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletePipelineResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deletePipelineResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Deleted Pipeline ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteProductFieldResponse.php b/lib/Model/DeleteProductFieldResponse.php new file mode 100644 index 00000000..baa1ce1d --- /dev/null +++ b/lib/Model/DeleteProductFieldResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteProductFieldResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteProductFieldResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteProductFieldResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteProductFieldResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteProductFieldResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteProductFieldResponseData.php b/lib/Model/DeleteProductFieldResponseData.php new file mode 100644 index 00000000..9d174fe5 --- /dev/null +++ b/lib/Model/DeleteProductFieldResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteProductFieldResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteProductFieldResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deleted product field + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteProductFollowerResponse.php b/lib/Model/DeleteProductFollowerResponse.php new file mode 100644 index 00000000..c09cf4e3 --- /dev/null +++ b/lib/Model/DeleteProductFollowerResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteProductFollowerResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteProductFollowerResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteProductFollowerResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteProductFollowerResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteProductFollowerResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteProductFollowerResponseData.php b/lib/Model/DeleteProductFollowerResponseData.php new file mode 100644 index 00000000..20602b60 --- /dev/null +++ b/lib/Model/DeleteProductFollowerResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteProductFollowerResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteProductFollowerResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the removed follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteProductResponse.php b/lib/Model/DeleteProductResponse.php new file mode 100644 index 00000000..119922c1 --- /dev/null +++ b/lib/Model/DeleteProductResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteProductResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteProductResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteProductResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteProductResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteProductResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteProductResponseData.php b/lib/Model/DeleteProductResponseData.php new file mode 100644 index 00000000..bcb38d7b --- /dev/null +++ b/lib/Model/DeleteProductResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteProductResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteProductResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the removed product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteResponse.php b/lib/Model/DeleteResponse.php new file mode 100644 index 00000000..7d9f43a4 --- /dev/null +++ b/lib/Model/DeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteResponseAllOf.php b/lib/Model/DeleteResponseAllOf.php new file mode 100644 index 00000000..7f81af7a --- /dev/null +++ b/lib/Model/DeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteResponseAllOfData.php b/lib/Model/DeleteResponseAllOfData.php new file mode 100644 index 00000000..c20bac8c --- /dev/null +++ b/lib/Model/DeleteResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the field that was deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRole.php b/lib/Model/DeleteRole.php new file mode 100644 index 00000000..4a3c5e71 --- /dev/null +++ b/lib/Model/DeleteRole.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteRoleAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteRoleAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteRoleAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRoleAllOf.php b/lib/Model/DeleteRoleAllOf.php new file mode 100644 index 00000000..4d4222ea --- /dev/null +++ b/lib/Model/DeleteRoleAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRoleAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteRole_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DeleteRoleAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteRoleAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteRoleAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRoleAllOfData.php b/lib/Model/DeleteRoleAllOfData.php new file mode 100644 index 00000000..9c33a69f --- /dev/null +++ b/lib/Model/DeleteRoleAllOfData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRoleAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteRole_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deleted role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRoleAssignment.php b/lib/Model/DeleteRoleAssignment.php new file mode 100644 index 00000000..a62a3efd --- /dev/null +++ b/lib/Model/DeleteRoleAssignment.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRoleAssignment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteRoleAssignment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteRoleAssignmentAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteRoleAssignmentAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteRoleAssignmentAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRoleAssignmentAllOf.php b/lib/Model/DeleteRoleAssignmentAllOf.php new file mode 100644 index 00000000..7f447d0f --- /dev/null +++ b/lib/Model/DeleteRoleAssignmentAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRoleAssignmentAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteRoleAssignment_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DeleteRoleAssignmentAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteRoleAssignmentAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteRoleAssignmentAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRoleAssignmentAllOfData.php b/lib/Model/DeleteRoleAssignmentAllOfData.php new file mode 100644 index 00000000..dca1d733 --- /dev/null +++ b/lib/Model/DeleteRoleAssignmentAllOfData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRoleAssignmentAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'DeleteRoleAssignment_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the role the user was removed from + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteRoleAssignmentRequest.php b/lib/Model/DeleteRoleAssignmentRequest.php new file mode 100644 index 00000000..6101dfdc --- /dev/null +++ b/lib/Model/DeleteRoleAssignmentRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteRoleAssignmentRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteRoleAssignmentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['user_id'] === null) { + $invalidProperties[] = "'user_id' 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 user_id + * + * @return int + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteStageResponse200.php b/lib/Model/DeleteStageResponse200.php new file mode 100644 index 00000000..cbada5e6 --- /dev/null +++ b/lib/Model/DeleteStageResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteStageResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteStageResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteStageResponse200Data' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteStageResponse200Data|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteStageResponse200Data|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteStageResponse200Data.php b/lib/Model/DeleteStageResponse200Data.php new file mode 100644 index 00000000..3fe7464b --- /dev/null +++ b/lib/Model/DeleteStageResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteStageResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteStageResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Deleted stage ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteStagesResponse200.php b/lib/Model/DeleteStagesResponse200.php new file mode 100644 index 00000000..7cca2a38 --- /dev/null +++ b/lib/Model/DeleteStagesResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteStagesResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteStagesResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DeleteStagesResponse200Data' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DeleteStagesResponse200Data|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DeleteStagesResponse200Data|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteStagesResponse200Data.php b/lib/Model/DeleteStagesResponse200Data.php new file mode 100644 index 00000000..6df5e42a --- /dev/null +++ b/lib/Model/DeleteStagesResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteStagesResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteStagesResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The list of deleted stage IDs + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/DeleteTeamUserRequest.php b/lib/Model/DeleteTeamUserRequest.php new file mode 100644 index 00000000..1b15c4a1 --- /dev/null +++ b/lib/Model/DeleteTeamUserRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteTeamUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'deleteTeamUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'users' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'users' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'users' => 'users' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'users' => 'setUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'users' => 'getUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['users'] = $data['users'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' 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 users + * + * @return int[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param int[] $users The list of user IDs + * + * @return self + */ + public function setUsers($users): self + { + $this->container['users'] = $users; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Duration.php b/lib/Model/Duration.php new file mode 100644 index 00000000..49848952 --- /dev/null +++ b/lib/Model/Duration.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Duration implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Duration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'start' => 'string', + 'end' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'start' => null, + 'end' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'start' => 'start', + 'end' => 'end' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'end' => 'setEnd' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'end' => 'getEnd' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start'] = $data['start'] ?? null; + $this->container['end'] = $data['end'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets start + * + * @return string|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param string|null $start The start date of the goal + * + * @return self + */ + public function setStart($start): self + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets end + * + * @return string|null + */ + public function getEnd() + { + return $this->container['end']; + } + + /** + * Sets end + * + * @param string|null $end The end date of the goal + * + * @return self + */ + public function setEnd($end): self + { + $this->container['end'] = $end; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/EditPipeline.php b/lib/Model/EditPipeline.php new file mode 100644 index 00000000..e6fa23aa --- /dev/null +++ b/lib/Model/EditPipeline.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class EditPipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EditPipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'BasePipelineWithSelectedFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return BasePipelineWithSelectedFlag|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param BasePipelineWithSelectedFlag|null $data The pipeline object + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/EditPipelineAllOf.php b/lib/Model/EditPipelineAllOf.php new file mode 100644 index 00000000..97f13ac3 --- /dev/null +++ b/lib/Model/EditPipelineAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class EditPipelineAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EditPipeline_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => 'BasePipelineWithSelectedFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return BasePipelineWithSelectedFlag|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param BasePipelineWithSelectedFlag|null $data The pipeline object + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/EmailInfo.php b/lib/Model/EmailInfo.php new file mode 100644 index 00000000..98dfdc9c --- /dev/null +++ b/lib/Model/EmailInfo.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class EmailInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'EmailInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ExpectedOutcome.php b/lib/Model/ExpectedOutcome.php new file mode 100644 index 00000000..9f617a75 --- /dev/null +++ b/lib/Model/ExpectedOutcome.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ExpectedOutcome implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ExpectedOutcome'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'target' => 'int', + 'tracking_metric' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'target' => null, + 'tracking_metric' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'target' => 'target', + 'tracking_metric' => 'tracking_metric' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'target' => 'setTarget', + 'tracking_metric' => 'setTrackingMetric' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'target' => 'getTarget', + 'tracking_metric' => 'getTrackingMetric' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['target'] = $data['target'] ?? null; + $this->container['tracking_metric'] = $data['tracking_metric'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets target + * + * @return int|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param int|null $target The numeric target of the goal + * + * @return self + */ + public function setTarget($target): self + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets tracking_metric + * + * @return string|null + */ + public function getTrackingMetric() + { + return $this->container['tracking_metric']; + } + + /** + * Sets tracking_metric + * + * @param string|null $tracking_metric The tracking metric of the goal + * + * @return self + */ + public function setTrackingMetric($tracking_metric): self + { + $this->container['tracking_metric'] = $tracking_metric; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FailResponse.php b/lib/Model/FailResponse.php new file mode 100644 index 00000000..70c01905 --- /dev/null +++ b/lib/Model/FailResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FailResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FailResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error message + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Field.php b/lib/Model/Field.php new file mode 100644 index 00000000..567ade25 --- /dev/null +++ b/lib/Model/Field.php @@ -0,0 +1,1002 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Field implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Field'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'key' => 'string', + 'name' => 'string', + 'order_nr' => 'int', + 'field_type' => 'FieldTypeAsString', + 'add_time' => 'string', + 'update_time' => 'string', + 'last_updated_by_user_id' => 'int', + 'active_flag' => 'bool', + 'edit_flag' => 'bool', + 'index_visible_flag' => 'bool', + 'details_visible_flag' => 'bool', + 'add_visible_flag' => 'bool', + 'important_flag' => 'bool', + 'bulk_edit_allowed' => 'bool', + 'searchable_flag' => 'bool', + 'filtering_allowed' => 'bool', + 'sortable_flag' => 'bool', + 'mandatory_flag' => 'bool', + 'options' => 'object[]', + 'options_deleted' => 'object[]', + 'is_subfield' => 'bool', + 'subfields' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'key' => null, + 'name' => null, + 'order_nr' => null, + 'field_type' => null, + 'add_time' => 'datetime', + 'update_time' => 'datetime', + 'last_updated_by_user_id' => null, + 'active_flag' => null, + 'edit_flag' => null, + 'index_visible_flag' => null, + 'details_visible_flag' => null, + 'add_visible_flag' => null, + 'important_flag' => null, + 'bulk_edit_allowed' => null, + 'searchable_flag' => null, + 'filtering_allowed' => null, + 'sortable_flag' => null, + 'mandatory_flag' => null, + 'options' => null, + 'options_deleted' => null, + 'is_subfield' => null, + 'subfields' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'name' => 'name', + 'order_nr' => 'order_nr', + 'field_type' => 'field_type', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'last_updated_by_user_id' => 'last_updated_by_user_id', + 'active_flag' => 'active_flag', + 'edit_flag' => 'edit_flag', + 'index_visible_flag' => 'index_visible_flag', + 'details_visible_flag' => 'details_visible_flag', + 'add_visible_flag' => 'add_visible_flag', + 'important_flag' => 'important_flag', + 'bulk_edit_allowed' => 'bulk_edit_allowed', + 'searchable_flag' => 'searchable_flag', + 'filtering_allowed' => 'filtering_allowed', + 'sortable_flag' => 'sortable_flag', + 'mandatory_flag' => 'mandatory_flag', + 'options' => 'options', + 'options_deleted' => 'options_deleted', + 'is_subfield' => 'is_subfield', + 'subfields' => 'subfields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'name' => 'setName', + 'order_nr' => 'setOrderNr', + 'field_type' => 'setFieldType', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'last_updated_by_user_id' => 'setLastUpdatedByUserId', + 'active_flag' => 'setActiveFlag', + 'edit_flag' => 'setEditFlag', + 'index_visible_flag' => 'setIndexVisibleFlag', + 'details_visible_flag' => 'setDetailsVisibleFlag', + 'add_visible_flag' => 'setAddVisibleFlag', + 'important_flag' => 'setImportantFlag', + 'bulk_edit_allowed' => 'setBulkEditAllowed', + 'searchable_flag' => 'setSearchableFlag', + 'filtering_allowed' => 'setFilteringAllowed', + 'sortable_flag' => 'setSortableFlag', + 'mandatory_flag' => 'setMandatoryFlag', + 'options' => 'setOptions', + 'options_deleted' => 'setOptionsDeleted', + 'is_subfield' => 'setIsSubfield', + 'subfields' => 'setSubfields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'name' => 'getName', + 'order_nr' => 'getOrderNr', + 'field_type' => 'getFieldType', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'last_updated_by_user_id' => 'getLastUpdatedByUserId', + 'active_flag' => 'getActiveFlag', + 'edit_flag' => 'getEditFlag', + 'index_visible_flag' => 'getIndexVisibleFlag', + 'details_visible_flag' => 'getDetailsVisibleFlag', + 'add_visible_flag' => 'getAddVisibleFlag', + 'important_flag' => 'getImportantFlag', + 'bulk_edit_allowed' => 'getBulkEditAllowed', + 'searchable_flag' => 'getSearchableFlag', + 'filtering_allowed' => 'getFilteringAllowed', + 'sortable_flag' => 'getSortableFlag', + 'mandatory_flag' => 'getMandatoryFlag', + 'options' => 'getOptions', + 'options_deleted' => 'getOptionsDeleted', + 'is_subfield' => 'getIsSubfield', + 'subfields' => 'getSubfields' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['key'] = $data['key'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['field_type'] = $data['field_type'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['last_updated_by_user_id'] = $data['last_updated_by_user_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['edit_flag'] = $data['edit_flag'] ?? null; + $this->container['index_visible_flag'] = $data['index_visible_flag'] ?? null; + $this->container['details_visible_flag'] = $data['details_visible_flag'] ?? null; + $this->container['add_visible_flag'] = $data['add_visible_flag'] ?? null; + $this->container['important_flag'] = $data['important_flag'] ?? null; + $this->container['bulk_edit_allowed'] = $data['bulk_edit_allowed'] ?? null; + $this->container['searchable_flag'] = $data['searchable_flag'] ?? null; + $this->container['filtering_allowed'] = $data['filtering_allowed'] ?? null; + $this->container['sortable_flag'] = $data['sortable_flag'] ?? null; + $this->container['mandatory_flag'] = $data['mandatory_flag'] ?? null; + $this->container['options'] = $data['options'] ?? null; + $this->container['options_deleted'] = $data['options_deleted'] ?? null; + $this->container['is_subfield'] = $data['is_subfield'] ?? null; + $this->container['subfields'] = $data['subfields'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the field. Value is `null` in case of subfields. + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key of the field. For custom fields this is generated upon creation. + * + * @return self + */ + public function setKey($key): self + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr The order number of the field + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets field_type + * + * @return FieldTypeAsString|null + */ + public function getFieldType() + { + return $this->container['field_type']; + } + + /** + * Sets field_type + * + * @param FieldTypeAsString|null $field_type field_type + * + * @return self + */ + public function setFieldType($field_type): self + { + $this->container['field_type'] = $field_type; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation time of the field + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the field + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets last_updated_by_user_id + * + * @return int|null + */ + public function getLastUpdatedByUserId() + { + return $this->container['last_updated_by_user_id']; + } + + /** + * Sets last_updated_by_user_id + * + * @param int|null $last_updated_by_user_id The ID of the user who created or most recently updated the field, only applicable for custom fields + * + * @return self + */ + public function setLastUpdatedByUserId($last_updated_by_user_id): self + { + $this->container['last_updated_by_user_id'] = $last_updated_by_user_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag The active flag of the field + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets edit_flag + * + * @return bool|null + */ + public function getEditFlag() + { + return $this->container['edit_flag']; + } + + /** + * Sets edit_flag + * + * @param bool|null $edit_flag The edit flag of the field + * + * @return self + */ + public function setEditFlag($edit_flag): self + { + $this->container['edit_flag'] = $edit_flag; + + return $this; + } + + /** + * Gets index_visible_flag + * + * @return bool|null + */ + public function getIndexVisibleFlag() + { + return $this->container['index_visible_flag']; + } + + /** + * Sets index_visible_flag + * + * @param bool|null $index_visible_flag Not used + * + * @return self + */ + public function setIndexVisibleFlag($index_visible_flag): self + { + $this->container['index_visible_flag'] = $index_visible_flag; + + return $this; + } + + /** + * Gets details_visible_flag + * + * @return bool|null + */ + public function getDetailsVisibleFlag() + { + return $this->container['details_visible_flag']; + } + + /** + * Sets details_visible_flag + * + * @param bool|null $details_visible_flag Not used + * + * @return self + */ + public function setDetailsVisibleFlag($details_visible_flag): self + { + $this->container['details_visible_flag'] = $details_visible_flag; + + return $this; + } + + /** + * Gets add_visible_flag + * + * @return bool|null + */ + public function getAddVisibleFlag() + { + return $this->container['add_visible_flag']; + } + + /** + * Sets add_visible_flag + * + * @param bool|null $add_visible_flag Not used + * + * @return self + */ + public function setAddVisibleFlag($add_visible_flag): self + { + $this->container['add_visible_flag'] = $add_visible_flag; + + return $this; + } + + /** + * Gets important_flag + * + * @return bool|null + */ + public function getImportantFlag() + { + return $this->container['important_flag']; + } + + /** + * Sets important_flag + * + * @param bool|null $important_flag Not used + * + * @return self + */ + public function setImportantFlag($important_flag): self + { + $this->container['important_flag'] = $important_flag; + + return $this; + } + + /** + * Gets bulk_edit_allowed + * + * @return bool|null + */ + public function getBulkEditAllowed() + { + return $this->container['bulk_edit_allowed']; + } + + /** + * Sets bulk_edit_allowed + * + * @param bool|null $bulk_edit_allowed Whether or not the field of an item can be edited in bulk + * + * @return self + */ + public function setBulkEditAllowed($bulk_edit_allowed): self + { + $this->container['bulk_edit_allowed'] = $bulk_edit_allowed; + + return $this; + } + + /** + * Gets searchable_flag + * + * @return bool|null + */ + public function getSearchableFlag() + { + return $this->container['searchable_flag']; + } + + /** + * Sets searchable_flag + * + * @param bool|null $searchable_flag Whether or not items can be searched by this field + * + * @return self + */ + public function setSearchableFlag($searchable_flag): self + { + $this->container['searchable_flag'] = $searchable_flag; + + return $this; + } + + /** + * Gets filtering_allowed + * + * @return bool|null + */ + public function getFilteringAllowed() + { + return $this->container['filtering_allowed']; + } + + /** + * Sets filtering_allowed + * + * @param bool|null $filtering_allowed Whether or not items can be filtered by this field + * + * @return self + */ + public function setFilteringAllowed($filtering_allowed): self + { + $this->container['filtering_allowed'] = $filtering_allowed; + + return $this; + } + + /** + * Gets sortable_flag + * + * @return bool|null + */ + public function getSortableFlag() + { + return $this->container['sortable_flag']; + } + + /** + * Sets sortable_flag + * + * @param bool|null $sortable_flag Whether or not items can be sorted by this field + * + * @return self + */ + public function setSortableFlag($sortable_flag): self + { + $this->container['sortable_flag'] = $sortable_flag; + + return $this; + } + + /** + * Gets mandatory_flag + * + * @return bool|null + */ + public function getMandatoryFlag() + { + return $this->container['mandatory_flag']; + } + + /** + * Sets mandatory_flag + * + * @param bool|null $mandatory_flag Whether or not the field is mandatory + * + * @return self + */ + public function setMandatoryFlag($mandatory_flag): self + { + $this->container['mandatory_flag'] = $mandatory_flag; + + return $this; + } + + /** + * Gets options + * + * @return object[]|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param object[]|null $options The options of the field. When there are no options, `null` is returned. + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets options_deleted + * + * @return object[]|null + */ + public function getOptionsDeleted() + { + return $this->container['options_deleted']; + } + + /** + * Sets options_deleted + * + * @param object[]|null $options_deleted The deleted options of the field. Only present when there is at least 1 deleted option. + * + * @return self + */ + public function setOptionsDeleted($options_deleted): self + { + $this->container['options_deleted'] = $options_deleted; + + return $this; + } + + /** + * Gets is_subfield + * + * @return bool|null + */ + public function getIsSubfield() + { + return $this->container['is_subfield']; + } + + /** + * Sets is_subfield + * + * @param bool|null $is_subfield Whether or not the field is a subfield of another field. Only present if field is subfield. + * + * @return self + */ + public function setIsSubfield($is_subfield): self + { + $this->container['is_subfield'] = $is_subfield; + + return $this; + } + + /** + * Gets subfields + * + * @return object[]|null + */ + public function getSubfields() + { + return $this->container['subfields']; + } + + /** + * Sets subfields + * + * @param object[]|null $subfields The subfields of the field. Only present when the field has subfields. + * + * @return self + */ + public function setSubfields($subfields): self + { + $this->container['subfields'] = $subfields; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldCreateRequest.php b/lib/Model/FieldCreateRequest.php new file mode 100644 index 00000000..8ab555fc --- /dev/null +++ b/lib/Model/FieldCreateRequest.php @@ -0,0 +1,438 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'options' => 'string', + 'add_visible_flag' => 'bool', + 'field_type' => '\Pipedrive\Model\FieldTypeAsString' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'options' => null, + 'add_visible_flag' => null, + 'field_type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'options' => 'options', + 'add_visible_flag' => 'add_visible_flag', + 'field_type' => 'field_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'options' => 'setOptions', + 'add_visible_flag' => 'setAddVisibleFlag', + 'field_type' => 'setFieldType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'options' => 'getOptions', + 'add_visible_flag' => 'getAddVisibleFlag', + 'field_type' => 'getFieldType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['options'] = $data['options'] ?? null; + $this->container['add_visible_flag'] = $data['add_visible_flag'] ?? true; + $this->container['field_type'] = $data['field_type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['field_type'] === null) { + $invalidProperties[] = "'field_type' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return string|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param string|null $options When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{\"label\":\"New Item\"}]` + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets add_visible_flag + * + * @return bool|null + */ + public function getAddVisibleFlag() + { + return $this->container['add_visible_flag']; + } + + /** + * Sets add_visible_flag + * + * @param bool|null $add_visible_flag Whether the field is available in the 'add new' modal or not (both in the web and mobile app) + * + * @return self + */ + public function setAddVisibleFlag($add_visible_flag): self + { + $this->container['add_visible_flag'] = $add_visible_flag; + + return $this; + } + + /** + * Gets field_type + * + * @return \Pipedrive\Model\FieldTypeAsString + */ + public function getFieldType() + { + return $this->container['field_type']; + } + + /** + * Sets field_type + * + * @param \Pipedrive\Model\FieldTypeAsString $field_type field_type + * + * @return self + */ + public function setFieldType($field_type): self + { + $this->container['field_type'] = $field_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldCreateRequestAllOf.php b/lib/Model/FieldCreateRequestAllOf.php new file mode 100644 index 00000000..7ffb48b1 --- /dev/null +++ b/lib/Model/FieldCreateRequestAllOf.php @@ -0,0 +1,405 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldCreateRequestAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldCreateRequest_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'options' => 'string', + 'add_visible_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'options' => null, + 'add_visible_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'options' => 'options', + 'add_visible_flag' => 'add_visible_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'options' => 'setOptions', + 'add_visible_flag' => 'setAddVisibleFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'options' => 'getOptions', + 'add_visible_flag' => 'getAddVisibleFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['options'] = $data['options'] ?? null; + $this->container['add_visible_flag'] = $data['add_visible_flag'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return string|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param string|null $options When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. Example: `[{\"label\":\"New Item\"}]` + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets add_visible_flag + * + * @return bool|null + */ + public function getAddVisibleFlag() + { + return $this->container['add_visible_flag']; + } + + /** + * Sets add_visible_flag + * + * @param bool|null $add_visible_flag Whether the field is available in the 'add new' modal or not (both in the web and mobile app) + * + * @return self + */ + public function setAddVisibleFlag($add_visible_flag): self + { + $this->container['add_visible_flag'] = $add_visible_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldResponse.php b/lib/Model/FieldResponse.php new file mode 100644 index 00000000..c740926b --- /dev/null +++ b/lib/Model/FieldResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\Field' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\Field|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\Field|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldResponseAllOf.php b/lib/Model/FieldResponseAllOf.php new file mode 100644 index 00000000..10802f4a --- /dev/null +++ b/lib/Model/FieldResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\Field' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\Field|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\Field|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldType.php b/lib/Model/FieldType.php new file mode 100644 index 00000000..9d019b57 --- /dev/null +++ b/lib/Model/FieldType.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldType implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'field_type' => '\Pipedrive\Model\FieldTypeAsString' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'field_type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'field_type' => 'field_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'field_type' => 'setFieldType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'field_type' => 'getFieldType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['field_type'] = $data['field_type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['field_type'] === null) { + $invalidProperties[] = "'field_type' 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 field_type + * + * @return \Pipedrive\Model\FieldTypeAsString + */ + public function getFieldType() + { + return $this->container['field_type']; + } + + /** + * Sets field_type + * + * @param \Pipedrive\Model\FieldTypeAsString $field_type field_type + * + * @return self + */ + public function setFieldType($field_type): self + { + $this->container['field_type'] = $field_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldTypeAsString.php b/lib/Model/FieldTypeAsString.php new file mode 100644 index 00000000..5ddf25ce --- /dev/null +++ b/lib/Model/FieldTypeAsString.php @@ -0,0 +1,108 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'options' => 'string', + 'add_visible_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'options' => null, + 'add_visible_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'options' => 'options', + 'add_visible_flag' => 'add_visible_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'options' => 'setOptions', + 'add_visible_flag' => 'setAddVisibleFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'options' => 'getOptions', + 'add_visible_flag' => 'getAddVisibleFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['options'] = $data['options'] ?? null; + $this->container['add_visible_flag'] = $data['add_visible_flag'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return string|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param string|null $options When `field_type` is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: `[{\"id\":123,\"label\":\"Existing Item\"},{\"label\":\"New Item\"}]` + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets add_visible_flag + * + * @return bool|null + */ + public function getAddVisibleFlag() + { + return $this->container['add_visible_flag']; + } + + /** + * Sets add_visible_flag + * + * @param bool|null $add_visible_flag Whether the field is available in 'add new' modal or not (both in web and mobile app) + * + * @return self + */ + public function setAddVisibleFlag($add_visible_flag): self + { + $this->container['add_visible_flag'] = $add_visible_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldsResponse.php b/lib/Model/FieldsResponse.php new file mode 100644 index 00000000..c11966a9 --- /dev/null +++ b/lib/Model/FieldsResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\Field[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\Field[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\Field[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FieldsResponseAllOf.php b/lib/Model/FieldsResponseAllOf.php new file mode 100644 index 00000000..5ccd2d06 --- /dev/null +++ b/lib/Model/FieldsResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FieldsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FieldsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\Field[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\Field[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\Field[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FileData.php b/lib/Model/FileData.php new file mode 100644 index 00000000..9fc44234 --- /dev/null +++ b/lib/Model/FileData.php @@ -0,0 +1,1153 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FileData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FileData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'user_id' => 'int', + 'deal_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'product_id' => 'int', + 'activity_id' => 'int', + 'lead_id' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'file_name' => 'string', + 'file_size' => 'int', + 'active_flag' => 'bool', + 'inline_flag' => 'bool', + 'remote_location' => 'string', + 'remote_id' => 'string', + 'cid' => 'string', + 's3_bucket' => 'string', + 'mail_message_id' => 'string', + 'mail_template_id' => 'string', + 'deal_name' => 'string', + 'person_name' => 'string', + 'org_name' => 'string', + 'product_name' => 'string', + 'lead_name' => 'string', + 'url' => 'string', + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'user_id' => null, + 'deal_id' => null, + 'person_id' => null, + 'org_id' => null, + 'product_id' => null, + 'activity_id' => null, + 'lead_id' => 'uuid', + 'add_time' => null, + 'update_time' => null, + 'file_name' => null, + 'file_size' => null, + 'active_flag' => null, + 'inline_flag' => null, + 'remote_location' => null, + 'remote_id' => null, + 'cid' => null, + 's3_bucket' => null, + 'mail_message_id' => null, + 'mail_template_id' => null, + 'deal_name' => null, + 'person_name' => null, + 'org_name' => null, + 'product_name' => null, + 'lead_name' => null, + 'url' => null, + 'name' => null, + 'description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'user_id' => 'user_id', + 'deal_id' => 'deal_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'product_id' => 'product_id', + 'activity_id' => 'activity_id', + 'lead_id' => 'lead_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'file_name' => 'file_name', + 'file_size' => 'file_size', + 'active_flag' => 'active_flag', + 'inline_flag' => 'inline_flag', + 'remote_location' => 'remote_location', + 'remote_id' => 'remote_id', + 'cid' => 'cid', + 's3_bucket' => 's3_bucket', + 'mail_message_id' => 'mail_message_id', + 'mail_template_id' => 'mail_template_id', + 'deal_name' => 'deal_name', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'product_name' => 'product_name', + 'lead_name' => 'lead_name', + 'url' => 'url', + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'user_id' => 'setUserId', + 'deal_id' => 'setDealId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'product_id' => 'setProductId', + 'activity_id' => 'setActivityId', + 'lead_id' => 'setLeadId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'file_name' => 'setFileName', + 'file_size' => 'setFileSize', + 'active_flag' => 'setActiveFlag', + 'inline_flag' => 'setInlineFlag', + 'remote_location' => 'setRemoteLocation', + 'remote_id' => 'setRemoteId', + 'cid' => 'setCid', + 's3_bucket' => 'setS3Bucket', + 'mail_message_id' => 'setMailMessageId', + 'mail_template_id' => 'setMailTemplateId', + 'deal_name' => 'setDealName', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'product_name' => 'setProductName', + 'lead_name' => 'setLeadName', + 'url' => 'setUrl', + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'user_id' => 'getUserId', + 'deal_id' => 'getDealId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'product_id' => 'getProductId', + 'activity_id' => 'getActivityId', + 'lead_id' => 'getLeadId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'file_name' => 'getFileName', + 'file_size' => 'getFileSize', + 'active_flag' => 'getActiveFlag', + 'inline_flag' => 'getInlineFlag', + 'remote_location' => 'getRemoteLocation', + 'remote_id' => 'getRemoteId', + 'cid' => 'getCid', + 's3_bucket' => 'getS3Bucket', + 'mail_message_id' => 'getMailMessageId', + 'mail_template_id' => 'getMailTemplateId', + 'deal_name' => 'getDealName', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'product_name' => 'getProductName', + 'lead_name' => 'getLeadName', + 'url' => 'getUrl', + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['activity_id'] = $data['activity_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['file_name'] = $data['file_name'] ?? null; + $this->container['file_size'] = $data['file_size'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['inline_flag'] = $data['inline_flag'] ?? null; + $this->container['remote_location'] = $data['remote_location'] ?? null; + $this->container['remote_id'] = $data['remote_id'] ?? null; + $this->container['cid'] = $data['cid'] ?? null; + $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; + $this->container['mail_message_id'] = $data['mail_message_id'] ?? null; + $this->container['mail_template_id'] = $data['mail_template_id'] ?? null; + $this->container['deal_name'] = $data['deal_name'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['product_name'] = $data['product_name'] ?? null; + $this->container['lead_name'] = $data['lead_name'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the file + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user to associate the file with + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal to associate the file with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person to associate the file with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization to associate the file with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product to associate the file with + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets activity_id + * + * @return int|null + */ + public function getActivityId() + { + return $this->container['activity_id']; + } + + /** + * Sets activity_id + * + * @param int|null $activity_id The ID of the activity to associate the file with + * + * @return self + */ + public function setActivityId($activity_id): self + { + $this->container['activity_id'] = $activity_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead to associate the file with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets file_name + * + * @return string|null + */ + public function getFileName() + { + return $this->container['file_name']; + } + + /** + * Sets file_name + * + * @param string|null $file_name The original name of the file + * + * @return self + */ + public function setFileName($file_name): self + { + $this->container['file_name'] = $file_name; + + return $this; + } + + /** + * Gets file_size + * + * @return int|null + */ + public function getFileSize() + { + return $this->container['file_size']; + } + + /** + * Sets file_size + * + * @param int|null $file_size The size of the file + * + * @return self + */ + public function setFileSize($file_size): self + { + $this->container['file_size'] = $file_size; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not. false = Not activated, true = Activated + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets inline_flag + * + * @return bool|null + */ + public function getInlineFlag() + { + return $this->container['inline_flag']; + } + + /** + * Sets inline_flag + * + * @param bool|null $inline_flag Whether the file was uploaded as inline or not + * + * @return self + */ + public function setInlineFlag($inline_flag): self + { + $this->container['inline_flag'] = $inline_flag; + + return $this; + } + + /** + * Gets remote_location + * + * @return string|null + */ + public function getRemoteLocation() + { + return $this->container['remote_location']; + } + + /** + * Sets remote_location + * + * @param string|null $remote_location The location type to send the file to. Only googledrive is supported at the moment. + * + * @return self + */ + public function setRemoteLocation($remote_location): self + { + $this->container['remote_location'] = $remote_location; + + return $this; + } + + /** + * Gets remote_id + * + * @return string|null + */ + public function getRemoteId() + { + return $this->container['remote_id']; + } + + /** + * Sets remote_id + * + * @param string|null $remote_id The ID of the remote item + * + * @return self + */ + public function setRemoteId($remote_id): self + { + $this->container['remote_id'] = $remote_id; + + return $this; + } + + /** + * Gets cid + * + * @return string|null + */ + public function getCid() + { + return $this->container['cid']; + } + + /** + * Sets cid + * + * @param string|null $cid The ID of the inline attachment + * + * @return self + */ + public function setCid($cid): self + { + $this->container['cid'] = $cid; + + return $this; + } + + /** + * Gets s3_bucket + * + * @return string|null + */ + public function getS3Bucket() + { + return $this->container['s3_bucket']; + } + + /** + * Sets s3_bucket + * + * @param string|null $s3_bucket The location of the cloud storage + * + * @return self + */ + public function setS3Bucket($s3_bucket): self + { + $this->container['s3_bucket'] = $s3_bucket; + + return $this; + } + + /** + * Gets mail_message_id + * + * @return string|null + */ + public function getMailMessageId() + { + return $this->container['mail_message_id']; + } + + /** + * Sets mail_message_id + * + * @param string|null $mail_message_id The ID of the mail message to associate the file with + * + * @return self + */ + public function setMailMessageId($mail_message_id): self + { + $this->container['mail_message_id'] = $mail_message_id; + + return $this; + } + + /** + * Gets mail_template_id + * + * @return string|null + */ + public function getMailTemplateId() + { + return $this->container['mail_template_id']; + } + + /** + * Sets mail_template_id + * + * @param string|null $mail_template_id The ID of the mail template to associate the file with + * + * @return self + */ + public function setMailTemplateId($mail_template_id): self + { + $this->container['mail_template_id'] = $mail_template_id; + + return $this; + } + + /** + * Gets deal_name + * + * @return string|null + */ + public function getDealName() + { + return $this->container['deal_name']; + } + + /** + * Sets deal_name + * + * @param string|null $deal_name The name of the deal associated with the file + * + * @return self + */ + public function setDealName($deal_name): self + { + $this->container['deal_name'] = $deal_name; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the file + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the file + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets product_name + * + * @return string|null + */ + public function getProductName() + { + return $this->container['product_name']; + } + + /** + * Sets product_name + * + * @param string|null $product_name The name of the product associated with the file + * + * @return self + */ + public function setProductName($product_name): self + { + $this->container['product_name'] = $product_name; + + return $this; + } + + /** + * Gets lead_name + * + * @return string|null + */ + public function getLeadName() + { + return $this->container['lead_name']; + } + + /** + * Sets lead_name + * + * @param string|null $lead_name The name of the lead associated with the file + * + * @return self + */ + public function setLeadName($lead_name): self + { + $this->container['lead_name'] = $lead_name; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL of the download file + * + * @return self + */ + public function setUrl($url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The visible name of the file + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the file + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FileItem.php b/lib/Model/FileItem.php new file mode 100644 index 00000000..dfd04ad5 --- /dev/null +++ b/lib/Model/FileItem.php @@ -0,0 +1,1153 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FileItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FileItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'user_id' => 'int', + 'deal_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'product_id' => 'int', + 'activity_id' => 'int', + 'lead_id' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'file_name' => 'string', + 'file_size' => 'int', + 'active_flag' => 'bool', + 'inline_flag' => 'bool', + 'remote_location' => 'string', + 'remote_id' => 'string', + 'cid' => 'string', + 's3_bucket' => 'string', + 'mail_message_id' => 'string', + 'mail_template_id' => 'string', + 'deal_name' => 'string', + 'person_name' => 'string', + 'org_name' => 'string', + 'product_name' => 'string', + 'lead_name' => 'string', + 'url' => 'string', + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'user_id' => null, + 'deal_id' => null, + 'person_id' => null, + 'org_id' => null, + 'product_id' => null, + 'activity_id' => null, + 'lead_id' => 'uuid', + 'add_time' => null, + 'update_time' => null, + 'file_name' => null, + 'file_size' => null, + 'active_flag' => null, + 'inline_flag' => null, + 'remote_location' => null, + 'remote_id' => null, + 'cid' => null, + 's3_bucket' => null, + 'mail_message_id' => null, + 'mail_template_id' => null, + 'deal_name' => null, + 'person_name' => null, + 'org_name' => null, + 'product_name' => null, + 'lead_name' => null, + 'url' => null, + 'name' => null, + 'description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'user_id' => 'user_id', + 'deal_id' => 'deal_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'product_id' => 'product_id', + 'activity_id' => 'activity_id', + 'lead_id' => 'lead_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'file_name' => 'file_name', + 'file_size' => 'file_size', + 'active_flag' => 'active_flag', + 'inline_flag' => 'inline_flag', + 'remote_location' => 'remote_location', + 'remote_id' => 'remote_id', + 'cid' => 'cid', + 's3_bucket' => 's3_bucket', + 'mail_message_id' => 'mail_message_id', + 'mail_template_id' => 'mail_template_id', + 'deal_name' => 'deal_name', + 'person_name' => 'person_name', + 'org_name' => 'org_name', + 'product_name' => 'product_name', + 'lead_name' => 'lead_name', + 'url' => 'url', + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'user_id' => 'setUserId', + 'deal_id' => 'setDealId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'product_id' => 'setProductId', + 'activity_id' => 'setActivityId', + 'lead_id' => 'setLeadId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'file_name' => 'setFileName', + 'file_size' => 'setFileSize', + 'active_flag' => 'setActiveFlag', + 'inline_flag' => 'setInlineFlag', + 'remote_location' => 'setRemoteLocation', + 'remote_id' => 'setRemoteId', + 'cid' => 'setCid', + 's3_bucket' => 'setS3Bucket', + 'mail_message_id' => 'setMailMessageId', + 'mail_template_id' => 'setMailTemplateId', + 'deal_name' => 'setDealName', + 'person_name' => 'setPersonName', + 'org_name' => 'setOrgName', + 'product_name' => 'setProductName', + 'lead_name' => 'setLeadName', + 'url' => 'setUrl', + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'user_id' => 'getUserId', + 'deal_id' => 'getDealId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'product_id' => 'getProductId', + 'activity_id' => 'getActivityId', + 'lead_id' => 'getLeadId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'file_name' => 'getFileName', + 'file_size' => 'getFileSize', + 'active_flag' => 'getActiveFlag', + 'inline_flag' => 'getInlineFlag', + 'remote_location' => 'getRemoteLocation', + 'remote_id' => 'getRemoteId', + 'cid' => 'getCid', + 's3_bucket' => 'getS3Bucket', + 'mail_message_id' => 'getMailMessageId', + 'mail_template_id' => 'getMailTemplateId', + 'deal_name' => 'getDealName', + 'person_name' => 'getPersonName', + 'org_name' => 'getOrgName', + 'product_name' => 'getProductName', + 'lead_name' => 'getLeadName', + 'url' => 'getUrl', + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['activity_id'] = $data['activity_id'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['file_name'] = $data['file_name'] ?? null; + $this->container['file_size'] = $data['file_size'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['inline_flag'] = $data['inline_flag'] ?? null; + $this->container['remote_location'] = $data['remote_location'] ?? null; + $this->container['remote_id'] = $data['remote_id'] ?? null; + $this->container['cid'] = $data['cid'] ?? null; + $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; + $this->container['mail_message_id'] = $data['mail_message_id'] ?? null; + $this->container['mail_template_id'] = $data['mail_template_id'] ?? null; + $this->container['deal_name'] = $data['deal_name'] ?? null; + $this->container['person_name'] = $data['person_name'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['product_name'] = $data['product_name'] ?? null; + $this->container['lead_name'] = $data['lead_name'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the file + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user to associate the file with + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal to associate the file with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person to associate the file with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization to associate the file with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product to associate the file with + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets activity_id + * + * @return int|null + */ + public function getActivityId() + { + return $this->container['activity_id']; + } + + /** + * Sets activity_id + * + * @param int|null $activity_id The ID of the activity to associate the file with + * + * @return self + */ + public function setActivityId($activity_id): self + { + $this->container['activity_id'] = $activity_id; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead to associate the file with + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the file was added/created. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the file. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets file_name + * + * @return string|null + */ + public function getFileName() + { + return $this->container['file_name']; + } + + /** + * Sets file_name + * + * @param string|null $file_name The original name of the file + * + * @return self + */ + public function setFileName($file_name): self + { + $this->container['file_name'] = $file_name; + + return $this; + } + + /** + * Gets file_size + * + * @return int|null + */ + public function getFileSize() + { + return $this->container['file_size']; + } + + /** + * Sets file_size + * + * @param int|null $file_size The size of the file + * + * @return self + */ + public function setFileSize($file_size): self + { + $this->container['file_size'] = $file_size; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not. false = Not activated, true = Activated + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets inline_flag + * + * @return bool|null + */ + public function getInlineFlag() + { + return $this->container['inline_flag']; + } + + /** + * Sets inline_flag + * + * @param bool|null $inline_flag Whether the file was uploaded as inline or not + * + * @return self + */ + public function setInlineFlag($inline_flag): self + { + $this->container['inline_flag'] = $inline_flag; + + return $this; + } + + /** + * Gets remote_location + * + * @return string|null + */ + public function getRemoteLocation() + { + return $this->container['remote_location']; + } + + /** + * Sets remote_location + * + * @param string|null $remote_location The location type to send the file to. Only googledrive is supported at the moment. + * + * @return self + */ + public function setRemoteLocation($remote_location): self + { + $this->container['remote_location'] = $remote_location; + + return $this; + } + + /** + * Gets remote_id + * + * @return string|null + */ + public function getRemoteId() + { + return $this->container['remote_id']; + } + + /** + * Sets remote_id + * + * @param string|null $remote_id The ID of the remote item + * + * @return self + */ + public function setRemoteId($remote_id): self + { + $this->container['remote_id'] = $remote_id; + + return $this; + } + + /** + * Gets cid + * + * @return string|null + */ + public function getCid() + { + return $this->container['cid']; + } + + /** + * Sets cid + * + * @param string|null $cid The ID of the inline attachment + * + * @return self + */ + public function setCid($cid): self + { + $this->container['cid'] = $cid; + + return $this; + } + + /** + * Gets s3_bucket + * + * @return string|null + */ + public function getS3Bucket() + { + return $this->container['s3_bucket']; + } + + /** + * Sets s3_bucket + * + * @param string|null $s3_bucket The location of the cloud storage + * + * @return self + */ + public function setS3Bucket($s3_bucket): self + { + $this->container['s3_bucket'] = $s3_bucket; + + return $this; + } + + /** + * Gets mail_message_id + * + * @return string|null + */ + public function getMailMessageId() + { + return $this->container['mail_message_id']; + } + + /** + * Sets mail_message_id + * + * @param string|null $mail_message_id The ID of the mail message to associate the file with + * + * @return self + */ + public function setMailMessageId($mail_message_id): self + { + $this->container['mail_message_id'] = $mail_message_id; + + return $this; + } + + /** + * Gets mail_template_id + * + * @return string|null + */ + public function getMailTemplateId() + { + return $this->container['mail_template_id']; + } + + /** + * Sets mail_template_id + * + * @param string|null $mail_template_id The ID of the mail template to associate the file with + * + * @return self + */ + public function setMailTemplateId($mail_template_id): self + { + $this->container['mail_template_id'] = $mail_template_id; + + return $this; + } + + /** + * Gets deal_name + * + * @return string|null + */ + public function getDealName() + { + return $this->container['deal_name']; + } + + /** + * Sets deal_name + * + * @param string|null $deal_name The name of the deal associated with the dile + * + * @return self + */ + public function setDealName($deal_name): self + { + $this->container['deal_name'] = $deal_name; + + return $this; + } + + /** + * Gets person_name + * + * @return string|null + */ + public function getPersonName() + { + return $this->container['person_name']; + } + + /** + * Sets person_name + * + * @param string|null $person_name The name of the person associated with the file + * + * @return self + */ + public function setPersonName($person_name): self + { + $this->container['person_name'] = $person_name; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the file + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets product_name + * + * @return string|null + */ + public function getProductName() + { + return $this->container['product_name']; + } + + /** + * Sets product_name + * + * @param string|null $product_name The name of the product associated with the file + * + * @return self + */ + public function setProductName($product_name): self + { + $this->container['product_name'] = $product_name; + + return $this; + } + + /** + * Gets lead_name + * + * @return string|null + */ + public function getLeadName() + { + return $this->container['lead_name']; + } + + /** + * Sets lead_name + * + * @param string|null $lead_name The name of the lead associated with the file + * + * @return self + */ + public function setLeadName($lead_name): self + { + $this->container['lead_name'] = $lead_name; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL of the download file + * + * @return self + */ + public function setUrl($url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The visible name of the file + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the file + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FilterGetItem.php b/lib/Model/FilterGetItem.php new file mode 100644 index 00000000..fa7fc4db --- /dev/null +++ b/lib/Model/FilterGetItem.php @@ -0,0 +1,583 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FilterGetItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FilterGetItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'active_flag' => 'bool', + 'type' => 'string', + 'user_id' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'int', + 'custom_view_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'active_flag' => null, + 'type' => null, + 'user_id' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'custom_view_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'type' => 'type', + 'user_id' => 'user_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'custom_view_id' => 'custom_view_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'type' => 'setType', + 'user_id' => 'setUserId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'custom_view_id' => 'setCustomViewId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'type' => 'getType', + 'user_id' => 'getUserId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'custom_view_id' => 'getCustomViewId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['custom_view_id'] = $data['custom_view_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the filter + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the filter + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag The active flag of the filter + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the item + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The owner of the filter + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the filter was added + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The date and time when the filter was updated + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility group ID of who can see then filter + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets custom_view_id + * + * @return int|null + */ + public function getCustomViewId() + { + return $this->container['custom_view_id']; + } + + /** + * Sets custom_view_id + * + * @param int|null $custom_view_id Used by Pipedrive webapp + * + * @return self + */ + public function setCustomViewId($custom_view_id): self + { + $this->container['custom_view_id'] = $custom_view_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FilterType.php b/lib/Model/FilterType.php new file mode 100644 index 00000000..b382a430 --- /dev/null +++ b/lib/Model/FilterType.php @@ -0,0 +1,74 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersBulkDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersBulkDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FiltersBulkDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FiltersBulkDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FiltersBulkDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersBulkDeleteResponseAllOf.php b/lib/Model/FiltersBulkDeleteResponseAllOf.php new file mode 100644 index 00000000..e2897614 --- /dev/null +++ b/lib/Model/FiltersBulkDeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersBulkDeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersBulkDeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FiltersBulkDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FiltersBulkDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FiltersBulkDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersBulkDeleteResponseAllOfData.php b/lib/Model/FiltersBulkDeleteResponseAllOfData.php new file mode 100644 index 00000000..1e40d97f --- /dev/null +++ b/lib/Model/FiltersBulkDeleteResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersBulkDeleteResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersBulkDeleteResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The array of the IDs of the deleted filter + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersBulkGetResponse.php b/lib/Model/FiltersBulkGetResponse.php new file mode 100644 index 00000000..494d1438 --- /dev/null +++ b/lib/Model/FiltersBulkGetResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersBulkGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersBulkGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FilterGetItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FilterGetItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FilterGetItem[]|null $data The array of filters + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersBulkGetResponseAllOf.php b/lib/Model/FiltersBulkGetResponseAllOf.php new file mode 100644 index 00000000..550b3518 --- /dev/null +++ b/lib/Model/FiltersBulkGetResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersBulkGetResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersBulkGetResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FilterGetItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FilterGetItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FilterGetItem[]|null $data The array of filters + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersDeleteResponse.php b/lib/Model/FiltersDeleteResponse.php new file mode 100644 index 00000000..b05dcd74 --- /dev/null +++ b/lib/Model/FiltersDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FiltersDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FiltersDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FiltersDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersDeleteResponseAllOf.php b/lib/Model/FiltersDeleteResponseAllOf.php new file mode 100644 index 00000000..087d5db8 --- /dev/null +++ b/lib/Model/FiltersDeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersDeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersDeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FiltersDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FiltersDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FiltersDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersDeleteResponseAllOfData.php b/lib/Model/FiltersDeleteResponseAllOfData.php new file mode 100644 index 00000000..a88ffacf --- /dev/null +++ b/lib/Model/FiltersDeleteResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersDeleteResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersDeleteResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deleted filter + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersGetResponse.php b/lib/Model/FiltersGetResponse.php new file mode 100644 index 00000000..9e44118e --- /dev/null +++ b/lib/Model/FiltersGetResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FilterGetItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FilterGetItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FilterGetItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersGetResponseAllOf.php b/lib/Model/FiltersGetResponseAllOf.php new file mode 100644 index 00000000..468f8564 --- /dev/null +++ b/lib/Model/FiltersGetResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersGetResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersGetResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FilterGetItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FilterGetItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FilterGetItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersPostResponse.php b/lib/Model/FiltersPostResponse.php new file mode 100644 index 00000000..836e0409 --- /dev/null +++ b/lib/Model/FiltersPostResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersPostResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersPostResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FiltersPostResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FiltersPostResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FiltersPostResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersPostResponseAllOf.php b/lib/Model/FiltersPostResponseAllOf.php new file mode 100644 index 00000000..ef31728b --- /dev/null +++ b/lib/Model/FiltersPostResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersPostResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersPostResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FiltersPostResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FiltersPostResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FiltersPostResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FiltersPostResponseAllOfData.php b/lib/Model/FiltersPostResponseAllOfData.php new file mode 100644 index 00000000..9c96b0a1 --- /dev/null +++ b/lib/Model/FiltersPostResponseAllOfData.php @@ -0,0 +1,642 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FiltersPostResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FiltersPostResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'active_flag' => 'bool', + 'type' => '\Pipedrive\Model\FilterType', + 'temporary_flag' => 'bool', + 'user_id' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'int', + 'custom_view_id' => 'int', + 'conditions' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'active_flag' => null, + 'type' => null, + 'temporary_flag' => null, + 'user_id' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'custom_view_id' => null, + 'conditions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'type' => 'type', + 'temporary_flag' => 'temporary_flag', + 'user_id' => 'user_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'custom_view_id' => 'custom_view_id', + 'conditions' => 'conditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'type' => 'setType', + 'temporary_flag' => 'setTemporaryFlag', + 'user_id' => 'setUserId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'custom_view_id' => 'setCustomViewId', + 'conditions' => 'setConditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'type' => 'getType', + 'temporary_flag' => 'getTemporaryFlag', + 'user_id' => 'getUserId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'custom_view_id' => 'getCustomViewId', + 'conditions' => 'getConditions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['temporary_flag'] = $data['temporary_flag'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['custom_view_id'] = $data['custom_view_id'] ?? null; + $this->container['conditions'] = $data['conditions'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the created filter + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the created filter + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag The activity flag of the created filter + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets type + * + * @return \Pipedrive\Model\FilterType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Pipedrive\Model\FilterType|null $type type + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets temporary_flag + * + * @return bool|null + */ + public function getTemporaryFlag() + { + return $this->container['temporary_flag']; + } + + /** + * Sets temporary_flag + * + * @param bool|null $temporary_flag If the created filter is temporary or not + * + * @return self + */ + public function setTemporaryFlag($temporary_flag): self + { + $this->container['temporary_flag'] = $temporary_flag; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID of the created filter + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The add time of the created filter + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the created filter + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility group ID of the created filter + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets custom_view_id + * + * @return int|null + */ + public function getCustomViewId() + { + return $this->container['custom_view_id']; + } + + /** + * Sets custom_view_id + * + * @param int|null $custom_view_id The custom view ID of the created filter + * + * @return self + */ + public function setCustomViewId($custom_view_id): self + { + $this->container['custom_view_id'] = $custom_view_id; + + return $this; + } + + /** + * Gets conditions + * + * @return object|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param object|null $conditions The created filter conditions object + * + * @return self + */ + public function setConditions($conditions): self + { + $this->container['conditions'] = $conditions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FindGoalResponse.php b/lib/Model/FindGoalResponse.php new file mode 100644 index 00000000..31796920 --- /dev/null +++ b/lib/Model/FindGoalResponse.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FindGoalResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FindGoalResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'goals' => '\Pipedrive\Model\GoalsResponseComponent[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'goals' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'goals' => 'goals' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'goals' => 'setGoals' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'goals' => 'getGoals' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['goals'] = $data['goals'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets goals + * + * @return \Pipedrive\Model\GoalsResponseComponent[]|null + */ + public function getGoals() + { + return $this->container['goals']; + } + + /** + * Sets goals + * + * @param \Pipedrive\Model\GoalsResponseComponent[]|null $goals goals + * + * @return self + */ + public function setGoals($goals): self + { + $this->container['goals'] = $goals; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FollowerData.php b/lib/Model/FollowerData.php new file mode 100644 index 00000000..89c3a9f2 --- /dev/null +++ b/lib/Model/FollowerData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FollowerData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FollowerData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'email' => 'string', + 'user_id' => 'int', + 'pic_hash' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'email' => null, + 'user_id' => null, + 'pic_hash' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'email' => 'email', + 'user_id' => 'user_id', + 'pic_hash' => 'pic_hash' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'email' => 'setEmail', + 'user_id' => 'setUserId', + 'pic_hash' => 'setPicHash' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'email' => 'getEmail', + 'user_id' => 'getUserId', + 'pic_hash' => 'getPicHash' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the follower + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the follower + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID of the follower + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The follower picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FollowerDataWithID.php b/lib/Model/FollowerDataWithID.php new file mode 100644 index 00000000..268026d4 --- /dev/null +++ b/lib/Model/FollowerDataWithID.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FollowerDataWithID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FollowerDataWithID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'user_id' => 'int', + 'pic_hash' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'user_id' => null, + 'pic_hash' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'user_id' => 'user_id', + 'pic_hash' => 'pic_hash' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'user_id' => 'setUserId', + 'pic_hash' => 'setPicHash' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'user_id' => 'getUserId', + 'pic_hash' => 'getPicHash' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the follower + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the follower + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID of the follower + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The follower picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FollowerDataWithIDAllOf.php b/lib/Model/FollowerDataWithIDAllOf.php new file mode 100644 index 00000000..0f8fc8b3 --- /dev/null +++ b/lib/Model/FollowerDataWithIDAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FollowerDataWithIDAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FollowerDataWithID_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FullRole.php b/lib/Model/FullRole.php new file mode 100644 index 00000000..6abd8c4e --- /dev/null +++ b/lib/Model/FullRole.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FullRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FullRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'parent_role_id' => 'int', + 'name' => 'string', + 'id' => 'int', + 'active_flag' => 'bool', + 'assignment_count' => 'string', + 'sub_role_count' => 'string', + 'level' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'parent_role_id' => null, + 'name' => null, + 'id' => null, + 'active_flag' => null, + 'assignment_count' => null, + 'sub_role_count' => null, + 'level' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'parent_role_id' => 'parent_role_id', + 'name' => 'name', + 'id' => 'id', + 'active_flag' => 'active_flag', + 'assignment_count' => 'assignment_count', + 'sub_role_count' => 'sub_role_count', + 'level' => 'level' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'parent_role_id' => 'setParentRoleId', + 'name' => 'setName', + 'id' => 'setId', + 'active_flag' => 'setActiveFlag', + 'assignment_count' => 'setAssignmentCount', + 'sub_role_count' => 'setSubRoleCount', + 'level' => 'setLevel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'parent_role_id' => 'getParentRoleId', + 'name' => 'getName', + 'id' => 'getId', + 'active_flag' => 'getActiveFlag', + 'assignment_count' => 'getAssignmentCount', + 'sub_role_count' => 'getSubRoleCount', + 'level' => 'getLevel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['parent_role_id'] = $data['parent_role_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['assignment_count'] = $data['assignment_count'] ?? null; + $this->container['sub_role_count'] = $data['sub_role_count'] ?? null; + $this->container['level'] = $data['level'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets parent_role_id + * + * @return int|null + */ + public function getParentRoleId() + { + return $this->container['parent_role_id']; + } + + /** + * Sets parent_role_id + * + * @param int|null $parent_role_id The ID of the parent role + * + * @return self + */ + public function setParentRoleId($parent_role_id): self + { + $this->container['parent_role_id'] = $parent_role_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the role + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the role is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets assignment_count + * + * @return string|null + */ + public function getAssignmentCount() + { + return $this->container['assignment_count']; + } + + /** + * Sets assignment_count + * + * @param string|null $assignment_count The number of users assigned to this role + * + * @return self + */ + public function setAssignmentCount($assignment_count): self + { + $this->container['assignment_count'] = $assignment_count; + + return $this; + } + + /** + * Gets sub_role_count + * + * @return string|null + */ + public function getSubRoleCount() + { + return $this->container['sub_role_count']; + } + + /** + * Sets sub_role_count + * + * @param string|null $sub_role_count The number of sub-roles + * + * @return self + */ + public function setSubRoleCount($sub_role_count): self + { + $this->container['sub_role_count'] = $sub_role_count; + + return $this; + } + + /** + * Gets level + * + * @return int|null + */ + public function getLevel() + { + return $this->container['level']; + } + + /** + * Sets level + * + * @param int|null $level The level of role in the role hierarchy + * + * @return self + */ + public function setLevel($level): self + { + $this->container['level'] = $level; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/FullRoleAllOf.php b/lib/Model/FullRoleAllOf.php new file mode 100644 index 00000000..66a48ebc --- /dev/null +++ b/lib/Model/FullRoleAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FullRoleAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'FullRole_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'level' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'level' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'level' => 'level' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'level' => 'setLevel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'level' => 'getLevel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['level'] = $data['level'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets level + * + * @return int|null + */ + public function getLevel() + { + return $this->container['level']; + } + + /** + * Sets level + * + * @param int|null $level The level of role in the role hierarchy + * + * @return self + */ + public function setLevel($level): self + { + $this->container['level'] = $level; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetActivitiesCollectionResponse200.php b/lib/Model/GetActivitiesCollectionResponse200.php new file mode 100644 index 00000000..6bfe4dc2 --- /dev/null +++ b/lib/Model/GetActivitiesCollectionResponse200.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetActivitiesCollectionResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getActivitiesCollectionResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityCollectionResponseObject[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithCursorPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityCollectionResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityCollectionResponseObject[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithCursorPagination|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithCursorPagination|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetActivitiesResponse200.php b/lib/Model/GetActivitiesResponse200.php new file mode 100644 index 00000000..ce32b09a --- /dev/null +++ b/lib/Model/GetActivitiesResponse200.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetActivitiesResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getActivitiesResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityResponseObject[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData', + 'related_objects' => '\Pipedrive\Model\GetActivitiesResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetActivitiesResponse200RelatedObjects.php b/lib/Model/GetActivitiesResponse200RelatedObjects.php new file mode 100644 index 00000000..31d47ffe --- /dev/null +++ b/lib/Model/GetActivitiesResponse200RelatedObjects.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetActivitiesResponse200RelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getActivitiesResponse200_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user' => '\Pipedrive\Model\RelatedUserData', + 'deal' => '\Pipedrive\Model\RelatedDealData', + 'person' => '\Pipedrive\Model\RelatedPersonData', + 'organization' => '\Pipedrive\Model\RelatedOrganizationData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user' => null, + 'deal' => null, + 'person' => null, + 'organization' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user' => 'user', + 'deal' => 'deal', + 'person' => 'person', + 'organization' => 'organization' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user' => 'setUser', + 'deal' => 'setDeal', + 'person' => 'setPerson', + 'organization' => 'setOrganization' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user' => 'getUser', + 'deal' => 'getDeal', + 'person' => 'getPerson', + 'organization' => 'getOrganization' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user'] = $data['user'] ?? null; + $this->container['deal'] = $data['deal'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets deal + * + * @return \Pipedrive\Model\RelatedDealData|null + */ + public function getDeal() + { + return $this->container['deal']; + } + + /** + * Sets deal + * + * @param \Pipedrive\Model\RelatedDealData|null $deal deal + * + * @return self + */ + public function setDeal($deal): self + { + $this->container['deal'] = $deal; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\RelatedPersonData|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\RelatedPersonData|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationData|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationData|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetActivityResponse200.php b/lib/Model/GetActivityResponse200.php new file mode 100644 index 00000000..df1b8677 --- /dev/null +++ b/lib/Model/GetActivityResponse200.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetActivityResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getActivityResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityResponseObject', + 'related_objects' => '\Pipedrive\Model\GetActivitiesResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAddProductAttachementDetails.php b/lib/Model/GetAddProductAttachementDetails.php new file mode 100644 index 00000000..e2ec4e74 --- /dev/null +++ b/lib/Model/GetAddProductAttachementDetails.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAddProductAttachementDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAddProductAttachementDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'AddProductAttachmentDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return AddProductAttachmentDetails|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param AddProductAttachmentDetails|null $data The added product object attached to the deal + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAddUpdateStage.php b/lib/Model/GetAddUpdateStage.php new file mode 100644 index 00000000..e7e12b80 --- /dev/null +++ b/lib/Model/GetAddUpdateStage.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAddUpdateStage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAddUpdateStage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseStage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseStage|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseStage|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAddedDeal.php b/lib/Model/GetAddedDeal.php new file mode 100644 index 00000000..fd84da9d --- /dev/null +++ b/lib/Model/GetAddedDeal.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAddedDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAddedDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealNonStrict', + 'related_objects' => '\Pipedrive\Model\GetDealsRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealNonStrict|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealNonStrict|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetDealsRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetDealsRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAllFiles.php b/lib/Model/GetAllFiles.php new file mode 100644 index 00000000..6b226702 --- /dev/null +++ b/lib/Model/GetAllFiles.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAllFiles implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAllFiles'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithPaginationDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileData[]|null $data The array of all uploaded files + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithPaginationDetails|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithPaginationDetails|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAllPersonsResponse.php b/lib/Model/GetAllPersonsResponse.php new file mode 100644 index 00000000..21e46e75 --- /dev/null +++ b/lib/Model/GetAllPersonsResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAllPersonsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAllPersonsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonItem[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem[]|null $data The array of persons + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAllPersonsResponseAllOf.php b/lib/Model/GetAllPersonsResponseAllOf.php new file mode 100644 index 00000000..dd35b890 --- /dev/null +++ b/lib/Model/GetAllPersonsResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAllPersonsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAllPersonsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PersonItem[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem[]|null $data The array of persons + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAllPipelines.php b/lib/Model/GetAllPipelines.php new file mode 100644 index 00000000..df45c58b --- /dev/null +++ b/lib/Model/GetAllPipelines.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAllPipelines implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAllPipelines'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BasePipelineWithSelectedFlag[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BasePipelineWithSelectedFlag[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BasePipelineWithSelectedFlag[]|null $data Pipelines array + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAllPipelinesAllOf.php b/lib/Model/GetAllPipelinesAllOf.php new file mode 100644 index 00000000..650a4531 --- /dev/null +++ b/lib/Model/GetAllPipelinesAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAllPipelinesAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAllPipelines_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BasePipelineWithSelectedFlag[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BasePipelineWithSelectedFlag[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BasePipelineWithSelectedFlag[]|null $data Pipelines array + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetAllProductFieldsResponse.php b/lib/Model/GetAllProductFieldsResponse.php new file mode 100644 index 00000000..c769da3d --- /dev/null +++ b/lib/Model/GetAllProductFieldsResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAllProductFieldsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetAllProductFieldsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ProductField[]', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductField[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductField[]|null $data Array containing data for all product fields + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data Additional data for the product field, such as pagination + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetComments.php b/lib/Model/GetComments.php new file mode 100644 index 00000000..2c800d02 --- /dev/null +++ b/lib/Model/GetComments.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetComments implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetComments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseComment[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithOffsetPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseComment[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseComment[]|null $data The array of comments + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithOffsetPagination|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithOffsetPagination|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDeal.php b/lib/Model/GetDeal.php new file mode 100644 index 00000000..6be50bae --- /dev/null +++ b/lib/Model/GetDeal.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealNonStrictWithDetails', + 'additional_data' => '\Pipedrive\Model\GetDealAdditionalData', + 'related_objects' => '\Pipedrive\Model\GetDealsRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealNonStrictWithDetails|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealNonStrictWithDetails|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\GetDealAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\GetDealAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetDealsRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetDealsRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealAdditionalData.php b/lib/Model/GetDealAdditionalData.php new file mode 100644 index 00000000..f962a645 --- /dev/null +++ b/lib/Model/GetDealAdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDeal_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'dropbox_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dropbox_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'dropbox_email' => 'dropbox_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dropbox_email' => 'setDropboxEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dropbox_email' => 'getDropboxEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['dropbox_email'] = $data['dropbox_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets dropbox_email + * + * @return string|null + */ + public function getDropboxEmail() + { + return $this->container['dropbox_email']; + } + + /** + * Sets dropbox_email + * + * @param string|null $dropbox_email The BCC email of the deal + * + * @return self + */ + public function setDropboxEmail($dropbox_email): self + { + $this->container['dropbox_email'] = $dropbox_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDeals.php b/lib/Model/GetDeals.php new file mode 100644 index 00000000..a391706f --- /dev/null +++ b/lib/Model/GetDeals.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDeals implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDeals'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealNonStrict[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\GetDealsRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealNonStrict[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealNonStrict[]|null $data The array of deals + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetDealsRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetDealsRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsCollection.php b/lib/Model/GetDealsCollection.php new file mode 100644 index 00000000..b63d6e4b --- /dev/null +++ b/lib/Model/GetDealsCollection.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsCollection implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsCollection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealCollectionResponseObject[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithCursorPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealCollectionResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealCollectionResponseObject[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithCursorPagination|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithCursorPagination|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsConversionRatesInPipeline.php b/lib/Model/GetDealsConversionRatesInPipeline.php new file mode 100644 index 00000000..8a33e89f --- /dev/null +++ b/lib/Model/GetDealsConversionRatesInPipeline.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsConversionRatesInPipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsConversionRatesInPipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsConversionRatesInPipelineAllOf.php b/lib/Model/GetDealsConversionRatesInPipelineAllOf.php new file mode 100644 index 00000000..9cfc29bc --- /dev/null +++ b/lib/Model/GetDealsConversionRatesInPipelineAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsConversionRatesInPipelineAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsConversionRatesInPipeline_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetDealsConversionRatesInPipelineAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsConversionRatesInPipelineAllOfData.php b/lib/Model/GetDealsConversionRatesInPipelineAllOfData.php new file mode 100644 index 00000000..90b8d45c --- /dev/null +++ b/lib/Model/GetDealsConversionRatesInPipelineAllOfData.php @@ -0,0 +1,403 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsConversionRatesInPipelineAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsConversionRatesInPipeline_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'stage_conversions' => '\Pipedrive\Model\StageConversions[]', + 'won_conversion' => 'int', + 'lost_conversion' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'stage_conversions' => null, + 'won_conversion' => null, + 'lost_conversion' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'stage_conversions' => 'stage_conversions', + 'won_conversion' => 'won_conversion', + 'lost_conversion' => 'lost_conversion' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'stage_conversions' => 'setStageConversions', + 'won_conversion' => 'setWonConversion', + 'lost_conversion' => 'setLostConversion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'stage_conversions' => 'getStageConversions', + 'won_conversion' => 'getWonConversion', + 'lost_conversion' => 'getLostConversion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['stage_conversions'] = $data['stage_conversions'] ?? null; + $this->container['won_conversion'] = $data['won_conversion'] ?? null; + $this->container['lost_conversion'] = $data['lost_conversion'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets stage_conversions + * + * @return \Pipedrive\Model\StageConversions[]|null + */ + public function getStageConversions() + { + return $this->container['stage_conversions']; + } + + /** + * Sets stage_conversions + * + * @param \Pipedrive\Model\StageConversions[]|null $stage_conversions The stage conversions + * + * @return self + */ + public function setStageConversions($stage_conversions): self + { + $this->container['stage_conversions'] = $stage_conversions; + + return $this; + } + + /** + * Gets won_conversion + * + * @return int|null + */ + public function getWonConversion() + { + return $this->container['won_conversion']; + } + + /** + * Sets won_conversion + * + * @param int|null $won_conversion The won conversion + * + * @return self + */ + public function setWonConversion($won_conversion): self + { + $this->container['won_conversion'] = $won_conversion; + + return $this; + } + + /** + * Gets lost_conversion + * + * @return int|null + */ + public function getLostConversion() + { + return $this->container['lost_conversion']; + } + + /** + * Sets lost_conversion + * + * @param int|null $lost_conversion The lost conversion + * + * @return self + */ + public function setLostConversion($lost_conversion): self + { + $this->container['lost_conversion'] = $lost_conversion; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsMovementsInPipeline.php b/lib/Model/GetDealsMovementsInPipeline.php new file mode 100644 index 00000000..510c2007 --- /dev/null +++ b/lib/Model/GetDealsMovementsInPipeline.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsMovementsInPipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsMovementsInPipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GetDealsMovementsInPipelineAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GetDealsMovementsInPipelineAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetDealsMovementsInPipelineAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsMovementsInPipelineAllOf.php b/lib/Model/GetDealsMovementsInPipelineAllOf.php new file mode 100644 index 00000000..636604e6 --- /dev/null +++ b/lib/Model/GetDealsMovementsInPipelineAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsMovementsInPipelineAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsMovementsInPipeline_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\GetDealsMovementsInPipelineAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\GetDealsMovementsInPipelineAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetDealsMovementsInPipelineAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsMovementsInPipelineAllOfData.php b/lib/Model/GetDealsMovementsInPipelineAllOfData.php new file mode 100644 index 00000000..10b49b83 --- /dev/null +++ b/lib/Model/GetDealsMovementsInPipelineAllOfData.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsMovementsInPipelineAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsMovementsInPipeline_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'movements_between_stages' => '\Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages', + 'new_deals' => '\Pipedrive\Model\DealsMovementsInfo', + 'deals_left_open' => '\Pipedrive\Model\DealsMovementsInfo', + 'won_deals' => '\Pipedrive\Model\DealsMovementsInfo', + 'lost_deals' => '\Pipedrive\Model\DealsMovementsInfo', + 'average_age_in_days' => '\Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDays' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'movements_between_stages' => null, + 'new_deals' => null, + 'deals_left_open' => null, + 'won_deals' => null, + 'lost_deals' => null, + 'average_age_in_days' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'movements_between_stages' => 'movements_between_stages', + 'new_deals' => 'new_deals', + 'deals_left_open' => 'deals_left_open', + 'won_deals' => 'won_deals', + 'lost_deals' => 'lost_deals', + 'average_age_in_days' => 'average_age_in_days' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'movements_between_stages' => 'setMovementsBetweenStages', + 'new_deals' => 'setNewDeals', + 'deals_left_open' => 'setDealsLeftOpen', + 'won_deals' => 'setWonDeals', + 'lost_deals' => 'setLostDeals', + 'average_age_in_days' => 'setAverageAgeInDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'movements_between_stages' => 'getMovementsBetweenStages', + 'new_deals' => 'getNewDeals', + 'deals_left_open' => 'getDealsLeftOpen', + 'won_deals' => 'getWonDeals', + 'lost_deals' => 'getLostDeals', + 'average_age_in_days' => 'getAverageAgeInDays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['movements_between_stages'] = $data['movements_between_stages'] ?? null; + $this->container['new_deals'] = $data['new_deals'] ?? null; + $this->container['deals_left_open'] = $data['deals_left_open'] ?? null; + $this->container['won_deals'] = $data['won_deals'] ?? null; + $this->container['lost_deals'] = $data['lost_deals'] ?? null; + $this->container['average_age_in_days'] = $data['average_age_in_days'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets movements_between_stages + * + * @return \Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages|null + */ + public function getMovementsBetweenStages() + { + return $this->container['movements_between_stages']; + } + + /** + * Sets movements_between_stages + * + * @param \Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages|null $movements_between_stages movements_between_stages + * + * @return self + */ + public function setMovementsBetweenStages($movements_between_stages): self + { + $this->container['movements_between_stages'] = $movements_between_stages; + + return $this; + } + + /** + * Gets new_deals + * + * @return \Pipedrive\Model\DealsMovementsInfo|null + */ + public function getNewDeals() + { + return $this->container['new_deals']; + } + + /** + * Sets new_deals + * + * @param \Pipedrive\Model\DealsMovementsInfo|null $new_deals new_deals + * + * @return self + */ + public function setNewDeals($new_deals): self + { + $this->container['new_deals'] = $new_deals; + + return $this; + } + + /** + * Gets deals_left_open + * + * @return \Pipedrive\Model\DealsMovementsInfo|null + */ + public function getDealsLeftOpen() + { + return $this->container['deals_left_open']; + } + + /** + * Sets deals_left_open + * + * @param \Pipedrive\Model\DealsMovementsInfo|null $deals_left_open deals_left_open + * + * @return self + */ + public function setDealsLeftOpen($deals_left_open): self + { + $this->container['deals_left_open'] = $deals_left_open; + + return $this; + } + + /** + * Gets won_deals + * + * @return \Pipedrive\Model\DealsMovementsInfo|null + */ + public function getWonDeals() + { + return $this->container['won_deals']; + } + + /** + * Sets won_deals + * + * @param \Pipedrive\Model\DealsMovementsInfo|null $won_deals won_deals + * + * @return self + */ + public function setWonDeals($won_deals): self + { + $this->container['won_deals'] = $won_deals; + + return $this; + } + + /** + * Gets lost_deals + * + * @return \Pipedrive\Model\DealsMovementsInfo|null + */ + public function getLostDeals() + { + return $this->container['lost_deals']; + } + + /** + * Sets lost_deals + * + * @param \Pipedrive\Model\DealsMovementsInfo|null $lost_deals lost_deals + * + * @return self + */ + public function setLostDeals($lost_deals): self + { + $this->container['lost_deals'] = $lost_deals; + + return $this; + } + + /** + * Gets average_age_in_days + * + * @return \Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDays|null + */ + public function getAverageAgeInDays() + { + return $this->container['average_age_in_days']; + } + + /** + * Sets average_age_in_days + * + * @param \Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDays|null $average_age_in_days average_age_in_days + * + * @return self + */ + public function setAverageAgeInDays($average_age_in_days): self + { + $this->container['average_age_in_days'] = $average_age_in_days; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.php b/lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.php new file mode 100644 index 00000000..a6190d29 --- /dev/null +++ b/lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDays.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsMovementsInPipelineAllOfDataAverageAgeInDays implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsMovementsInPipeline_allOf_data_average_age_in_days'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'across_all_stages' => 'int', + 'by_stages' => '\Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'across_all_stages' => null, + 'by_stages' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'across_all_stages' => 'across_all_stages', + 'by_stages' => 'by_stages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'across_all_stages' => 'setAcrossAllStages', + 'by_stages' => 'setByStages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'across_all_stages' => 'getAcrossAllStages', + 'by_stages' => 'getByStages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['across_all_stages'] = $data['across_all_stages'] ?? null; + $this->container['by_stages'] = $data['by_stages'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets across_all_stages + * + * @return int|null + */ + public function getAcrossAllStages() + { + return $this->container['across_all_stages']; + } + + /** + * Sets across_all_stages + * + * @param int|null $across_all_stages The moved deals average age across all stages + * + * @return self + */ + public function setAcrossAllStages($across_all_stages): self + { + $this->container['across_all_stages'] = $across_all_stages; + + return $this; + } + + /** + * Gets by_stages + * + * @return \Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages[]|null + */ + public function getByStages() + { + return $this->container['by_stages']; + } + + /** + * Sets by_stages + * + * @param \Pipedrive\Model\GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages[]|null $by_stages The moved deals average age by stages + * + * @return self + */ + public function setByStages($by_stages): self + { + $this->container['by_stages'] = $by_stages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.php b/lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.php new file mode 100644 index 00000000..8178f1ac --- /dev/null +++ b/lib/Model/GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsMovementsInPipelineAllOfDataAverageAgeInDaysByStages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsMovementsInPipeline_allOf_data_average_age_in_days_by_stages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'stage_id' => 'int', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'stage_id' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'stage_id' => 'stage_id', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'stage_id' => 'setStageId', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'stage_id' => 'getStageId', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The stage ID + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The average deals age in specific stage + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.php b/lib/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.php new file mode 100644 index 00000000..b07f3184 --- /dev/null +++ b/lib/Model/GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsMovementsInPipelineAllOfDataMovementsBetweenStages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsMovementsInPipeline_allOf_data_movements_between_stages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The count of the deals that have been moved between stages + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsRelatedObjects.php b/lib/Model/GetDealsRelatedObjects.php new file mode 100644 index 00000000..7ac7cb52 --- /dev/null +++ b/lib/Model/GetDealsRelatedObjects.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDeals_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user' => '\Pipedrive\Model\DealUserData', + 'organization' => '\Pipedrive\Model\DealOrganizationData', + 'person' => '\Pipedrive\Model\DealPersonData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user' => null, + 'organization' => null, + 'person' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user' => 'user', + 'organization' => 'organization', + 'person' => 'person' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user' => 'setUser', + 'organization' => 'setOrganization', + 'person' => 'setPerson' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user' => 'getUser', + 'organization' => 'getOrganization', + 'person' => 'getPerson' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user'] = $data['user'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + $this->container['person'] = $data['person'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user + * + * @return \Pipedrive\Model\DealUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\DealUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\DealOrganizationData|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\DealOrganizationData|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\DealPersonData|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\DealPersonData|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsSummary.php b/lib/Model/GetDealsSummary.php new file mode 100644 index 00000000..0dd581b0 --- /dev/null +++ b/lib/Model/GetDealsSummary.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsSummary implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GetDealsSummaryData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GetDealsSummaryData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetDealsSummaryData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsSummaryData.php b/lib/Model/GetDealsSummaryData.php new file mode 100644 index 00000000..400caf86 --- /dev/null +++ b/lib/Model/GetDealsSummaryData.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsSummaryData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsSummary_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'values_total' => '\Pipedrive\Model\GetDealsSummaryDataValuesTotal', + 'weighted_values_total' => '\Pipedrive\Model\GetDealsSummaryDataWeightedValuesTotal', + 'total_count' => 'int', + 'total_currency_converted_value' => 'float', + 'total_weighted_currency_converted_value' => 'float', + 'total_currency_converted_value_formatted' => 'string', + 'total_weighted_currency_converted_value_formatted' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'values_total' => null, + 'weighted_values_total' => null, + 'total_count' => null, + 'total_currency_converted_value' => null, + 'total_weighted_currency_converted_value' => null, + 'total_currency_converted_value_formatted' => null, + 'total_weighted_currency_converted_value_formatted' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'values_total' => 'values_total', + 'weighted_values_total' => 'weighted_values_total', + 'total_count' => 'total_count', + 'total_currency_converted_value' => 'total_currency_converted_value', + 'total_weighted_currency_converted_value' => 'total_weighted_currency_converted_value', + 'total_currency_converted_value_formatted' => 'total_currency_converted_value_formatted', + 'total_weighted_currency_converted_value_formatted' => 'total_weighted_currency_converted_value_formatted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'values_total' => 'setValuesTotal', + 'weighted_values_total' => 'setWeightedValuesTotal', + 'total_count' => 'setTotalCount', + 'total_currency_converted_value' => 'setTotalCurrencyConvertedValue', + 'total_weighted_currency_converted_value' => 'setTotalWeightedCurrencyConvertedValue', + 'total_currency_converted_value_formatted' => 'setTotalCurrencyConvertedValueFormatted', + 'total_weighted_currency_converted_value_formatted' => 'setTotalWeightedCurrencyConvertedValueFormatted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'values_total' => 'getValuesTotal', + 'weighted_values_total' => 'getWeightedValuesTotal', + 'total_count' => 'getTotalCount', + 'total_currency_converted_value' => 'getTotalCurrencyConvertedValue', + 'total_weighted_currency_converted_value' => 'getTotalWeightedCurrencyConvertedValue', + 'total_currency_converted_value_formatted' => 'getTotalCurrencyConvertedValueFormatted', + 'total_weighted_currency_converted_value_formatted' => 'getTotalWeightedCurrencyConvertedValueFormatted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['values_total'] = $data['values_total'] ?? null; + $this->container['weighted_values_total'] = $data['weighted_values_total'] ?? null; + $this->container['total_count'] = $data['total_count'] ?? null; + $this->container['total_currency_converted_value'] = $data['total_currency_converted_value'] ?? null; + $this->container['total_weighted_currency_converted_value'] = $data['total_weighted_currency_converted_value'] ?? null; + $this->container['total_currency_converted_value_formatted'] = $data['total_currency_converted_value_formatted'] ?? null; + $this->container['total_weighted_currency_converted_value_formatted'] = $data['total_weighted_currency_converted_value_formatted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets values_total + * + * @return \Pipedrive\Model\GetDealsSummaryDataValuesTotal|null + */ + public function getValuesTotal() + { + return $this->container['values_total']; + } + + /** + * Sets values_total + * + * @param \Pipedrive\Model\GetDealsSummaryDataValuesTotal|null $values_total values_total + * + * @return self + */ + public function setValuesTotal($values_total): self + { + $this->container['values_total'] = $values_total; + + return $this; + } + + /** + * Gets weighted_values_total + * + * @return \Pipedrive\Model\GetDealsSummaryDataWeightedValuesTotal|null + */ + public function getWeightedValuesTotal() + { + return $this->container['weighted_values_total']; + } + + /** + * Sets weighted_values_total + * + * @param \Pipedrive\Model\GetDealsSummaryDataWeightedValuesTotal|null $weighted_values_total weighted_values_total + * + * @return self + */ + public function setWeightedValuesTotal($weighted_values_total): self + { + $this->container['weighted_values_total'] = $weighted_values_total; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count The total number of deals + * + * @return self + */ + public function setTotalCount($total_count): self + { + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets total_currency_converted_value + * + * @return float|null + */ + public function getTotalCurrencyConvertedValue() + { + return $this->container['total_currency_converted_value']; + } + + /** + * Sets total_currency_converted_value + * + * @param float|null $total_currency_converted_value The total value of deals converted into the company default currency + * + * @return self + */ + public function setTotalCurrencyConvertedValue($total_currency_converted_value): self + { + $this->container['total_currency_converted_value'] = $total_currency_converted_value; + + return $this; + } + + /** + * Gets total_weighted_currency_converted_value + * + * @return float|null + */ + public function getTotalWeightedCurrencyConvertedValue() + { + return $this->container['total_weighted_currency_converted_value']; + } + + /** + * Sets total_weighted_currency_converted_value + * + * @param float|null $total_weighted_currency_converted_value The total weighted value of deals converted into the company default currency + * + * @return self + */ + public function setTotalWeightedCurrencyConvertedValue($total_weighted_currency_converted_value): self + { + $this->container['total_weighted_currency_converted_value'] = $total_weighted_currency_converted_value; + + return $this; + } + + /** + * Gets total_currency_converted_value_formatted + * + * @return string|null + */ + public function getTotalCurrencyConvertedValueFormatted() + { + return $this->container['total_currency_converted_value_formatted']; + } + + /** + * Sets total_currency_converted_value_formatted + * + * @param string|null $total_currency_converted_value_formatted The total converted value of deals formatted with the company default currency. E.g. US$5,100.96 + * + * @return self + */ + public function setTotalCurrencyConvertedValueFormatted($total_currency_converted_value_formatted): self + { + $this->container['total_currency_converted_value_formatted'] = $total_currency_converted_value_formatted; + + return $this; + } + + /** + * Gets total_weighted_currency_converted_value_formatted + * + * @return string|null + */ + public function getTotalWeightedCurrencyConvertedValueFormatted() + { + return $this->container['total_weighted_currency_converted_value_formatted']; + } + + /** + * Sets total_weighted_currency_converted_value_formatted + * + * @param string|null $total_weighted_currency_converted_value_formatted The total weighted value of deals formatted with the company default currency. E.g. US$5,100.96 + * + * @return self + */ + public function setTotalWeightedCurrencyConvertedValueFormatted($total_weighted_currency_converted_value_formatted): self + { + $this->container['total_weighted_currency_converted_value_formatted'] = $total_weighted_currency_converted_value_formatted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsSummaryDataValuesTotal.php b/lib/Model/GetDealsSummaryDataValuesTotal.php new file mode 100644 index 00000000..345a7bc5 --- /dev/null +++ b/lib/Model/GetDealsSummaryDataValuesTotal.php @@ -0,0 +1,463 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsSummaryDataValuesTotal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsSummary_data_values_total'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'float', + 'count' => 'int', + 'value_converted' => 'float', + 'value_formatted' => 'string', + 'value_converted_formatted' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'count' => null, + 'value_converted' => null, + 'value_formatted' => null, + 'value_converted_formatted' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'count' => 'count', + 'value_converted' => 'value_converted', + 'value_formatted' => 'value_formatted', + 'value_converted_formatted' => 'value_converted_formatted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'count' => 'setCount', + 'value_converted' => 'setValueConverted', + 'value_formatted' => 'setValueFormatted', + 'value_converted_formatted' => 'setValueConvertedFormatted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'count' => 'getCount', + 'value_converted' => 'getValueConverted', + 'value_formatted' => 'getValueFormatted', + 'value_converted_formatted' => 'getValueConvertedFormatted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['value_converted'] = $data['value_converted'] ?? null; + $this->container['value_formatted'] = $data['value_formatted'] ?? null; + $this->container['value_converted_formatted'] = $data['value_converted_formatted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The total value of deals in the deal currency group + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The number of deals in the deal currency group + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets value_converted + * + * @return float|null + */ + public function getValueConverted() + { + return $this->container['value_converted']; + } + + /** + * Sets value_converted + * + * @param float|null $value_converted The total value of deals converted into the company default currency + * + * @return self + */ + public function setValueConverted($value_converted): self + { + $this->container['value_converted'] = $value_converted; + + return $this; + } + + /** + * Gets value_formatted + * + * @return string|null + */ + public function getValueFormatted() + { + return $this->container['value_formatted']; + } + + /** + * Sets value_formatted + * + * @param string|null $value_formatted The total value of deals formatted with deal currency. E.g. €50 + * + * @return self + */ + public function setValueFormatted($value_formatted): self + { + $this->container['value_formatted'] = $value_formatted; + + return $this; + } + + /** + * Gets value_converted_formatted + * + * @return string|null + */ + public function getValueConvertedFormatted() + { + return $this->container['value_converted_formatted']; + } + + /** + * Sets value_converted_formatted + * + * @param string|null $value_converted_formatted The value_converted formatted with deal currency. E.g. US$50.10 + * + * @return self + */ + public function setValueConvertedFormatted($value_converted_formatted): self + { + $this->container['value_converted_formatted'] = $value_converted_formatted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsSummaryDataWeightedValuesTotal.php b/lib/Model/GetDealsSummaryDataWeightedValuesTotal.php new file mode 100644 index 00000000..a4df0863 --- /dev/null +++ b/lib/Model/GetDealsSummaryDataWeightedValuesTotal.php @@ -0,0 +1,403 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsSummaryDataWeightedValuesTotal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsSummary_data_weighted_values_total'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'float', + 'count' => 'int', + 'value_formatted' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'count' => null, + 'value_formatted' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'count' => 'count', + 'value_formatted' => 'value_formatted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'count' => 'setCount', + 'value_formatted' => 'setValueFormatted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'count' => 'getCount', + 'value_formatted' => 'getValueFormatted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['value_formatted'] = $data['value_formatted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The total weighted value of the deals in the deal currency group + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The number of deals in the deal currency group + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets value_formatted + * + * @return string|null + */ + public function getValueFormatted() + { + return $this->container['value_formatted']; + } + + /** + * Sets value_formatted + * + * @param string|null $value_formatted The total weighted value of the deals formatted with deal currency. E.g. €50 + * + * @return self + */ + public function setValueFormatted($value_formatted): self + { + $this->container['value_formatted'] = $value_formatted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsTimeline.php b/lib/Model/GetDealsTimeline.php new file mode 100644 index 00000000..4c2cc3c0 --- /dev/null +++ b/lib/Model/GetDealsTimeline.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsTimeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsTimeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GetDealsTimelineData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GetDealsTimelineData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetDealsTimelineData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsTimelineData.php b/lib/Model/GetDealsTimelineData.php new file mode 100644 index 00000000..4e87a912 --- /dev/null +++ b/lib/Model/GetDealsTimelineData.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsTimelineData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsTimeline_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'period_start' => 'string', + 'period_end' => 'string', + 'deals' => '\Pipedrive\Model\DealStrict[]', + 'totals' => '\Pipedrive\Model\GetDealsTimelineDataTotals' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'period_start' => null, + 'period_end' => null, + 'deals' => null, + 'totals' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'period_start' => 'period_start', + 'period_end' => 'period_end', + 'deals' => 'deals', + 'totals' => 'totals' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'period_start' => 'setPeriodStart', + 'period_end' => 'setPeriodEnd', + 'deals' => 'setDeals', + 'totals' => 'setTotals' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'period_start' => 'getPeriodStart', + 'period_end' => 'getPeriodEnd', + 'deals' => 'getDeals', + 'totals' => 'getTotals' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['period_start'] = $data['period_start'] ?? null; + $this->container['period_end'] = $data['period_end'] ?? null; + $this->container['deals'] = $data['deals'] ?? null; + $this->container['totals'] = $data['totals'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_start + * + * @return string|null + */ + public function getPeriodStart() + { + return $this->container['period_start']; + } + + /** + * Sets period_start + * + * @param string|null $period_start The start date and time of the period + * + * @return self + */ + public function setPeriodStart($period_start): self + { + $this->container['period_start'] = $period_start; + + return $this; + } + + /** + * Gets period_end + * + * @return string|null + */ + public function getPeriodEnd() + { + return $this->container['period_end']; + } + + /** + * Sets period_end + * + * @param string|null $period_end The end date and time of the period + * + * @return self + */ + public function setPeriodEnd($period_end): self + { + $this->container['period_end'] = $period_end; + + return $this; + } + + /** + * Gets deals + * + * @return \Pipedrive\Model\DealStrict[]|null + */ + public function getDeals() + { + return $this->container['deals']; + } + + /** + * Sets deals + * + * @param \Pipedrive\Model\DealStrict[]|null $deals deals + * + * @return self + */ + public function setDeals($deals): self + { + $this->container['deals'] = $deals; + + return $this; + } + + /** + * Gets totals + * + * @return \Pipedrive\Model\GetDealsTimelineDataTotals|null + */ + public function getTotals() + { + return $this->container['totals']; + } + + /** + * Sets totals + * + * @param \Pipedrive\Model\GetDealsTimelineDataTotals|null $totals totals + * + * @return self + */ + public function setTotals($totals): self + { + $this->container['totals'] = $totals; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDealsTimelineDataTotals.php b/lib/Model/GetDealsTimelineDataTotals.php new file mode 100644 index 00000000..03dc9bc0 --- /dev/null +++ b/lib/Model/GetDealsTimelineDataTotals.php @@ -0,0 +1,553 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDealsTimelineDataTotals implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDealsTimeline_data_totals'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'count' => 'int', + 'values' => 'object', + 'weighted_values' => 'object', + 'open_count' => 'int', + 'open_values' => 'object', + 'weighted_open_values' => 'object', + 'won_count' => 'int', + 'won_values' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'values' => null, + 'weighted_values' => null, + 'open_count' => null, + 'open_values' => null, + 'weighted_open_values' => null, + 'won_count' => null, + 'won_values' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'values' => 'values', + 'weighted_values' => 'weighted_values', + 'open_count' => 'open_count', + 'open_values' => 'open_values', + 'weighted_open_values' => 'weighted_open_values', + 'won_count' => 'won_count', + 'won_values' => 'won_values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'values' => 'setValues', + 'weighted_values' => 'setWeightedValues', + 'open_count' => 'setOpenCount', + 'open_values' => 'setOpenValues', + 'weighted_open_values' => 'setWeightedOpenValues', + 'won_count' => 'setWonCount', + 'won_values' => 'setWonValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'values' => 'getValues', + 'weighted_values' => 'getWeightedValues', + 'open_count' => 'getOpenCount', + 'open_values' => 'getOpenValues', + 'weighted_open_values' => 'getWeightedOpenValues', + 'won_count' => 'getWonCount', + 'won_values' => 'getWonValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['values'] = $data['values'] ?? null; + $this->container['weighted_values'] = $data['weighted_values'] ?? null; + $this->container['open_count'] = $data['open_count'] ?? null; + $this->container['open_values'] = $data['open_values'] ?? null; + $this->container['weighted_open_values'] = $data['weighted_open_values'] ?? null; + $this->container['won_count'] = $data['won_count'] ?? null; + $this->container['won_values'] = $data['won_values'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count The number of deals for the given period + * + * @return self + */ + public function setCount($count): self + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets values + * + * @return object|null + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param object|null $values The total values of deals grouped by deal currency + * + * @return self + */ + public function setValues($values): self + { + $this->container['values'] = $values; + + return $this; + } + + /** + * Gets weighted_values + * + * @return object|null + */ + public function getWeightedValues() + { + return $this->container['weighted_values']; + } + + /** + * Sets weighted_values + * + * @param object|null $weighted_values The total weighted values of deals for the given period grouped by deal currency. The weighted value of a deal is calculated as probability times deal value. + * + * @return self + */ + public function setWeightedValues($weighted_values): self + { + $this->container['weighted_values'] = $weighted_values; + + return $this; + } + + /** + * Gets open_count + * + * @return int|null + */ + public function getOpenCount() + { + return $this->container['open_count']; + } + + /** + * Sets open_count + * + * @param int|null $open_count The number of open deals for the given period + * + * @return self + */ + public function setOpenCount($open_count): self + { + $this->container['open_count'] = $open_count; + + return $this; + } + + /** + * Gets open_values + * + * @return object|null + */ + public function getOpenValues() + { + return $this->container['open_values']; + } + + /** + * Sets open_values + * + * @param object|null $open_values The total values of open deals for the given period grouped by deal currency + * + * @return self + */ + public function setOpenValues($open_values): self + { + $this->container['open_values'] = $open_values; + + return $this; + } + + /** + * Gets weighted_open_values + * + * @return object|null + */ + public function getWeightedOpenValues() + { + return $this->container['weighted_open_values']; + } + + /** + * Sets weighted_open_values + * + * @param object|null $weighted_open_values The total weighted values of open deals for the given period grouped by deal currency. The weighted value of a deal is calculated as probability times deal value. + * + * @return self + */ + public function setWeightedOpenValues($weighted_open_values): self + { + $this->container['weighted_open_values'] = $weighted_open_values; + + return $this; + } + + /** + * Gets won_count + * + * @return int|null + */ + public function getWonCount() + { + return $this->container['won_count']; + } + + /** + * Sets won_count + * + * @param int|null $won_count The number of won deals for the given period + * + * @return self + */ + public function setWonCount($won_count): self + { + $this->container['won_count'] = $won_count; + + return $this; + } + + /** + * Gets won_values + * + * @return object|null + */ + public function getWonValues() + { + return $this->container['won_values']; + } + + /** + * Sets won_values + * + * @param object|null $won_values The total values of won deals for the given period grouped by deal currency + * + * @return self + */ + public function setWonValues($won_values): self + { + $this->container['won_values'] = $won_values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetDuplicatedDeal.php b/lib/Model/GetDuplicatedDeal.php new file mode 100644 index 00000000..ad9f8c4e --- /dev/null +++ b/lib/Model/GetDuplicatedDeal.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDuplicatedDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetDuplicatedDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealStrict' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealStrict|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealStrict|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetGoalResultResponse200.php b/lib/Model/GetGoalResultResponse200.php new file mode 100644 index 00000000..a91fd8de --- /dev/null +++ b/lib/Model/GetGoalResultResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetGoalResultResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getGoalResultResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GoalResults' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GoalResults|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GoalResults|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetGoalsResponse200.php b/lib/Model/GetGoalsResponse200.php new file mode 100644 index 00000000..9f209c83 --- /dev/null +++ b/lib/Model/GetGoalsResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetGoalsResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getGoalsResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FindGoalResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FindGoalResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FindGoalResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetLeadLabelsResponse200.php b/lib/Model/GetLeadLabelsResponse200.php new file mode 100644 index 00000000..28b72858 --- /dev/null +++ b/lib/Model/GetLeadLabelsResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLeadLabelsResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getLeadLabelsResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\LeadLabelResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadLabelResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadLabelResponse[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetLeadSourcesResponse200.php b/lib/Model/GetLeadSourcesResponse200.php new file mode 100644 index 00000000..ebc0d98a --- /dev/null +++ b/lib/Model/GetLeadSourcesResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLeadSourcesResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getLeadSourcesResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GetLeadSourcesResponse200Data[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GetLeadSourcesResponse200Data[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetLeadSourcesResponse200Data[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetLeadSourcesResponse200Data.php b/lib/Model/GetLeadSourcesResponse200Data.php new file mode 100644 index 00000000..9870ed79 --- /dev/null +++ b/lib/Model/GetLeadSourcesResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLeadSourcesResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getLeadSourcesResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The unique name of a lead source + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetLeadsResponse200.php b/lib/Model/GetLeadsResponse200.php new file mode 100644 index 00000000..def41d30 --- /dev/null +++ b/lib/Model/GetLeadsResponse200.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLeadsResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'getLeadsResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\LeadResponse[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadResponse[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetMergedDeal.php b/lib/Model/GetMergedDeal.php new file mode 100644 index 00000000..00bc3c48 --- /dev/null +++ b/lib/Model/GetMergedDeal.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetMergedDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetMergedDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealStrictWithMergeId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealStrictWithMergeId|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealStrictWithMergeId|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetNotes.php b/lib/Model/GetNotes.php new file mode 100644 index 00000000..74a352ec --- /dev/null +++ b/lib/Model/GetNotes.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetNotes implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetNotes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseNote[]', + 'additional_data' => '\Pipedrive\Model\AdditionalDataWithOffsetPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseNote[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseNote[]|null $data The array of notes + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalDataWithOffsetPagination|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalDataWithOffsetPagination|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetOneFile.php b/lib/Model/GetOneFile.php new file mode 100644 index 00000000..fca4dddc --- /dev/null +++ b/lib/Model/GetOneFile.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetOneFile implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetOneFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetOnePipeline.php b/lib/Model/GetOnePipeline.php new file mode 100644 index 00000000..d7fdcfb3 --- /dev/null +++ b/lib/Model/GetOnePipeline.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetOnePipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetOnePipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PipelineDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PipelineDetails|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PipelineDetails|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetOnePipelineAllOf.php b/lib/Model/GetOnePipelineAllOf.php new file mode 100644 index 00000000..1aff048d --- /dev/null +++ b/lib/Model/GetOnePipelineAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetOnePipelineAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetOnePipeline_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PipelineDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PipelineDetails|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PipelineDetails|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetOneStage.php b/lib/Model/GetOneStage.php new file mode 100644 index 00000000..0f073847 --- /dev/null +++ b/lib/Model/GetOneStage.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetOneStage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetOneStage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\StageDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\StageDetails|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\StageDetails|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetPersonDetailsResponse.php b/lib/Model/GetPersonDetailsResponse.php new file mode 100644 index 00000000..8fb1c2e9 --- /dev/null +++ b/lib/Model/GetPersonDetailsResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetPersonDetailsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetPersonDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonItem', + 'additional_data' => '\Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetPersonDetailsResponseAllOf.php b/lib/Model/GetPersonDetailsResponseAllOf.php new file mode 100644 index 00000000..d1e3f9c3 --- /dev/null +++ b/lib/Model/GetPersonDetailsResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetPersonDetailsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetPersonDetailsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PersonItem', + 'additional_data' => '\Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\GetPersonDetailsResponseAllOfAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetPersonDetailsResponseAllOfAdditionalData.php b/lib/Model/GetPersonDetailsResponseAllOfAdditionalData.php new file mode 100644 index 00000000..2c343b10 --- /dev/null +++ b/lib/Model/GetPersonDetailsResponseAllOfAdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetPersonDetailsResponseAllOfAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetPersonDetailsResponse_allOf_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'dropbox_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dropbox_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'dropbox_email' => 'dropbox_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dropbox_email' => 'setDropboxEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dropbox_email' => 'getDropboxEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['dropbox_email'] = $data['dropbox_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets dropbox_email + * + * @return string|null + */ + public function getDropboxEmail() + { + return $this->container['dropbox_email']; + } + + /** + * Sets dropbox_email + * + * @param string|null $dropbox_email Dropbox email for the person + * + * @return self + */ + public function setDropboxEmail($dropbox_email): self + { + $this->container['dropbox_email'] = $dropbox_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetProductAttachementDetails.php b/lib/Model/GetProductAttachementDetails.php new file mode 100644 index 00000000..aea6bab0 --- /dev/null +++ b/lib/Model/GetProductAttachementDetails.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetProductAttachementDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetProductAttachementDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'ProductAttachmentDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return ProductAttachmentDetails|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param ProductAttachmentDetails|null $data The updated product object attached to the deal + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetProductFieldResponse.php b/lib/Model/GetProductFieldResponse.php new file mode 100644 index 00000000..728bf6ee --- /dev/null +++ b/lib/Model/GetProductFieldResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetProductFieldResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetProductFieldResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'ProductField' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return ProductField|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param ProductField|null $data All data for the product field + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRecents.php b/lib/Model/GetRecents.php new file mode 100644 index 00000000..c4d1e08f --- /dev/null +++ b/lib/Model/GetRecents.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRecents implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRecents'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\AnyOfRecents[]', + 'additional_data' => '\Pipedrive\Model\GetRecentsAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return AnyOfRecents[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param AnyOfRecents[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\GetRecentsAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\GetRecentsAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRecentsAdditionalData.php b/lib/Model/GetRecentsAdditionalData.php new file mode 100644 index 00000000..6fdd346a --- /dev/null +++ b/lib/Model/GetRecentsAdditionalData.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRecentsAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRecentsAdditionalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'since_timestamp' => 'string', + 'last_timestamp_on_page' => 'string', + 'pagination' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'since_timestamp' => null, + 'last_timestamp_on_page' => null, + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'since_timestamp' => 'since_timestamp', + 'last_timestamp_on_page' => 'last_timestamp_on_page', + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'since_timestamp' => 'setSinceTimestamp', + 'last_timestamp_on_page' => 'setLastTimestampOnPage', + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'since_timestamp' => 'getSinceTimestamp', + 'last_timestamp_on_page' => 'getLastTimestampOnPage', + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['since_timestamp'] = $data['since_timestamp'] ?? null; + $this->container['last_timestamp_on_page'] = $data['last_timestamp_on_page'] ?? null; + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets since_timestamp + * + * @return string|null + */ + public function getSinceTimestamp() + { + return $this->container['since_timestamp']; + } + + /** + * Sets since_timestamp + * + * @param string|null $since_timestamp The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setSinceTimestamp($since_timestamp): self + { + $this->container['since_timestamp'] = $since_timestamp; + + return $this; + } + + /** + * Gets last_timestamp_on_page + * + * @return string|null + */ + public function getLastTimestampOnPage() + { + return $this->container['last_timestamp_on_page']; + } + + /** + * Sets last_timestamp_on_page + * + * @param string|null $last_timestamp_on_page The timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setLastTimestampOnPage($last_timestamp_on_page): self + { + $this->container['last_timestamp_on_page'] = $last_timestamp_on_page; + + return $this; + } + + /** + * Gets pagination + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Pipedrive\Model\AdditionalData|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRole.php b/lib/Model/GetRole.php new file mode 100644 index 00000000..c098dbf7 --- /dev/null +++ b/lib/Model/GetRole.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\SubRole', + 'additional_data' => '\Pipedrive\Model\GetRoleAllOfAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\SubRole|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\SubRole|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\GetRoleAllOfAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\GetRoleAllOfAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoleAllOf.php b/lib/Model/GetRoleAllOf.php new file mode 100644 index 00000000..1c50c3f9 --- /dev/null +++ b/lib/Model/GetRoleAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoleAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRole_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\SubRole', + 'additional_data' => '\Pipedrive\Model\GetRoleAllOfAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\SubRole|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\SubRole|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\GetRoleAllOfAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\GetRoleAllOfAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoleAllOfAdditionalData.php b/lib/Model/GetRoleAllOfAdditionalData.php new file mode 100644 index 00000000..87b1ffbe --- /dev/null +++ b/lib/Model/GetRoleAllOfAdditionalData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoleAllOfAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRole_allOf_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'settings' => '\Pipedrive\Model\RoleSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'settings' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['settings'] = $data['settings'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets settings + * + * @return \Pipedrive\Model\RoleSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \Pipedrive\Model\RoleSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings): self + { + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoleAssignments.php b/lib/Model/GetRoleAssignments.php new file mode 100644 index 00000000..e89f47d2 --- /dev/null +++ b/lib/Model/GetRoleAssignments.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoleAssignments implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRoleAssignments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\RoleAssignment[]', + 'additional_data' => '\Pipedrive\Model\RolesAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\RoleAssignment[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RoleAssignment[]|null $data The role assignments + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\RolesAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\RolesAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoleAssignmentsAllOf.php b/lib/Model/GetRoleAssignmentsAllOf.php new file mode 100644 index 00000000..e0131499 --- /dev/null +++ b/lib/Model/GetRoleAssignmentsAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoleAssignmentsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRoleAssignments_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\RoleAssignment[]', + 'additional_data' => '\Pipedrive\Model\RolesAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\RoleAssignment[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RoleAssignment[]|null $data The role assignments + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\RolesAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\RolesAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRolePipelines.php b/lib/Model/GetRolePipelines.php new file mode 100644 index 00000000..6249d761 --- /dev/null +++ b/lib/Model/GetRolePipelines.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRolePipelines implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRolePipelines'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\GetRolePipelinesAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\GetRolePipelinesAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetRolePipelinesAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRolePipelinesAllOf.php b/lib/Model/GetRolePipelinesAllOf.php new file mode 100644 index 00000000..cfbc9b54 --- /dev/null +++ b/lib/Model/GetRolePipelinesAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRolePipelinesAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRolePipelines_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\GetRolePipelinesAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\GetRolePipelinesAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\GetRolePipelinesAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRolePipelinesAllOfData.php b/lib/Model/GetRolePipelinesAllOfData.php new file mode 100644 index 00000000..823e9099 --- /dev/null +++ b/lib/Model/GetRolePipelinesAllOfData.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRolePipelinesAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRolePipelines_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pipeline_ids' => 'float[]', + 'visible' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pipeline_ids' => null, + 'visible' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pipeline_ids' => 'pipeline_ids', + 'visible' => 'visible' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pipeline_ids' => 'setPipelineIds', + 'visible' => 'setVisible' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pipeline_ids' => 'getPipelineIds', + 'visible' => 'getVisible' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pipeline_ids'] = $data['pipeline_ids'] ?? null; + $this->container['visible'] = $data['visible'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pipeline_ids + * + * @return float[]|null + */ + public function getPipelineIds() + { + return $this->container['pipeline_ids']; + } + + /** + * Sets pipeline_ids + * + * @param float[]|null $pipeline_ids Either visible or hidden pipeline ids + * + * @return self + */ + public function setPipelineIds($pipeline_ids): self + { + $this->container['pipeline_ids'] = $pipeline_ids; + + return $this; + } + + /** + * Gets visible + * + * @return bool|null + */ + public function getVisible() + { + return $this->container['visible']; + } + + /** + * Sets visible + * + * @param bool|null $visible Whether visible or hidden pipeline ids were returned + * + * @return self + */ + public function setVisible($visible): self + { + $this->container['visible'] = $visible; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoleSettings.php b/lib/Model/GetRoleSettings.php new file mode 100644 index 00000000..e7454033 --- /dev/null +++ b/lib/Model/GetRoleSettings.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoleSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRoleSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\RoleSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\RoleSettings|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RoleSettings|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoleSettingsAllOf.php b/lib/Model/GetRoleSettingsAllOf.php new file mode 100644 index 00000000..19fb82b4 --- /dev/null +++ b/lib/Model/GetRoleSettingsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoleSettingsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRoleSettings_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\RoleSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\RoleSettings|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RoleSettings|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRoles.php b/lib/Model/GetRoles.php new file mode 100644 index 00000000..ae6cc38c --- /dev/null +++ b/lib/Model/GetRoles.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRoles implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRoles'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FullRole[]', + 'additional_data' => '\Pipedrive\Model\RolesAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FullRole[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FullRole[]|null $data The array of roles + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\RolesAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\RolesAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetRolesAllOf.php b/lib/Model/GetRolesAllOf.php new file mode 100644 index 00000000..a3487e09 --- /dev/null +++ b/lib/Model/GetRolesAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRolesAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetRoles_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FullRole[]', + 'additional_data' => '\Pipedrive\Model\RolesAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FullRole[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FullRole[]|null $data The array of roles + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\RolesAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\RolesAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetStageDeals.php b/lib/Model/GetStageDeals.php new file mode 100644 index 00000000..4fc8e525 --- /dev/null +++ b/lib/Model/GetStageDeals.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetStageDeals implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetStageDeals'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealStrict[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealStrict[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealStrict[]|null $data The array of deals + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GetStages.php b/lib/Model/GetStages.php new file mode 100644 index 00000000..b7c83061 --- /dev/null +++ b/lib/Model/GetStages.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetStages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GetStages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\StageWithPipelineInfo[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\StageWithPipelineInfo[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\StageWithPipelineInfo[]|null $data The array of stages + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GoalResults.php b/lib/Model/GoalResults.php new file mode 100644 index 00000000..dcadbdc9 --- /dev/null +++ b/lib/Model/GoalResults.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GoalResults implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GoalResults'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'progress' => 'int', + 'goal' => '\Pipedrive\Model\GoalsResponseComponent' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'progress' => null, + 'goal' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'progress' => 'progress', + 'goal' => 'goal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'progress' => 'setProgress', + 'goal' => 'setGoal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'progress' => 'getProgress', + 'goal' => 'getGoal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['progress'] = $data['progress'] ?? null; + $this->container['goal'] = $data['goal'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets progress + * + * @return int|null + */ + public function getProgress() + { + return $this->container['progress']; + } + + /** + * Sets progress + * + * @param int|null $progress The numeric progress of the goal + * + * @return self + */ + public function setProgress($progress): self + { + $this->container['progress'] = $progress; + + return $this; + } + + /** + * Gets goal + * + * @return \Pipedrive\Model\GoalsResponseComponent|null + */ + public function getGoal() + { + return $this->container['goal']; + } + + /** + * Sets goal + * + * @param \Pipedrive\Model\GoalsResponseComponent|null $goal goal + * + * @return self + */ + public function setGoal($goal): self + { + $this->container['goal'] = $goal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GoalType.php b/lib/Model/GoalType.php new file mode 100644 index 00000000..03213078 --- /dev/null +++ b/lib/Model/GoalType.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GoalType implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GoalType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'params' => '\Pipedrive\Model\Params' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'params' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'params' => 'params' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'params' => 'setParams' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'params' => 'getParams' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['params'] = $data['params'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the goal type + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets params + * + * @return \Pipedrive\Model\Params|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param \Pipedrive\Model\Params|null $params params + * + * @return self + */ + public function setParams($params): self + { + $this->container['params'] = $params; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/GoalsResponseComponent.php b/lib/Model/GoalsResponseComponent.php new file mode 100644 index 00000000..212de2ac --- /dev/null +++ b/lib/Model/GoalsResponseComponent.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GoalsResponseComponent implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'GoalsResponseComponent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'owner_id' => 'int', + 'title' => 'string', + 'type' => '\Pipedrive\Model\GoalType', + 'assignee' => '\Pipedrive\Model\Assignee', + 'interval' => 'string', + 'duration' => '\Pipedrive\Model\Duration', + 'expected_outcome' => '\Pipedrive\Model\ExpectedOutcome', + 'is_active' => 'bool', + 'report_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'owner_id' => null, + 'title' => null, + 'type' => null, + 'assignee' => null, + 'interval' => null, + 'duration' => null, + 'expected_outcome' => null, + 'is_active' => null, + 'report_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'owner_id' => 'owner_id', + 'title' => 'title', + 'type' => 'type', + 'assignee' => 'assignee', + 'interval' => 'interval', + 'duration' => 'duration', + 'expected_outcome' => 'expected_outcome', + 'is_active' => 'is_active', + 'report_ids' => 'report_ids' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'owner_id' => 'setOwnerId', + 'title' => 'setTitle', + 'type' => 'setType', + 'assignee' => 'setAssignee', + 'interval' => 'setInterval', + 'duration' => 'setDuration', + 'expected_outcome' => 'setExpectedOutcome', + 'is_active' => 'setIsActive', + 'report_ids' => 'setReportIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'owner_id' => 'getOwnerId', + 'title' => 'getTitle', + 'type' => 'getType', + 'assignee' => 'getAssignee', + 'interval' => 'getInterval', + 'duration' => 'getDuration', + 'expected_outcome' => 'getExpectedOutcome', + 'is_active' => 'getIsActive', + 'report_ids' => 'getReportIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['assignee'] = $data['assignee'] ?? null; + $this->container['interval'] = $data['interval'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['expected_outcome'] = $data['expected_outcome'] ?? null; + $this->container['is_active'] = $data['is_active'] ?? null; + $this->container['report_ids'] = $data['report_ids'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the goal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the creator of the goal + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the goal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return \Pipedrive\Model\GoalType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Pipedrive\Model\GoalType|null $type type + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets assignee + * + * @return \Pipedrive\Model\Assignee|null + */ + public function getAssignee() + { + return $this->container['assignee']; + } + + /** + * Sets assignee + * + * @param \Pipedrive\Model\Assignee|null $assignee assignee + * + * @return self + */ + public function setAssignee($assignee): self + { + $this->container['assignee'] = $assignee; + + return $this; + } + + /** + * Gets interval + * + * @return string|null + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string|null $interval The interval of the goal + * + * @return self + */ + public function setInterval($interval): self + { + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets duration + * + * @return \Pipedrive\Model\Duration|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param \Pipedrive\Model\Duration|null $duration duration + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets expected_outcome + * + * @return \Pipedrive\Model\ExpectedOutcome|null + */ + public function getExpectedOutcome() + { + return $this->container['expected_outcome']; + } + + /** + * Sets expected_outcome + * + * @param \Pipedrive\Model\ExpectedOutcome|null $expected_outcome expected_outcome + * + * @return self + */ + public function setExpectedOutcome($expected_outcome): self + { + $this->container['expected_outcome'] = $expected_outcome; + + return $this; + } + + /** + * Gets is_active + * + * @return bool|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool|null $is_active Whether the goal is currently active or not + * + * @return self + */ + public function setIsActive($is_active): self + { + $this->container['is_active'] = $is_active; + + return $this; + } + + /** + * Gets report_ids + * + * @return string[]|null + */ + public function getReportIds() + { + return $this->container['report_ids']; + } + + /** + * Sets report_ids + * + * @param string[]|null $report_ids The IDs of the reports that belong to the goal + * + * @return self + */ + public function setReportIds($report_ids): self + { + $this->container['report_ids'] = $report_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/IconKey.php b/lib/Model/IconKey.php new file mode 100644 index 00000000..2f15ab68 --- /dev/null +++ b/lib/Model/IconKey.php @@ -0,0 +1,177 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\MessageObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\MessageObject|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MessageObject|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse400.php b/lib/Model/InlineResponse400.php new file mode 100644 index 00000000..2ecc27a0 --- /dev/null +++ b/lib/Model/InlineResponse400.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse400 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_400'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'additional_data' => '\Pipedrive\Model\InlineResponse400AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error description + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info error_info + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\InlineResponse400AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\InlineResponse400AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse4001.php b/lib/Model/InlineResponse4001.php new file mode 100644 index 00000000..24ef27f5 --- /dev/null +++ b/lib/Model/InlineResponse4001.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse4001 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_400_1'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'additional_data' => '\Pipedrive\Model\InlineResponse4001AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error description + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info error_info + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\InlineResponse4001AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\InlineResponse4001AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse4001AdditionalData.php b/lib/Model/InlineResponse4001AdditionalData.php new file mode 100644 index 00000000..950c1bd3 --- /dev/null +++ b/lib/Model/InlineResponse4001AdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse4001AdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_400_1_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = $data['code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code An error code sent by the API + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse400AdditionalData.php b/lib/Model/InlineResponse400AdditionalData.php new file mode 100644 index 00000000..2c28adbe --- /dev/null +++ b/lib/Model/InlineResponse400AdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse400AdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_400_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = $data['code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code An error code sent by the API + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse403.php b/lib/Model/InlineResponse403.php new file mode 100644 index 00000000..9651990f --- /dev/null +++ b/lib/Model/InlineResponse403.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse403 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_403'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'additional_data' => '\Pipedrive\Model\InlineResponse403AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error description + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info error_info + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\InlineResponse403AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\InlineResponse403AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse4031.php b/lib/Model/InlineResponse4031.php new file mode 100644 index 00000000..87220310 --- /dev/null +++ b/lib/Model/InlineResponse4031.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse4031 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_403_1'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'additional_data' => '\Pipedrive\Model\InlineResponse4031AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error description + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info error_info + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\InlineResponse4031AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\InlineResponse4031AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse4031AdditionalData.php b/lib/Model/InlineResponse4031AdditionalData.php new file mode 100644 index 00000000..2e31c92c --- /dev/null +++ b/lib/Model/InlineResponse4031AdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse4031AdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_403_1_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = $data['code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code An error code sent by the API + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse403AdditionalData.php b/lib/Model/InlineResponse403AdditionalData.php new file mode 100644 index 00000000..40edb7c1 --- /dev/null +++ b/lib/Model/InlineResponse403AdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse403AdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_403_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = $data['code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code An error code sent by the API + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse404.php b/lib/Model/InlineResponse404.php new file mode 100644 index 00000000..f0740f41 --- /dev/null +++ b/lib/Model/InlineResponse404.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse404 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_404'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'additional_data' => '\Pipedrive\Model\InlineResponse404AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error description + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info error_info + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\InlineResponse404AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\InlineResponse404AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/InlineResponse404AdditionalData.php b/lib/Model/InlineResponse404AdditionalData.php new file mode 100644 index 00000000..8700a59b --- /dev/null +++ b/lib/Model/InlineResponse404AdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InlineResponse404AdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'inline_response_404_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = $data['code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code An error code sent by the API + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchAdditionalData.php b/lib/Model/ItemSearchAdditionalData.php new file mode 100644 index 00000000..afc86cb3 --- /dev/null +++ b/lib/Model/ItemSearchAdditionalData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchAdditionalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pagination' => '\Pipedrive\Model\ItemSearchAdditionalDataPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \Pipedrive\Model\ItemSearchAdditionalDataPagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Pipedrive\Model\ItemSearchAdditionalDataPagination|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchAdditionalDataPagination.php b/lib/Model/ItemSearchAdditionalDataPagination.php new file mode 100644 index 00000000..35a5e09b --- /dev/null +++ b/lib/Model/ItemSearchAdditionalDataPagination.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchAdditionalDataPagination implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchAdditionalData_pagination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'start' => 'int', + 'limit' => 'int', + 'more_items_in_collection' => 'bool', + 'next_start' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'start' => null, + 'limit' => null, + 'more_items_in_collection' => null, + 'next_start' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'start' => 'start', + 'limit' => 'limit', + 'more_items_in_collection' => 'more_items_in_collection', + 'next_start' => 'next_start' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'limit' => 'setLimit', + 'more_items_in_collection' => 'setMoreItemsInCollection', + 'next_start' => 'setNextStart' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'limit' => 'getLimit', + 'more_items_in_collection' => 'getMoreItemsInCollection', + 'next_start' => 'getNextStart' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start'] = $data['start'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['more_items_in_collection'] = $data['more_items_in_collection'] ?? null; + $this->container['next_start'] = $data['next_start'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets start + * + * @return int|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param int|null $start Pagination start + * + * @return self + */ + public function setStart($start): self + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit Items shown per page + * + * @return self + */ + public function setLimit($limit): self + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets more_items_in_collection + * + * @return bool|null + */ + public function getMoreItemsInCollection() + { + return $this->container['more_items_in_collection']; + } + + /** + * Sets more_items_in_collection + * + * @param bool|null $more_items_in_collection Whether there are more list items in the collection than displayed + * + * @return self + */ + public function setMoreItemsInCollection($more_items_in_collection): self + { + $this->container['more_items_in_collection'] = $more_items_in_collection; + + return $this; + } + + /** + * Gets next_start + * + * @return int|null + */ + public function getNextStart() + { + return $this->container['next_start']; + } + + /** + * Sets next_start + * + * @param int|null $next_start Next pagination start + * + * @return self + */ + public function setNextStart($next_start): self + { + $this->container['next_start'] = $next_start; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchFieldResponse.php b/lib/Model/ItemSearchFieldResponse.php new file mode 100644 index 00000000..f5e504b6 --- /dev/null +++ b/lib/Model/ItemSearchFieldResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchFieldResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchFieldResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ItemSearchFieldResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ItemSearchFieldResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ItemSearchFieldResponseAllOfData[]|null $data The array of results + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchFieldResponseAllOf.php b/lib/Model/ItemSearchFieldResponseAllOf.php new file mode 100644 index 00000000..fa4c52a1 --- /dev/null +++ b/lib/Model/ItemSearchFieldResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchFieldResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchFieldResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ItemSearchFieldResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ItemSearchFieldResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ItemSearchFieldResponseAllOfData[]|null $data The array of results + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchFieldResponseAllOfData.php b/lib/Model/ItemSearchFieldResponseAllOfData.php new file mode 100644 index 00000000..a95fb4b0 --- /dev/null +++ b/lib/Model/ItemSearchFieldResponseAllOfData.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchFieldResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchFieldResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'field_key' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'field_key' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'field_key' => '$field_key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'field_key' => 'setFieldKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'field_key' => 'getFieldKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['field_key'] = $data['field_key'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets field_key + * + * @return mixed|null + */ + public function getFieldKey() + { + return $this->container['field_key']; + } + + /** + * Sets field_key + * + * @param mixed|null $field_key The value of the searched `field_key` + * + * @return self + */ + public function setFieldKey($field_key): self + { + $this->container['field_key'] = $field_key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchItem.php b/lib/Model/ItemSearchItem.php new file mode 100644 index 00000000..af7f6ff9 --- /dev/null +++ b/lib/Model/ItemSearchItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'result_score' => 'float', + 'item' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result_score' => null, + 'item' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result_score' => 'result_score', + 'item' => 'item' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result_score' => 'setResultScore', + 'item' => 'setItem' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result_score' => 'getResultScore', + 'item' => 'getItem' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result_score'] = $data['result_score'] ?? null; + $this->container['item'] = $data['item'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_score + * + * @return float|null + */ + public function getResultScore() + { + return $this->container['result_score']; + } + + /** + * Sets result_score + * + * @param float|null $result_score Search result relevancy + * + * @return self + */ + public function setResultScore($result_score): self + { + $this->container['result_score'] = $result_score; + + return $this; + } + + /** + * Gets item + * + * @return object|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param object|null $item Item + * + * @return self + */ + public function setItem($item): self + { + $this->container['item'] = $item; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchResponse.php b/lib/Model/ItemSearchResponse.php new file mode 100644 index 00000000..d3265d5a --- /dev/null +++ b/lib/Model/ItemSearchResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ItemSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ItemSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ItemSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchResponseAllOf.php b/lib/Model/ItemSearchResponseAllOf.php new file mode 100644 index 00000000..a189ba90 --- /dev/null +++ b/lib/Model/ItemSearchResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ItemSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ItemSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ItemSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ItemSearchResponseAllOfData.php b/lib/Model/ItemSearchResponseAllOfData.php new file mode 100644 index 00000000..110a40b2 --- /dev/null +++ b/lib/Model/ItemSearchResponseAllOfData.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ItemSearchResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ItemSearchResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\ItemSearchItem[]', + 'related_items' => '\Pipedrive\Model\ItemSearchItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'related_items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'related_items' => 'related_items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'related_items' => 'setRelatedItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'related_items' => 'getRelatedItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + $this->container['related_items'] = $data['related_items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\ItemSearchItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\ItemSearchItem[]|null $items The array of found items + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets related_items + * + * @return \Pipedrive\Model\ItemSearchItem[]|null + */ + public function getRelatedItems() + { + return $this->container['related_items']; + } + + /** + * Sets related_items + * + * @param \Pipedrive\Model\ItemSearchItem[]|null $related_items The array of related items if `search_for_related_items` was enabled + * + * @return self + */ + public function setRelatedItems($related_items): self + { + $this->container['related_items'] = $related_items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadIdResponse200.php b/lib/Model/LeadIdResponse200.php new file mode 100644 index 00000000..f8efbc55 --- /dev/null +++ b/lib/Model/LeadIdResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadIdResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'leadIdResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\LeadIdResponse200Data' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadIdResponse200Data|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadIdResponse200Data|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadIdResponse200Data.php b/lib/Model/LeadIdResponse200Data.php new file mode 100644 index 00000000..4056a474 --- /dev/null +++ b/lib/Model/LeadIdResponse200Data.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadIdResponse200Data implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'leadIdResponse200_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadLabelColor.php b/lib/Model/LeadLabelColor.php new file mode 100644 index 00000000..c0f59603 --- /dev/null +++ b/lib/Model/LeadLabelColor.php @@ -0,0 +1,75 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadLabelResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadLabelResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'color' => '\Pipedrive\Model\LeadLabelColor', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'color' => null, + 'add_time' => 'date-time', + 'update_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'color' => 'color', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'color' => 'setColor', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'color' => 'getColor', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['color'] = $data['color'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique ID of the lead label + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the lead label + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets color + * + * @return \Pipedrive\Model\LeadLabelColor|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param \Pipedrive\Model\LeadLabelColor|null $color color + * + * @return self + */ + public function setColor($color): self + { + $this->container['color'] = $color; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The date and time of when the lead label was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The date and time of when the lead label was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadResponse.php b/lib/Model/LeadResponse.php new file mode 100644 index 00000000..1b3b610e --- /dev/null +++ b/lib/Model/LeadResponse.php @@ -0,0 +1,822 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'title' => 'string', + 'owner_id' => 'int', + 'creator_id' => 'int', + 'label_ids' => 'string[]', + 'person_id' => 'int', + 'organization_id' => 'int', + 'source_name' => 'string', + 'is_archived' => 'bool', + 'was_seen' => 'bool', + 'value' => '\Pipedrive\Model\LeadValue', + 'expected_close_date' => '\DateTime', + 'next_activity_id' => 'int', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'title' => null, + 'owner_id' => null, + 'creator_id' => null, + 'label_ids' => 'uuid', + 'person_id' => null, + 'organization_id' => null, + 'source_name' => null, + 'is_archived' => null, + 'was_seen' => null, + 'value' => null, + 'expected_close_date' => 'date', + 'next_activity_id' => null, + 'add_time' => 'date-time', + 'update_time' => 'date-time', + 'visible_to' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'title' => 'title', + 'owner_id' => 'owner_id', + 'creator_id' => 'creator_id', + 'label_ids' => 'label_ids', + 'person_id' => 'person_id', + 'organization_id' => 'organization_id', + 'source_name' => 'source_name', + 'is_archived' => 'is_archived', + 'was_seen' => 'was_seen', + 'value' => 'value', + 'expected_close_date' => 'expected_close_date', + 'next_activity_id' => 'next_activity_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'title' => 'setTitle', + 'owner_id' => 'setOwnerId', + 'creator_id' => 'setCreatorId', + 'label_ids' => 'setLabelIds', + 'person_id' => 'setPersonId', + 'organization_id' => 'setOrganizationId', + 'source_name' => 'setSourceName', + 'is_archived' => 'setIsArchived', + 'was_seen' => 'setWasSeen', + 'value' => 'setValue', + 'expected_close_date' => 'setExpectedCloseDate', + 'next_activity_id' => 'setNextActivityId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'title' => 'getTitle', + 'owner_id' => 'getOwnerId', + 'creator_id' => 'getCreatorId', + 'label_ids' => 'getLabelIds', + 'person_id' => 'getPersonId', + 'organization_id' => 'getOrganizationId', + 'source_name' => 'getSourceName', + 'is_archived' => 'getIsArchived', + 'was_seen' => 'getWasSeen', + 'value' => 'getValue', + 'expected_close_date' => 'getExpectedCloseDate', + 'next_activity_id' => 'getNextActivityId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['creator_id'] = $data['creator_id'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['organization_id'] = $data['organization_id'] ?? null; + $this->container['source_name'] = $data['source_name'] ?? null; + $this->container['is_archived'] = $data['is_archived'] ?? null; + $this->container['was_seen'] = $data['was_seen'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique ID of the lead in the UUID format + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the lead + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who owns the lead + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets creator_id + * + * @return int|null + */ + public function getCreatorId() + { + return $this->container['creator_id']; + } + + /** + * Sets creator_id + * + * @param int|null $creator_id The ID of the user who created the lead + * + * @return self + */ + public function setCreatorId($creator_id): self + { + $this->container['creator_id'] = $creator_id; + + return $this; + } + + /** + * Gets label_ids + * + * @return string[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param string[]|null $label_ids The IDs of the lead labels which are associated with the lead + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of a person which this lead is linked to + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets organization_id + * + * @return int|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param int|null $organization_id The ID of an organization which this lead is linked to + * + * @return self + */ + public function setOrganizationId($organization_id): self + { + $this->container['organization_id'] = $organization_id; + + return $this; + } + + /** + * Gets source_name + * + * @return string|null + */ + public function getSourceName() + { + return $this->container['source_name']; + } + + /** + * Sets source_name + * + * @param string|null $source_name Defines where the lead comes from. Will be `API` if the lead was created through the Public API and will be `Manually created` if the lead was created manually through the UI. + * + * @return self + */ + public function setSourceName($source_name): self + { + $this->container['source_name'] = $source_name; + + return $this; + } + + /** + * Gets is_archived + * + * @return bool|null + */ + public function getIsArchived() + { + return $this->container['is_archived']; + } + + /** + * Sets is_archived + * + * @param bool|null $is_archived A flag indicating whether the lead is archived or not + * + * @return self + */ + public function setIsArchived($is_archived): self + { + $this->container['is_archived'] = $is_archived; + + return $this; + } + + /** + * Gets was_seen + * + * @return bool|null + */ + public function getWasSeen() + { + return $this->container['was_seen']; + } + + /** + * Sets was_seen + * + * @param bool|null $was_seen A flag indicating whether the lead was seen by someone in the Pipedrive UI + * + * @return self + */ + public function setWasSeen($was_seen): self + { + $this->container['was_seen'] = $was_seen; + + return $this; + } + + /** + * Gets value + * + * @return \Pipedrive\Model\LeadValue|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Pipedrive\Model\LeadValue|null $value value + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD. + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the lead + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The date and time of when the lead was created. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The date and time of when the lead was last updated. In ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.
ValueDescription
`1`Owner & followers (private)
`3`Entire company (shared)
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the lead + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadResponse404.php b/lib/Model/LeadResponse404.php new file mode 100644 index 00000000..5a22dede --- /dev/null +++ b/lib/Model/LeadResponse404.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadResponse404 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'leadResponse404'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_info' => 'string', + 'data' => 'object', + 'additional_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_info' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_info' => 'error_info', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_info' => 'setErrorInfo', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_info' => 'getErrorInfo', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_info'] = $data['error_info'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The description of the error + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_info + * + * @return string|null + */ + public function getErrorInfo() + { + return $this->container['error_info']; + } + + /** + * Sets error_info + * + * @param string|null $error_info A message describing how to solve the problem + * + * @return self + */ + public function setErrorInfo($error_info): self + { + $this->container['error_info'] = $error_info; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return object|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param object|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchItem.php b/lib/Model/LeadSearchItem.php new file mode 100644 index 00000000..5af71dcf --- /dev/null +++ b/lib/Model/LeadSearchItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'result_score' => 'float', + 'item' => '\Pipedrive\Model\LeadSearchItemItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result_score' => null, + 'item' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result_score' => 'result_score', + 'item' => 'item' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result_score' => 'setResultScore', + 'item' => 'setItem' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result_score' => 'getResultScore', + 'item' => 'getItem' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result_score'] = $data['result_score'] ?? null; + $this->container['item'] = $data['item'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_score + * + * @return float|null + */ + public function getResultScore() + { + return $this->container['result_score']; + } + + /** + * Sets result_score + * + * @param float|null $result_score Search result relevancy + * + * @return self + */ + public function setResultScore($result_score): self + { + $this->container['result_score'] = $result_score; + + return $this; + } + + /** + * Gets item + * + * @return \Pipedrive\Model\LeadSearchItemItem|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \Pipedrive\Model\LeadSearchItemItem|null $item item + * + * @return self + */ + public function setItem($item): self + { + $this->container['item'] = $item; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchItemItem.php b/lib/Model/LeadSearchItemItem.php new file mode 100644 index 00000000..148bcb0e --- /dev/null +++ b/lib/Model/LeadSearchItemItem.php @@ -0,0 +1,732 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchItem_item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'type' => 'string', + 'title' => 'string', + 'owner' => '\Pipedrive\Model\LeadSearchItemItemOwner', + 'person' => '\Pipedrive\Model\LeadSearchItemItemPerson', + 'organization' => '\Pipedrive\Model\LeadSearchItemItemOrganization', + 'phones' => 'string[]', + 'emails' => 'string[]', + 'custom_fields' => 'string[]', + 'notes' => 'string[]', + 'value' => 'int', + 'currency' => 'string', + 'visible_to' => 'int', + 'is_archived' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'title' => null, + 'owner' => null, + 'person' => null, + 'organization' => null, + 'phones' => null, + 'emails' => null, + 'custom_fields' => null, + 'notes' => null, + 'value' => null, + 'currency' => null, + 'visible_to' => null, + 'is_archived' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'title' => 'title', + 'owner' => 'owner', + 'person' => 'person', + 'organization' => 'organization', + 'phones' => 'phones', + 'emails' => 'emails', + 'custom_fields' => 'custom_fields', + 'notes' => 'notes', + 'value' => 'value', + 'currency' => 'currency', + 'visible_to' => 'visible_to', + 'is_archived' => 'is_archived' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'title' => 'setTitle', + 'owner' => 'setOwner', + 'person' => 'setPerson', + 'organization' => 'setOrganization', + 'phones' => 'setPhones', + 'emails' => 'setEmails', + 'custom_fields' => 'setCustomFields', + 'notes' => 'setNotes', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'visible_to' => 'setVisibleTo', + 'is_archived' => 'setIsArchived' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'title' => 'getTitle', + 'owner' => 'getOwner', + 'person' => 'getPerson', + 'organization' => 'getOrganization', + 'phones' => 'getPhones', + 'emails' => 'getEmails', + 'custom_fields' => 'getCustomFields', + 'notes' => 'getNotes', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'visible_to' => 'getVisibleTo', + 'is_archived' => 'getIsArchived' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['owner'] = $data['owner'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + $this->container['phones'] = $data['phones'] ?? null; + $this->container['emails'] = $data['emails'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['is_archived'] = $data['is_archived'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the lead + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the item + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the lead + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets owner + * + * @return \Pipedrive\Model\LeadSearchItemItemOwner|null + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * + * @param \Pipedrive\Model\LeadSearchItemItemOwner|null $owner owner + * + * @return self + */ + public function setOwner($owner): self + { + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\LeadSearchItemItemPerson|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\LeadSearchItemItemPerson|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\LeadSearchItemItemOrganization|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\LeadSearchItemItemOrganization|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets phones + * + * @return string[]|null + */ + public function getPhones() + { + return $this->container['phones']; + } + + /** + * Sets phones + * + * @param string[]|null $phones phones + * + * @return self + */ + public function setPhones($phones): self + { + $this->container['phones'] = $phones; + + return $this; + } + + /** + * Gets emails + * + * @return string[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[]|null $emails emails + * + * @return self + */ + public function setEmails($emails): self + { + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets custom_fields + * + * @return string[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param string[]|null $custom_fields Custom fields + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets notes + * + * @return string[]|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string[]|null $notes An array of notes + * + * @return self + */ + public function setNotes($notes): self + { + $this->container['notes'] = $notes; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The value of the lead + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the lead + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the lead + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets is_archived + * + * @return bool|null + */ + public function getIsArchived() + { + return $this->container['is_archived']; + } + + /** + * Sets is_archived + * + * @param bool|null $is_archived A flag indicating whether the lead is archived or not + * + * @return self + */ + public function setIsArchived($is_archived): self + { + $this->container['is_archived'] = $is_archived; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchItemItemOrganization.php b/lib/Model/LeadSearchItemItemOrganization.php new file mode 100644 index 00000000..8d28d3b1 --- /dev/null +++ b/lib/Model/LeadSearchItemItemOrganization.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchItemItemOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchItem_item_organization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization the lead is associated with + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization the lead is associated with + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchItemItemOwner.php b/lib/Model/LeadSearchItemItemOwner.php new file mode 100644 index 00000000..4db7a20b --- /dev/null +++ b/lib/Model/LeadSearchItemItemOwner.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchItemItemOwner implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchItem_item_owner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the owner of the lead + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchItemItemPerson.php b/lib/Model/LeadSearchItemItemPerson.php new file mode 100644 index 00000000..ee5a71fc --- /dev/null +++ b/lib/Model/LeadSearchItemItemPerson.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchItemItemPerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchItem_item_person'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person the lead is associated with + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person the lead is associated with + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchResponse.php b/lib/Model/LeadSearchResponse.php new file mode 100644 index 00000000..29e422b0 --- /dev/null +++ b/lib/Model/LeadSearchResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\LeadSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchResponseAllOf.php b/lib/Model/LeadSearchResponseAllOf.php new file mode 100644 index 00000000..94c4a646 --- /dev/null +++ b/lib/Model/LeadSearchResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\LeadSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadSearchResponseAllOfData.php b/lib/Model/LeadSearchResponseAllOfData.php new file mode 100644 index 00000000..1e5f6245 --- /dev/null +++ b/lib/Model/LeadSearchResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadSearchResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadSearchResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\LeadSearchItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\LeadSearchItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\LeadSearchItem[]|null $items The array of leads + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LeadValue.php b/lib/Model/LeadValue.php new file mode 100644 index 00000000..ed69f117 --- /dev/null +++ b/lib/Model/LeadValue.php @@ -0,0 +1,379 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LeadValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LeadValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'amount' => 'float', + 'currency' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => null, + 'currency' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency' => 'currency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency' => 'setCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency' => 'getCurrency' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = $data['amount'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' 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 amount + * + * @return float + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float $amount amount + * + * @return self + */ + public function setAmount($amount): self + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency currency + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/LinkRemoteFileToItem.php b/lib/Model/LinkRemoteFileToItem.php new file mode 100644 index 00000000..6842fbcf --- /dev/null +++ b/lib/Model/LinkRemoteFileToItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LinkRemoteFileToItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'LinkRemoteFileToItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListActivitiesResponse.php b/lib/Model/ListActivitiesResponse.php new file mode 100644 index 00000000..cb867820 --- /dev/null +++ b/lib/Model/ListActivitiesResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListActivitiesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListActivitiesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityResponseObject[]', + 'additional_data' => '\Pipedrive\Model\ActivityDistributionDataWithAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject[]|null $data The array of activities + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListActivitiesResponseAllOf.php b/lib/Model/ListActivitiesResponseAllOf.php new file mode 100644 index 00000000..d88d8fc9 --- /dev/null +++ b/lib/Model/ListActivitiesResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListActivitiesResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListActivitiesResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ActivityResponseObject[]', + 'additional_data' => '\Pipedrive\Model\ActivityDistributionDataWithAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject[]|null $data The array of activities + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ActivityDistributionDataWithAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListDealsResponse.php b/lib/Model/ListDealsResponse.php new file mode 100644 index 00000000..d951bb95 --- /dev/null +++ b/lib/Model/ListDealsResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListDealsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListDealsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\DealNonStrict[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\ListDealsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealNonStrict[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealNonStrict[]|null $data The array of deals + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListDealsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListDealsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListDealsResponseAllOf.php b/lib/Model/ListDealsResponseAllOf.php new file mode 100644 index 00000000..71832814 --- /dev/null +++ b/lib/Model/ListDealsResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListDealsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListDealsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\DealNonStrict[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\ListDealsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\DealNonStrict[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealNonStrict[]|null $data The array of deals + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListDealsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListDealsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListDealsResponseAllOfRelatedObjects.php b/lib/Model/ListDealsResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..e0ab49f5 --- /dev/null +++ b/lib/Model/ListDealsResponseAllOfRelatedObjects.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListDealsResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListDealsResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization' => '\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag', + 'person' => '\Pipedrive\Model\RelatedPersonDataWithActiveFlag', + 'user' => '\Pipedrive\Model\RelatedUserData', + 'stage' => '\Pipedrive\Model\BaseStage', + 'pipeline' => '\Pipedrive\Model\BasePipeline' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization' => null, + 'person' => null, + 'user' => null, + 'stage' => null, + 'pipeline' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization' => 'organization', + 'person' => 'person', + 'user' => 'user', + 'stage' => 'stage', + 'pipeline' => 'pipeline' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization' => 'setOrganization', + 'person' => 'setPerson', + 'user' => 'setUser', + 'stage' => 'setStage', + 'pipeline' => 'setPipeline' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization' => 'getOrganization', + 'person' => 'getPerson', + 'user' => 'getUser', + 'stage' => 'getStage', + 'pipeline' => 'getPipeline' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization'] = $data['organization'] ?? null; + $this->container['person'] = $data['person'] ?? null; + $this->container['user'] = $data['user'] ?? null; + $this->container['stage'] = $data['stage'] ?? null; + $this->container['pipeline'] = $data['pipeline'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets person + * + * @return \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null + */ + public function getPerson() + { + return $this->container['person']; + } + + /** + * Sets person + * + * @param \Pipedrive\Model\RelatedPersonDataWithActiveFlag|null $person person + * + * @return self + */ + public function setPerson($person): self + { + $this->container['person'] = $person; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + + /** + * Gets stage + * + * @return \Pipedrive\Model\BaseStage|null + */ + public function getStage() + { + return $this->container['stage']; + } + + /** + * Sets stage + * + * @param \Pipedrive\Model\BaseStage|null $stage stage + * + * @return self + */ + public function setStage($stage): self + { + $this->container['stage'] = $stage; + + return $this; + } + + /** + * Gets pipeline + * + * @return \Pipedrive\Model\BasePipeline|null + */ + public function getPipeline() + { + return $this->container['pipeline']; + } + + /** + * Sets pipeline + * + * @param \Pipedrive\Model\BasePipeline|null $pipeline pipeline + * + * @return self + */ + public function setPipeline($pipeline): self + { + $this->container['pipeline'] = $pipeline; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListFilesResponse.php b/lib/Model/ListFilesResponse.php new file mode 100644 index 00000000..3cabb3fc --- /dev/null +++ b/lib/Model/ListFilesResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListFilesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListFilesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileItem[]|null $data The array of files + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListFilesResponseAllOf.php b/lib/Model/ListFilesResponseAllOf.php new file mode 100644 index 00000000..58ae8254 --- /dev/null +++ b/lib/Model/ListFilesResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListFilesResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListFilesResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\FileItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\FileItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileItem[]|null $data The array of files + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListFollowersResponse.php b/lib/Model/ListFollowersResponse.php new file mode 100644 index 00000000..b92f289d --- /dev/null +++ b/lib/Model/ListFollowersResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListFollowersResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListFollowersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ListFollowersResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ListFollowersResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListFollowersResponseAllOfData[]|null $data The list of followers + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListFollowersResponseAllOf.php b/lib/Model/ListFollowersResponseAllOf.php new file mode 100644 index 00000000..60b0cf8c --- /dev/null +++ b/lib/Model/ListFollowersResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListFollowersResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListFollowersResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ListFollowersResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ListFollowersResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListFollowersResponseAllOfData[]|null $data The list of followers + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListFollowersResponseAllOfData.php b/lib/Model/ListFollowersResponseAllOfData.php new file mode 100644 index 00000000..283e535c --- /dev/null +++ b/lib/Model/ListFollowersResponseAllOfData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListFollowersResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListFollowersResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'id' => 'int', + 'deal_id' => 'int', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'id' => null, + 'deal_id' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'id' => 'id', + 'deal_id' => 'deal_id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'id' => 'setId', + 'deal_id' => 'setDealId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'id' => 'getId', + 'deal_id' => 'getDealId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal which the follower was added to + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the follower was added to the person + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListMailMessagesResponse.php b/lib/Model/ListMailMessagesResponse.php new file mode 100644 index 00000000..eb7245df --- /dev/null +++ b/lib/Model/ListMailMessagesResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListMailMessagesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListMailMessagesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ListMailMessagesResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ListMailMessagesResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListMailMessagesResponseAllOfData[]|null $data The array of mail messages + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListMailMessagesResponseAllOf.php b/lib/Model/ListMailMessagesResponseAllOf.php new file mode 100644 index 00000000..1f09aabd --- /dev/null +++ b/lib/Model/ListMailMessagesResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListMailMessagesResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListMailMessagesResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ListMailMessagesResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ListMailMessagesResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListMailMessagesResponseAllOfData[]|null $data The array of mail messages + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListMailMessagesResponseAllOfData.php b/lib/Model/ListMailMessagesResponseAllOfData.php new file mode 100644 index 00000000..371fbaaa --- /dev/null +++ b/lib/Model/ListMailMessagesResponseAllOfData.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListMailMessagesResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListMailMessagesResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'object' => 'string', + 'timestamp' => 'string', + 'data' => '\Pipedrive\Model\MailMessageItemForList' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'timestamp' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'timestamp' => 'timestamp', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'timestamp' => 'setTimestamp', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'timestamp' => 'getTimestamp', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['object'] = $data['object'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object The type of the data item + * + * @return self + */ + public function setObject($object): self + { + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The date and time when the item was created + * + * @return self + */ + public function setTimestamp($timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\MailMessageItemForList|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MailMessageItemForList|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPermittedUsersResponse.php b/lib/Model/ListPermittedUsersResponse.php new file mode 100644 index 00000000..1fddba3f --- /dev/null +++ b/lib/Model/ListPermittedUsersResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPermittedUsersResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPermittedUsersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ListPermittedUsersResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ListPermittedUsersResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListPermittedUsersResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPermittedUsersResponse1.php b/lib/Model/ListPermittedUsersResponse1.php new file mode 100644 index 00000000..56e73b5a --- /dev/null +++ b/lib/Model/ListPermittedUsersResponse1.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPermittedUsersResponse1 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPermittedUsersResponse_1'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'float[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return float[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param float[]|null $data The list of permitted user IDs + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPermittedUsersResponse1AllOf.php b/lib/Model/ListPermittedUsersResponse1AllOf.php new file mode 100644 index 00000000..fd64f4bb --- /dev/null +++ b/lib/Model/ListPermittedUsersResponse1AllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPermittedUsersResponse1AllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPermittedUsersResponse_1_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => 'float[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return float[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param float[]|null $data The list of permitted user IDs + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPermittedUsersResponseAllOf.php b/lib/Model/ListPermittedUsersResponseAllOf.php new file mode 100644 index 00000000..777a6d15 --- /dev/null +++ b/lib/Model/ListPermittedUsersResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPermittedUsersResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPermittedUsersResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ListPermittedUsersResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ListPermittedUsersResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListPermittedUsersResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPermittedUsersResponseAllOfData.php b/lib/Model/ListPermittedUsersResponseAllOfData.php new file mode 100644 index 00000000..38f0bfad --- /dev/null +++ b/lib/Model/ListPermittedUsersResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPermittedUsersResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPermittedUsersResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int[]|null $id The list of permitted users IDs + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonProductsResponse.php b/lib/Model/ListPersonProductsResponse.php new file mode 100644 index 00000000..6b851ad1 --- /dev/null +++ b/lib/Model/ListPersonProductsResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonProductsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonProductsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ListPersonProductsResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ListPersonProductsResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListPersonProductsResponseAllOfData[]|null $data The array of deal products + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonProductsResponseAllOf.php b/lib/Model/ListPersonProductsResponseAllOf.php new file mode 100644 index 00000000..9afef6cc --- /dev/null +++ b/lib/Model/ListPersonProductsResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonProductsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonProductsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ListPersonProductsResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ListPersonProductsResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListPersonProductsResponseAllOfData[]|null $data The array of deal products + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonProductsResponseAllOfDEALID.php b/lib/Model/ListPersonProductsResponseAllOfDEALID.php new file mode 100644 index 00000000..51fe459a --- /dev/null +++ b/lib/Model/ListPersonProductsResponseAllOfDEALID.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonProductsResponseAllOfDEALID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonProductsResponse_allOf_DEAL_ID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal' => '\Pipedrive\Model\ProductBaseDeal', + 'product' => '\Pipedrive\Model\PersonListProduct' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal' => null, + 'product' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal' => 'deal', + 'product' => 'product' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal' => 'setDeal', + 'product' => 'setProduct' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal' => 'getDeal', + 'product' => 'getProduct' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal'] = $data['deal'] ?? null; + $this->container['product'] = $data['product'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deal + * + * @return \Pipedrive\Model\ProductBaseDeal|null + */ + public function getDeal() + { + return $this->container['deal']; + } + + /** + * Sets deal + * + * @param \Pipedrive\Model\ProductBaseDeal|null $deal deal + * + * @return self + */ + public function setDeal($deal): self + { + $this->container['deal'] = $deal; + + return $this; + } + + /** + * Gets product + * + * @return \Pipedrive\Model\PersonListProduct|null + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \Pipedrive\Model\PersonListProduct|null $product product + * + * @return self + */ + public function setProduct($product): self + { + $this->container['product'] = $product; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonProductsResponseAllOfData.php b/lib/Model/ListPersonProductsResponseAllOfData.php new file mode 100644 index 00000000..9ccdefb5 --- /dev/null +++ b/lib/Model/ListPersonProductsResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonProductsResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonProductsResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal_id' => '\Pipedrive\Model\ListPersonProductsResponseAllOfDEALID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal_id' => 'DEAL_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal_id' => 'setDealId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal_id' => 'getDealId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal_id'] = $data['deal_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deal_id + * + * @return \Pipedrive\Model\ListPersonProductsResponseAllOfDEALID|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param \Pipedrive\Model\ListPersonProductsResponseAllOfDEALID|null $deal_id deal_id + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonsResponse.php b/lib/Model/ListPersonsResponse.php new file mode 100644 index 00000000..23aa6623 --- /dev/null +++ b/lib/Model/ListPersonsResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem[]|null $data The array of persons + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonsResponseAllOf.php b/lib/Model/ListPersonsResponseAllOf.php new file mode 100644 index 00000000..1295d583 --- /dev/null +++ b/lib/Model/ListPersonsResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PersonItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem[]|null $data The array of persons + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListPersonsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListPersonsResponseAllOfRelatedObjects.php b/lib/Model/ListPersonsResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..e9f1f9cf --- /dev/null +++ b/lib/Model/ListPersonsResponseAllOfRelatedObjects.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListPersonsResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListPersonsResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization' => '\Pipedrive\Model\RelatedOrganizationDataWithActiveFlag', + 'user' => '\Pipedrive\Model\RelatedUserData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization' => null, + 'user' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization' => 'organization', + 'user' => 'user' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization' => 'setOrganization', + 'user' => 'setUser' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization' => 'getOrganization', + 'user' => 'getUser' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization'] = $data['organization'] ?? null; + $this->container['user'] = $data['user'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationDataWithActiveFlag|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductAdditionalData.php b/lib/Model/ListProductAdditionalData.php new file mode 100644 index 00000000..7b920f2f --- /dev/null +++ b/lib/Model/ListProductAdditionalData.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductAdditionalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'products_quantity_total' => 'int', + 'products_sum_total' => 'int', + 'products_quantity_total_formatted' => 'string', + 'products_sum_total_formatted' => 'string', + 'pagination' => '\Pipedrive\Model\ItemSearchAdditionalDataPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'products_quantity_total' => null, + 'products_sum_total' => null, + 'products_quantity_total_formatted' => null, + 'products_sum_total_formatted' => null, + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'products_quantity_total' => 'products_quantity_total', + 'products_sum_total' => 'products_sum_total', + 'products_quantity_total_formatted' => 'products_quantity_total_formatted', + 'products_sum_total_formatted' => 'products_sum_total_formatted', + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'products_quantity_total' => 'setProductsQuantityTotal', + 'products_sum_total' => 'setProductsSumTotal', + 'products_quantity_total_formatted' => 'setProductsQuantityTotalFormatted', + 'products_sum_total_formatted' => 'setProductsSumTotalFormatted', + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'products_quantity_total' => 'getProductsQuantityTotal', + 'products_sum_total' => 'getProductsSumTotal', + 'products_quantity_total_formatted' => 'getProductsQuantityTotalFormatted', + 'products_sum_total_formatted' => 'getProductsSumTotalFormatted', + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['products_quantity_total'] = $data['products_quantity_total'] ?? null; + $this->container['products_sum_total'] = $data['products_sum_total'] ?? null; + $this->container['products_quantity_total_formatted'] = $data['products_quantity_total_formatted'] ?? null; + $this->container['products_sum_total_formatted'] = $data['products_sum_total_formatted'] ?? null; + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets products_quantity_total + * + * @return int|null + */ + public function getProductsQuantityTotal() + { + return $this->container['products_quantity_total']; + } + + /** + * Sets products_quantity_total + * + * @param int|null $products_quantity_total The total quantity of the products + * + * @return self + */ + public function setProductsQuantityTotal($products_quantity_total): self + { + $this->container['products_quantity_total'] = $products_quantity_total; + + return $this; + } + + /** + * Gets products_sum_total + * + * @return int|null + */ + public function getProductsSumTotal() + { + return $this->container['products_sum_total']; + } + + /** + * Sets products_sum_total + * + * @param int|null $products_sum_total The total sum of the products + * + * @return self + */ + public function setProductsSumTotal($products_sum_total): self + { + $this->container['products_sum_total'] = $products_sum_total; + + return $this; + } + + /** + * Gets products_quantity_total_formatted + * + * @return string|null + */ + public function getProductsQuantityTotalFormatted() + { + return $this->container['products_quantity_total_formatted']; + } + + /** + * Sets products_quantity_total_formatted + * + * @param string|null $products_quantity_total_formatted The total formatted quantity of the products + * + * @return self + */ + public function setProductsQuantityTotalFormatted($products_quantity_total_formatted): self + { + $this->container['products_quantity_total_formatted'] = $products_quantity_total_formatted; + + return $this; + } + + /** + * Gets products_sum_total_formatted + * + * @return string|null + */ + public function getProductsSumTotalFormatted() + { + return $this->container['products_sum_total_formatted']; + } + + /** + * Sets products_sum_total_formatted + * + * @param string|null $products_sum_total_formatted The total formatted sum of the products + * + * @return self + */ + public function setProductsSumTotalFormatted($products_sum_total_formatted): self + { + $this->container['products_sum_total_formatted'] = $products_sum_total_formatted; + + return $this; + } + + /** + * Gets pagination + * + * @return \Pipedrive\Model\ItemSearchAdditionalDataPagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Pipedrive\Model\ItemSearchAdditionalDataPagination|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductAdditionalDataAllOf.php b/lib/Model/ListProductAdditionalDataAllOf.php new file mode 100644 index 00000000..664e6940 --- /dev/null +++ b/lib/Model/ListProductAdditionalDataAllOf.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductAdditionalDataAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductAdditionalData_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'products_quantity_total' => 'int', + 'products_sum_total' => 'int', + 'products_quantity_total_formatted' => 'string', + 'products_sum_total_formatted' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'products_quantity_total' => null, + 'products_sum_total' => null, + 'products_quantity_total_formatted' => null, + 'products_sum_total_formatted' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'products_quantity_total' => 'products_quantity_total', + 'products_sum_total' => 'products_sum_total', + 'products_quantity_total_formatted' => 'products_quantity_total_formatted', + 'products_sum_total_formatted' => 'products_sum_total_formatted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'products_quantity_total' => 'setProductsQuantityTotal', + 'products_sum_total' => 'setProductsSumTotal', + 'products_quantity_total_formatted' => 'setProductsQuantityTotalFormatted', + 'products_sum_total_formatted' => 'setProductsSumTotalFormatted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'products_quantity_total' => 'getProductsQuantityTotal', + 'products_sum_total' => 'getProductsSumTotal', + 'products_quantity_total_formatted' => 'getProductsQuantityTotalFormatted', + 'products_sum_total_formatted' => 'getProductsSumTotalFormatted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['products_quantity_total'] = $data['products_quantity_total'] ?? null; + $this->container['products_sum_total'] = $data['products_sum_total'] ?? null; + $this->container['products_quantity_total_formatted'] = $data['products_quantity_total_formatted'] ?? null; + $this->container['products_sum_total_formatted'] = $data['products_sum_total_formatted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets products_quantity_total + * + * @return int|null + */ + public function getProductsQuantityTotal() + { + return $this->container['products_quantity_total']; + } + + /** + * Sets products_quantity_total + * + * @param int|null $products_quantity_total The total quantity of the products + * + * @return self + */ + public function setProductsQuantityTotal($products_quantity_total): self + { + $this->container['products_quantity_total'] = $products_quantity_total; + + return $this; + } + + /** + * Gets products_sum_total + * + * @return int|null + */ + public function getProductsSumTotal() + { + return $this->container['products_sum_total']; + } + + /** + * Sets products_sum_total + * + * @param int|null $products_sum_total The total sum of the products + * + * @return self + */ + public function setProductsSumTotal($products_sum_total): self + { + $this->container['products_sum_total'] = $products_sum_total; + + return $this; + } + + /** + * Gets products_quantity_total_formatted + * + * @return string|null + */ + public function getProductsQuantityTotalFormatted() + { + return $this->container['products_quantity_total_formatted']; + } + + /** + * Sets products_quantity_total_formatted + * + * @param string|null $products_quantity_total_formatted The total formatted quantity of the products + * + * @return self + */ + public function setProductsQuantityTotalFormatted($products_quantity_total_formatted): self + { + $this->container['products_quantity_total_formatted'] = $products_quantity_total_formatted; + + return $this; + } + + /** + * Gets products_sum_total_formatted + * + * @return string|null + */ + public function getProductsSumTotalFormatted() + { + return $this->container['products_sum_total_formatted']; + } + + /** + * Sets products_sum_total_formatted + * + * @param string|null $products_sum_total_formatted The total formatted sum of the products + * + * @return self + */ + public function setProductsSumTotalFormatted($products_sum_total_formatted): self + { + $this->container['products_sum_total_formatted'] = $products_sum_total_formatted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductFilesResponse.php b/lib/Model/ListProductFilesResponse.php new file mode 100644 index 00000000..0272b03f --- /dev/null +++ b/lib/Model/ListProductFilesResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductFilesResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductFilesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ProductFileItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductFileItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductFileItem[]|null $data The array of files + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductFilesResponseAllOf.php b/lib/Model/ListProductFilesResponseAllOf.php new file mode 100644 index 00000000..19808a15 --- /dev/null +++ b/lib/Model/ListProductFilesResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductFilesResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductFilesResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ProductFileItem[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductFileItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductFileItem[]|null $data The array of files + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductFollowersResponse.php b/lib/Model/ListProductFollowersResponse.php new file mode 100644 index 00000000..9c6c131e --- /dev/null +++ b/lib/Model/ListProductFollowersResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductFollowersResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductFollowersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ListProductFollowersResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ListProductFollowersResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListProductFollowersResponseAllOfData[]|null $data The list of followers + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductFollowersResponseAllOf.php b/lib/Model/ListProductFollowersResponseAllOf.php new file mode 100644 index 00000000..2c9b00d6 --- /dev/null +++ b/lib/Model/ListProductFollowersResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductFollowersResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductFollowersResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ListProductFollowersResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ListProductFollowersResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListProductFollowersResponseAllOfData[]|null $data The list of followers + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductFollowersResponseAllOfData.php b/lib/Model/ListProductFollowersResponseAllOfData.php new file mode 100644 index 00000000..1bbc935a --- /dev/null +++ b/lib/Model/ListProductFollowersResponseAllOfData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductFollowersResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductFollowersResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'id' => 'int', + 'product_id' => 'int', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'id' => null, + 'product_id' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'id' => 'id', + 'product_id' => 'product_id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'id' => 'setId', + 'product_id' => 'setProductId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'id' => 'getId', + 'product_id' => 'getProductId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the follower was added to the person + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductsResponse.php b/lib/Model/ListProductsResponse.php new file mode 100644 index 00000000..33f30772 --- /dev/null +++ b/lib/Model/ListProductsResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ListProductsResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ListProductAdditionalData', + 'related_objects' => '\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ListProductsResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListProductsResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ListProductAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ListProductAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductsResponseAllOf.php b/lib/Model/ListProductsResponseAllOf.php new file mode 100644 index 00000000..c94b9f4e --- /dev/null +++ b/lib/Model/ListProductsResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ListProductsResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ListProductAdditionalData', + 'related_objects' => '\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ListProductsResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ListProductsResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ListProductAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ListProductAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductsResponseAllOfData.php b/lib/Model/ListProductsResponseAllOfData.php new file mode 100644 index 00000000..05ba7d22 --- /dev/null +++ b/lib/Model/ListProductsResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductsResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductsResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\ProductListItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\ProductListItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\ProductListItem[]|null $items The array of products + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ListProductsResponseAllOfRelatedObjects.php b/lib/Model/ListProductsResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..24409b4c --- /dev/null +++ b/lib/Model/ListProductsResponseAllOfRelatedObjects.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListProductsResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ListProductsResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user' => '\Pipedrive\Model\RelatedUserData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user' => 'user' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user' => 'setUser' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user' => 'getUser' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user'] = $data['user'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailMessage.php b/lib/Model/MailMessage.php new file mode 100644 index 00000000..901ded43 --- /dev/null +++ b/lib/Model/MailMessage.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailMessage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailMessage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'status_code' => 'int', + 'status_text' => 'string', + 'service' => 'string', + 'data' => '\Pipedrive\Model\MailMessageData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'status_code' => null, + 'status_text' => null, + 'service' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'status_code' => 'statusCode', + 'status_text' => 'statusText', + 'service' => 'service', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'status_code' => 'setStatusCode', + 'status_text' => 'setStatusText', + 'service' => 'setService', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'status_code' => 'getStatusCode', + 'status_text' => 'getStatusText', + 'service' => 'getService', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['status_code'] = $data['status_code'] ?? null; + $this->container['status_text'] = $data['status_text'] ?? null; + $this->container['service'] = $data['service'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets status_code + * + * @return int|null + */ + public function getStatusCode() + { + return $this->container['status_code']; + } + + /** + * Sets status_code + * + * @param int|null $status_code The email service specific status code and it is returned through the response body. + * + * @return self + */ + public function setStatusCode($status_code): self + { + $this->container['status_code'] = $status_code; + + return $this; + } + + /** + * Gets status_text + * + * @return string|null + */ + public function getStatusText() + { + return $this->container['status_text']; + } + + /** + * Sets status_text + * + * @param string|null $status_text The status text of the response. + * + * @return self + */ + public function setStatusText($status_text): self + { + $this->container['status_text'] = $status_text; + + return $this; + } + + /** + * Gets service + * + * @return string|null + */ + public function getService() + { + return $this->container['service']; + } + + /** + * Sets service + * + * @param string|null $service The service name of the response. + * + * @return self + */ + public function setService($service): self + { + $this->container['service'] = $service; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\MailMessageData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MailMessageData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailMessageAllOf.php b/lib/Model/MailMessageAllOf.php new file mode 100644 index 00000000..90779a02 --- /dev/null +++ b/lib/Model/MailMessageAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailMessageAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailMessage_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\MailMessageData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\MailMessageData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MailMessageData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailMessageData.php b/lib/Model/MailMessageData.php new file mode 100644 index 00000000..df18528d --- /dev/null +++ b/lib/Model/MailMessageData.php @@ -0,0 +1,1188 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailMessageData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailMessageData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'from' => '\Pipedrive\Model\MailParticipant[]', + 'to' => '\Pipedrive\Model\MailParticipant[]', + 'cc' => '\Pipedrive\Model\MailParticipant[]', + 'bcc' => '\Pipedrive\Model\MailParticipant[]', + 'body_url' => 'string', + 'account_id' => 'string', + 'user_id' => 'int', + 'mail_thread_id' => 'int', + 'subject' => 'string', + 'snippet' => 'string', + 'mail_tracking_status' => 'string', + 'mail_link_tracking_enabled_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'read_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'draft' => 'string', + 'draft_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'synced_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_body_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_from_pipedrive_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'smart_bcc_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'message_time' => '\DateTime', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime', + 'has_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_inline_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_real_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'from' => null, + 'to' => null, + 'cc' => null, + 'bcc' => null, + 'body_url' => null, + 'account_id' => null, + 'user_id' => null, + 'mail_thread_id' => null, + 'subject' => null, + 'snippet' => null, + 'mail_tracking_status' => null, + 'mail_link_tracking_enabled_flag' => null, + 'read_flag' => null, + 'draft' => null, + 'draft_flag' => null, + 'synced_flag' => null, + 'deleted_flag' => null, + 'has_body_flag' => null, + 'sent_flag' => null, + 'sent_from_pipedrive_flag' => null, + 'smart_bcc_flag' => null, + 'message_time' => 'date-time', + 'add_time' => 'date-time', + 'update_time' => 'date-time', + 'has_attachments_flag' => null, + 'has_inline_attachments_flag' => null, + 'has_real_attachments_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'from' => 'from', + 'to' => 'to', + 'cc' => 'cc', + 'bcc' => 'bcc', + 'body_url' => 'body_url', + 'account_id' => 'account_id', + 'user_id' => 'user_id', + 'mail_thread_id' => 'mail_thread_id', + 'subject' => 'subject', + 'snippet' => 'snippet', + 'mail_tracking_status' => 'mail_tracking_status', + 'mail_link_tracking_enabled_flag' => 'mail_link_tracking_enabled_flag', + 'read_flag' => 'read_flag', + 'draft' => 'draft', + 'draft_flag' => 'draft_flag', + 'synced_flag' => 'synced_flag', + 'deleted_flag' => 'deleted_flag', + 'has_body_flag' => 'has_body_flag', + 'sent_flag' => 'sent_flag', + 'sent_from_pipedrive_flag' => 'sent_from_pipedrive_flag', + 'smart_bcc_flag' => 'smart_bcc_flag', + 'message_time' => 'message_time', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'has_attachments_flag' => 'has_attachments_flag', + 'has_inline_attachments_flag' => 'has_inline_attachments_flag', + 'has_real_attachments_flag' => 'has_real_attachments_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'from' => 'setFrom', + 'to' => 'setTo', + 'cc' => 'setCc', + 'bcc' => 'setBcc', + 'body_url' => 'setBodyUrl', + 'account_id' => 'setAccountId', + 'user_id' => 'setUserId', + 'mail_thread_id' => 'setMailThreadId', + 'subject' => 'setSubject', + 'snippet' => 'setSnippet', + 'mail_tracking_status' => 'setMailTrackingStatus', + 'mail_link_tracking_enabled_flag' => 'setMailLinkTrackingEnabledFlag', + 'read_flag' => 'setReadFlag', + 'draft' => 'setDraft', + 'draft_flag' => 'setDraftFlag', + 'synced_flag' => 'setSyncedFlag', + 'deleted_flag' => 'setDeletedFlag', + 'has_body_flag' => 'setHasBodyFlag', + 'sent_flag' => 'setSentFlag', + 'sent_from_pipedrive_flag' => 'setSentFromPipedriveFlag', + 'smart_bcc_flag' => 'setSmartBccFlag', + 'message_time' => 'setMessageTime', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'has_attachments_flag' => 'setHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'setHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'setHasRealAttachmentsFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'from' => 'getFrom', + 'to' => 'getTo', + 'cc' => 'getCc', + 'bcc' => 'getBcc', + 'body_url' => 'getBodyUrl', + 'account_id' => 'getAccountId', + 'user_id' => 'getUserId', + 'mail_thread_id' => 'getMailThreadId', + 'subject' => 'getSubject', + 'snippet' => 'getSnippet', + 'mail_tracking_status' => 'getMailTrackingStatus', + 'mail_link_tracking_enabled_flag' => 'getMailLinkTrackingEnabledFlag', + 'read_flag' => 'getReadFlag', + 'draft' => 'getDraft', + 'draft_flag' => 'getDraftFlag', + 'synced_flag' => 'getSyncedFlag', + 'deleted_flag' => 'getDeletedFlag', + 'has_body_flag' => 'getHasBodyFlag', + 'sent_flag' => 'getSentFlag', + 'sent_from_pipedrive_flag' => 'getSentFromPipedriveFlag', + 'smart_bcc_flag' => 'getSmartBccFlag', + 'message_time' => 'getMessageTime', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'has_attachments_flag' => 'getHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'getHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'getHasRealAttachmentsFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const MAIL_TRACKING_STATUS_OPENED = 'opened'; + const MAIL_TRACKING_STATUS_NOT_OPENED = 'not opened'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getMailTrackingStatusAllowableValues(): array + { + return [ + self::MAIL_TRACKING_STATUS_OPENED, + self::MAIL_TRACKING_STATUS_NOT_OPENED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['from'] = $data['from'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['cc'] = $data['cc'] ?? null; + $this->container['bcc'] = $data['bcc'] ?? null; + $this->container['body_url'] = $data['body_url'] ?? null; + $this->container['account_id'] = $data['account_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['snippet'] = $data['snippet'] ?? null; + $this->container['mail_tracking_status'] = $data['mail_tracking_status'] ?? null; + $this->container['mail_link_tracking_enabled_flag'] = $data['mail_link_tracking_enabled_flag'] ?? null; + $this->container['read_flag'] = $data['read_flag'] ?? null; + $this->container['draft'] = $data['draft'] ?? null; + $this->container['draft_flag'] = $data['draft_flag'] ?? null; + $this->container['synced_flag'] = $data['synced_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['has_body_flag'] = $data['has_body_flag'] ?? null; + $this->container['sent_flag'] = $data['sent_flag'] ?? null; + $this->container['sent_from_pipedrive_flag'] = $data['sent_from_pipedrive_flag'] ?? null; + $this->container['smart_bcc_flag'] = $data['smart_bcc_flag'] ?? null; + $this->container['message_time'] = $data['message_time'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['has_attachments_flag'] = $data['has_attachments_flag'] ?? null; + $this->container['has_inline_attachments_flag'] = $data['has_inline_attachments_flag'] ?? null; + $this->container['has_real_attachments_flag'] = $data['has_real_attachments_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getMailTrackingStatusAllowableValues(); + if (!is_null($this->container['mail_tracking_status']) && !in_array($this->container['mail_tracking_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mail_tracking_status', must be one of '%s'", + $this->container['mail_tracking_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail message. + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets from + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \Pipedrive\Model\MailParticipant[]|null $from The array of mail message sender (object) + * + * @return self + */ + public function setFrom($from): self + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \Pipedrive\Model\MailParticipant[]|null $to The array of mail message receiver (object) + * + * @return self + */ + public function setTo($to): self + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets cc + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param \Pipedrive\Model\MailParticipant[]|null $cc The array of mail message copies (object) + * + * @return self + */ + public function setCc($cc): self + { + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets bcc + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getBcc() + { + return $this->container['bcc']; + } + + /** + * Sets bcc + * + * @param \Pipedrive\Model\MailParticipant[]|null $bcc The array of mail message blind copies (object) + * + * @return self + */ + public function setBcc($bcc): self + { + $this->container['bcc'] = $bcc; + + return $this; + } + + /** + * Gets body_url + * + * @return string|null + */ + public function getBodyUrl() + { + return $this->container['body_url']; + } + + /** + * Sets body_url + * + * @param string|null $body_url The mail message body URL + * + * @return self + */ + public function setBodyUrl($body_url): self + { + $this->container['body_url'] = $body_url; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id The connection account ID + * + * @return self + */ + public function setAccountId($account_id): self + { + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id ID of the user whom mail message will be assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets mail_thread_id + * + * @return int|null + */ + public function getMailThreadId() + { + return $this->container['mail_thread_id']; + } + + /** + * Sets mail_thread_id + * + * @param int|null $mail_thread_id ID of the mail message thread + * + * @return self + */ + public function setMailThreadId($mail_thread_id): self + { + $this->container['mail_thread_id'] = $mail_thread_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of mail message + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets snippet + * + * @return string|null + */ + public function getSnippet() + { + return $this->container['snippet']; + } + + /** + * Sets snippet + * + * @param string|null $snippet The snippet of mail message. Snippet length is up to 225 characters. + * + * @return self + */ + public function setSnippet($snippet): self + { + $this->container['snippet'] = $snippet; + + return $this; + } + + /** + * Gets mail_tracking_status + * + * @return string|null + */ + public function getMailTrackingStatus() + { + return $this->container['mail_tracking_status']; + } + + /** + * Sets mail_tracking_status + * + * @param string|null $mail_tracking_status The status of tracking mail message. Value is `null` if tracking is not enabled. + * + * @return self + */ + public function setMailTrackingStatus($mail_tracking_status): self + { + $allowedValues = $this->getMailTrackingStatusAllowableValues(); + if (!is_null($mail_tracking_status) && !in_array($mail_tracking_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mail_tracking_status', must be one of '%s'", + $mail_tracking_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mail_tracking_status'] = $mail_tracking_status; + + return $this; + } + + /** + * Gets mail_link_tracking_enabled_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getMailLinkTrackingEnabledFlag() + { + return $this->container['mail_link_tracking_enabled_flag']; + } + + /** + * Sets mail_link_tracking_enabled_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $mail_link_tracking_enabled_flag Whether the link tracking in mail message body is enabled. + * + * @return self + */ + public function setMailLinkTrackingEnabledFlag($mail_link_tracking_enabled_flag): self + { + $this->container['mail_link_tracking_enabled_flag'] = $mail_link_tracking_enabled_flag; + + return $this; + } + + /** + * Gets read_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getReadFlag() + { + return $this->container['read_flag']; + } + + /** + * Sets read_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $read_flag Whether the mail message is read or not by the user + * + * @return self + */ + public function setReadFlag($read_flag): self + { + $this->container['read_flag'] = $read_flag; + + return $this; + } + + /** + * Gets draft + * + * @return string|null + */ + public function getDraft() + { + return $this->container['draft']; + } + + /** + * Sets draft + * + * @param string|null $draft If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. + * + * @return self + */ + public function setDraft($draft): self + { + $this->container['draft'] = $draft; + + return $this; + } + + /** + * Gets draft_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDraftFlag() + { + return $this->container['draft_flag']; + } + + /** + * Sets draft_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $draft_flag Whether the mail message is a draft or not + * + * @return self + */ + public function setDraftFlag($draft_flag): self + { + $this->container['draft_flag'] = $draft_flag; + + return $this; + } + + /** + * Gets synced_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSyncedFlag() + { + return $this->container['synced_flag']; + } + + /** + * Sets synced_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $synced_flag Whether the mail message is synced with the provider or not + * + * @return self + */ + public function setSyncedFlag($synced_flag): self + { + $this->container['synced_flag'] = $synced_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $deleted_flag Whether the mail message is deleted or not + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets has_body_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasBodyFlag() + { + return $this->container['has_body_flag']; + } + + /** + * Sets has_body_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_body_flag Whether the mail message has a body or not + * + * @return self + */ + public function setHasBodyFlag($has_body_flag): self + { + $this->container['has_body_flag'] = $has_body_flag; + + return $this; + } + + /** + * Gets sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFlag() + { + return $this->container['sent_flag']; + } + + /** + * Sets sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_flag Whether the mail message has been sent or not + * + * @return self + */ + public function setSentFlag($sent_flag): self + { + $this->container['sent_flag'] = $sent_flag; + + return $this; + } + + /** + * Gets sent_from_pipedrive_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFromPipedriveFlag() + { + return $this->container['sent_from_pipedrive_flag']; + } + + /** + * Sets sent_from_pipedrive_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_from_pipedrive_flag Whether the mail message has been sent from Pipedrive app or not + * + * @return self + */ + public function setSentFromPipedriveFlag($sent_from_pipedrive_flag): self + { + $this->container['sent_from_pipedrive_flag'] = $sent_from_pipedrive_flag; + + return $this; + } + + /** + * Gets smart_bcc_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSmartBccFlag() + { + return $this->container['smart_bcc_flag']; + } + + /** + * Sets smart_bcc_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $smart_bcc_flag Whether the mail message has been created by Smart Email BCC feature or not + * + * @return self + */ + public function setSmartBccFlag($smart_bcc_flag): self + { + $this->container['smart_bcc_flag'] = $smart_bcc_flag; + + return $this; + } + + /** + * Gets message_time + * + * @return \DateTime|null + */ + public function getMessageTime() + { + return $this->container['message_time']; + } + + /** + * Sets message_time + * + * @param \DateTime|null $message_time Creation or receival time of the mail message + * + * @return self + */ + public function setMessageTime($message_time): self + { + $this->container['message_time'] = $message_time; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The insertion into the database time of the mail message + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The updating time in the database of the mail message + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets has_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasAttachmentsFlag() + { + return $this->container['has_attachments_flag']; + } + + /** + * Sets has_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_attachments_flag Whether the mail message has an attachment or not + * + * @return self + */ + public function setHasAttachmentsFlag($has_attachments_flag): self + { + $this->container['has_attachments_flag'] = $has_attachments_flag; + + return $this; + } + + /** + * Gets has_inline_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasInlineAttachmentsFlag() + { + return $this->container['has_inline_attachments_flag']; + } + + /** + * Sets has_inline_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_inline_attachments_flag Whether the mail message has an inline attachment or not + * + * @return self + */ + public function setHasInlineAttachmentsFlag($has_inline_attachments_flag): self + { + $this->container['has_inline_attachments_flag'] = $has_inline_attachments_flag; + + return $this; + } + + /** + * Gets has_real_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasRealAttachmentsFlag() + { + return $this->container['has_real_attachments_flag']; + } + + /** + * Sets has_real_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_real_attachments_flag Whether the mail message has an attachment (which is not inline) or not + * + * @return self + */ + public function setHasRealAttachmentsFlag($has_real_attachments_flag): self + { + $this->container['has_real_attachments_flag'] = $has_real_attachments_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailMessageItemForList.php b/lib/Model/MailMessageItemForList.php new file mode 100644 index 00000000..9df733a0 --- /dev/null +++ b/lib/Model/MailMessageItemForList.php @@ -0,0 +1,1458 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailMessageItemForList implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailMessageItemForList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'from' => '\Pipedrive\Model\MailParticipant[]', + 'to' => '\Pipedrive\Model\MailParticipant[]', + 'cc' => '\Pipedrive\Model\MailParticipant[]', + 'bcc' => '\Pipedrive\Model\MailParticipant[]', + 'body_url' => 'string', + 'account_id' => 'string', + 'user_id' => 'int', + 'mail_thread_id' => 'int', + 'subject' => 'string', + 'snippet' => 'string', + 'mail_tracking_status' => 'string', + 'mail_link_tracking_enabled_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'read_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'draft' => 'string', + 'draft_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'synced_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_body_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'sent_from_pipedrive_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'smart_bcc_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'message_time' => '\DateTime', + 'add_time' => '\DateTime', + 'update_time' => '\DateTime', + 'has_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_inline_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'has_real_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0', + 'nylas_id' => 'string', + 's3_bucket' => 'string', + 's3_bucket_path' => 'string', + 'external_deleted_flag' => 'bool', + 'mua_message_id' => 'string', + 'template_id' => 'int', + 'timestamp' => 'string', + 'item_type' => 'string', + 'company_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'from' => null, + 'to' => null, + 'cc' => null, + 'bcc' => null, + 'body_url' => null, + 'account_id' => null, + 'user_id' => null, + 'mail_thread_id' => null, + 'subject' => null, + 'snippet' => null, + 'mail_tracking_status' => null, + 'mail_link_tracking_enabled_flag' => null, + 'read_flag' => null, + 'draft' => null, + 'draft_flag' => null, + 'synced_flag' => null, + 'deleted_flag' => null, + 'has_body_flag' => null, + 'sent_flag' => null, + 'sent_from_pipedrive_flag' => null, + 'smart_bcc_flag' => null, + 'message_time' => 'date-time', + 'add_time' => 'date-time', + 'update_time' => 'date-time', + 'has_attachments_flag' => null, + 'has_inline_attachments_flag' => null, + 'has_real_attachments_flag' => null, + 'nylas_id' => null, + 's3_bucket' => null, + 's3_bucket_path' => null, + 'external_deleted_flag' => null, + 'mua_message_id' => null, + 'template_id' => null, + 'timestamp' => null, + 'item_type' => null, + 'company_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'from' => 'from', + 'to' => 'to', + 'cc' => 'cc', + 'bcc' => 'bcc', + 'body_url' => 'body_url', + 'account_id' => 'account_id', + 'user_id' => 'user_id', + 'mail_thread_id' => 'mail_thread_id', + 'subject' => 'subject', + 'snippet' => 'snippet', + 'mail_tracking_status' => 'mail_tracking_status', + 'mail_link_tracking_enabled_flag' => 'mail_link_tracking_enabled_flag', + 'read_flag' => 'read_flag', + 'draft' => 'draft', + 'draft_flag' => 'draft_flag', + 'synced_flag' => 'synced_flag', + 'deleted_flag' => 'deleted_flag', + 'has_body_flag' => 'has_body_flag', + 'sent_flag' => 'sent_flag', + 'sent_from_pipedrive_flag' => 'sent_from_pipedrive_flag', + 'smart_bcc_flag' => 'smart_bcc_flag', + 'message_time' => 'message_time', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'has_attachments_flag' => 'has_attachments_flag', + 'has_inline_attachments_flag' => 'has_inline_attachments_flag', + 'has_real_attachments_flag' => 'has_real_attachments_flag', + 'nylas_id' => 'nylas_id', + 's3_bucket' => 's3_bucket', + 's3_bucket_path' => 's3_bucket_path', + 'external_deleted_flag' => 'external_deleted_flag', + 'mua_message_id' => 'mua_message_id', + 'template_id' => 'template_id', + 'timestamp' => 'timestamp', + 'item_type' => 'item_type', + 'company_id' => 'company_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'from' => 'setFrom', + 'to' => 'setTo', + 'cc' => 'setCc', + 'bcc' => 'setBcc', + 'body_url' => 'setBodyUrl', + 'account_id' => 'setAccountId', + 'user_id' => 'setUserId', + 'mail_thread_id' => 'setMailThreadId', + 'subject' => 'setSubject', + 'snippet' => 'setSnippet', + 'mail_tracking_status' => 'setMailTrackingStatus', + 'mail_link_tracking_enabled_flag' => 'setMailLinkTrackingEnabledFlag', + 'read_flag' => 'setReadFlag', + 'draft' => 'setDraft', + 'draft_flag' => 'setDraftFlag', + 'synced_flag' => 'setSyncedFlag', + 'deleted_flag' => 'setDeletedFlag', + 'has_body_flag' => 'setHasBodyFlag', + 'sent_flag' => 'setSentFlag', + 'sent_from_pipedrive_flag' => 'setSentFromPipedriveFlag', + 'smart_bcc_flag' => 'setSmartBccFlag', + 'message_time' => 'setMessageTime', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'has_attachments_flag' => 'setHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'setHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'setHasRealAttachmentsFlag', + 'nylas_id' => 'setNylasId', + 's3_bucket' => 'setS3Bucket', + 's3_bucket_path' => 'setS3BucketPath', + 'external_deleted_flag' => 'setExternalDeletedFlag', + 'mua_message_id' => 'setMuaMessageId', + 'template_id' => 'setTemplateId', + 'timestamp' => 'setTimestamp', + 'item_type' => 'setItemType', + 'company_id' => 'setCompanyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'from' => 'getFrom', + 'to' => 'getTo', + 'cc' => 'getCc', + 'bcc' => 'getBcc', + 'body_url' => 'getBodyUrl', + 'account_id' => 'getAccountId', + 'user_id' => 'getUserId', + 'mail_thread_id' => 'getMailThreadId', + 'subject' => 'getSubject', + 'snippet' => 'getSnippet', + 'mail_tracking_status' => 'getMailTrackingStatus', + 'mail_link_tracking_enabled_flag' => 'getMailLinkTrackingEnabledFlag', + 'read_flag' => 'getReadFlag', + 'draft' => 'getDraft', + 'draft_flag' => 'getDraftFlag', + 'synced_flag' => 'getSyncedFlag', + 'deleted_flag' => 'getDeletedFlag', + 'has_body_flag' => 'getHasBodyFlag', + 'sent_flag' => 'getSentFlag', + 'sent_from_pipedrive_flag' => 'getSentFromPipedriveFlag', + 'smart_bcc_flag' => 'getSmartBccFlag', + 'message_time' => 'getMessageTime', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'has_attachments_flag' => 'getHasAttachmentsFlag', + 'has_inline_attachments_flag' => 'getHasInlineAttachmentsFlag', + 'has_real_attachments_flag' => 'getHasRealAttachmentsFlag', + 'nylas_id' => 'getNylasId', + 's3_bucket' => 'getS3Bucket', + 's3_bucket_path' => 'getS3BucketPath', + 'external_deleted_flag' => 'getExternalDeletedFlag', + 'mua_message_id' => 'getMuaMessageId', + 'template_id' => 'getTemplateId', + 'timestamp' => 'getTimestamp', + 'item_type' => 'getItemType', + 'company_id' => 'getCompanyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const MAIL_TRACKING_STATUS_OPENED = 'opened'; + const MAIL_TRACKING_STATUS_NOT_OPENED = 'not opened'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getMailTrackingStatusAllowableValues(): array + { + return [ + self::MAIL_TRACKING_STATUS_OPENED, + self::MAIL_TRACKING_STATUS_NOT_OPENED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['from'] = $data['from'] ?? null; + $this->container['to'] = $data['to'] ?? null; + $this->container['cc'] = $data['cc'] ?? null; + $this->container['bcc'] = $data['bcc'] ?? null; + $this->container['body_url'] = $data['body_url'] ?? null; + $this->container['account_id'] = $data['account_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['snippet'] = $data['snippet'] ?? null; + $this->container['mail_tracking_status'] = $data['mail_tracking_status'] ?? null; + $this->container['mail_link_tracking_enabled_flag'] = $data['mail_link_tracking_enabled_flag'] ?? null; + $this->container['read_flag'] = $data['read_flag'] ?? null; + $this->container['draft'] = $data['draft'] ?? null; + $this->container['draft_flag'] = $data['draft_flag'] ?? null; + $this->container['synced_flag'] = $data['synced_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['has_body_flag'] = $data['has_body_flag'] ?? null; + $this->container['sent_flag'] = $data['sent_flag'] ?? null; + $this->container['sent_from_pipedrive_flag'] = $data['sent_from_pipedrive_flag'] ?? null; + $this->container['smart_bcc_flag'] = $data['smart_bcc_flag'] ?? null; + $this->container['message_time'] = $data['message_time'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['has_attachments_flag'] = $data['has_attachments_flag'] ?? null; + $this->container['has_inline_attachments_flag'] = $data['has_inline_attachments_flag'] ?? null; + $this->container['has_real_attachments_flag'] = $data['has_real_attachments_flag'] ?? null; + $this->container['nylas_id'] = $data['nylas_id'] ?? null; + $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; + $this->container['s3_bucket_path'] = $data['s3_bucket_path'] ?? null; + $this->container['external_deleted_flag'] = $data['external_deleted_flag'] ?? null; + $this->container['mua_message_id'] = $data['mua_message_id'] ?? null; + $this->container['template_id'] = $data['template_id'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['item_type'] = $data['item_type'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getMailTrackingStatusAllowableValues(); + if (!is_null($this->container['mail_tracking_status']) && !in_array($this->container['mail_tracking_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mail_tracking_status', must be one of '%s'", + $this->container['mail_tracking_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail message. + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets from + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \Pipedrive\Model\MailParticipant[]|null $from The array of mail message sender (object) + * + * @return self + */ + public function setFrom($from): self + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets to + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \Pipedrive\Model\MailParticipant[]|null $to The array of mail message receiver (object) + * + * @return self + */ + public function setTo($to): self + { + $this->container['to'] = $to; + + return $this; + } + + /** + * Gets cc + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getCc() + { + return $this->container['cc']; + } + + /** + * Sets cc + * + * @param \Pipedrive\Model\MailParticipant[]|null $cc The array of mail message copies (object) + * + * @return self + */ + public function setCc($cc): self + { + $this->container['cc'] = $cc; + + return $this; + } + + /** + * Gets bcc + * + * @return \Pipedrive\Model\MailParticipant[]|null + */ + public function getBcc() + { + return $this->container['bcc']; + } + + /** + * Sets bcc + * + * @param \Pipedrive\Model\MailParticipant[]|null $bcc The array of mail message blind copies (object) + * + * @return self + */ + public function setBcc($bcc): self + { + $this->container['bcc'] = $bcc; + + return $this; + } + + /** + * Gets body_url + * + * @return string|null + */ + public function getBodyUrl() + { + return $this->container['body_url']; + } + + /** + * Sets body_url + * + * @param string|null $body_url The mail message body URL + * + * @return self + */ + public function setBodyUrl($body_url): self + { + $this->container['body_url'] = $body_url; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id The connection account ID + * + * @return self + */ + public function setAccountId($account_id): self + { + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id ID of the user whom mail message will be assigned to + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets mail_thread_id + * + * @return int|null + */ + public function getMailThreadId() + { + return $this->container['mail_thread_id']; + } + + /** + * Sets mail_thread_id + * + * @param int|null $mail_thread_id ID of the mail message thread + * + * @return self + */ + public function setMailThreadId($mail_thread_id): self + { + $this->container['mail_thread_id'] = $mail_thread_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The subject of mail message + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets snippet + * + * @return string|null + */ + public function getSnippet() + { + return $this->container['snippet']; + } + + /** + * Sets snippet + * + * @param string|null $snippet The snippet of mail message. Snippet length is up to 225 characters. + * + * @return self + */ + public function setSnippet($snippet): self + { + $this->container['snippet'] = $snippet; + + return $this; + } + + /** + * Gets mail_tracking_status + * + * @return string|null + */ + public function getMailTrackingStatus() + { + return $this->container['mail_tracking_status']; + } + + /** + * Sets mail_tracking_status + * + * @param string|null $mail_tracking_status The status of tracking mail message. Value is `null` if tracking is not enabled. + * + * @return self + */ + public function setMailTrackingStatus($mail_tracking_status): self + { + $allowedValues = $this->getMailTrackingStatusAllowableValues(); + if (!is_null($mail_tracking_status) && !in_array($mail_tracking_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mail_tracking_status', must be one of '%s'", + $mail_tracking_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mail_tracking_status'] = $mail_tracking_status; + + return $this; + } + + /** + * Gets mail_link_tracking_enabled_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getMailLinkTrackingEnabledFlag() + { + return $this->container['mail_link_tracking_enabled_flag']; + } + + /** + * Sets mail_link_tracking_enabled_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $mail_link_tracking_enabled_flag Whether the link tracking in mail message body is enabled. + * + * @return self + */ + public function setMailLinkTrackingEnabledFlag($mail_link_tracking_enabled_flag): self + { + $this->container['mail_link_tracking_enabled_flag'] = $mail_link_tracking_enabled_flag; + + return $this; + } + + /** + * Gets read_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getReadFlag() + { + return $this->container['read_flag']; + } + + /** + * Sets read_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $read_flag Whether the mail message is read or not by the user + * + * @return self + */ + public function setReadFlag($read_flag): self + { + $this->container['read_flag'] = $read_flag; + + return $this; + } + + /** + * Gets draft + * + * @return string|null + */ + public function getDraft() + { + return $this->container['draft']; + } + + /** + * Sets draft + * + * @param string|null $draft If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. + * + * @return self + */ + public function setDraft($draft): self + { + $this->container['draft'] = $draft; + + return $this; + } + + /** + * Gets draft_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDraftFlag() + { + return $this->container['draft_flag']; + } + + /** + * Sets draft_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $draft_flag Whether the mail message is a draft or not + * + * @return self + */ + public function setDraftFlag($draft_flag): self + { + $this->container['draft_flag'] = $draft_flag; + + return $this; + } + + /** + * Gets synced_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSyncedFlag() + { + return $this->container['synced_flag']; + } + + /** + * Sets synced_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $synced_flag Whether the mail message is synced with the provider or not + * + * @return self + */ + public function setSyncedFlag($synced_flag): self + { + $this->container['synced_flag'] = $synced_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $deleted_flag Whether the mail message is deleted or not + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets has_body_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasBodyFlag() + { + return $this->container['has_body_flag']; + } + + /** + * Sets has_body_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_body_flag Whether the mail message has a body or not + * + * @return self + */ + public function setHasBodyFlag($has_body_flag): self + { + $this->container['has_body_flag'] = $has_body_flag; + + return $this; + } + + /** + * Gets sent_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFlag() + { + return $this->container['sent_flag']; + } + + /** + * Sets sent_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_flag Whether the mail message has been sent or not + * + * @return self + */ + public function setSentFlag($sent_flag): self + { + $this->container['sent_flag'] = $sent_flag; + + return $this; + } + + /** + * Gets sent_from_pipedrive_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSentFromPipedriveFlag() + { + return $this->container['sent_from_pipedrive_flag']; + } + + /** + * Sets sent_from_pipedrive_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_from_pipedrive_flag Whether the mail message has been sent from Pipedrive app or not + * + * @return self + */ + public function setSentFromPipedriveFlag($sent_from_pipedrive_flag): self + { + $this->container['sent_from_pipedrive_flag'] = $sent_from_pipedrive_flag; + + return $this; + } + + /** + * Gets smart_bcc_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getSmartBccFlag() + { + return $this->container['smart_bcc_flag']; + } + + /** + * Sets smart_bcc_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $smart_bcc_flag Whether the mail message has been created by Smart Email BCC feature or not + * + * @return self + */ + public function setSmartBccFlag($smart_bcc_flag): self + { + $this->container['smart_bcc_flag'] = $smart_bcc_flag; + + return $this; + } + + /** + * Gets message_time + * + * @return \DateTime|null + */ + public function getMessageTime() + { + return $this->container['message_time']; + } + + /** + * Sets message_time + * + * @param \DateTime|null $message_time Creation or receival time of the mail message + * + * @return self + */ + public function setMessageTime($message_time): self + { + $this->container['message_time'] = $message_time; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The insertion into the database time of the mail message + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return \DateTime|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param \DateTime|null $update_time The updating time in the database of the mail message + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets has_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasAttachmentsFlag() + { + return $this->container['has_attachments_flag']; + } + + /** + * Sets has_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_attachments_flag Whether the mail message has an attachment or not + * + * @return self + */ + public function setHasAttachmentsFlag($has_attachments_flag): self + { + $this->container['has_attachments_flag'] = $has_attachments_flag; + + return $this; + } + + /** + * Gets has_inline_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasInlineAttachmentsFlag() + { + return $this->container['has_inline_attachments_flag']; + } + + /** + * Sets has_inline_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_inline_attachments_flag Whether the mail message has an inline attachment or not + * + * @return self + */ + public function setHasInlineAttachmentsFlag($has_inline_attachments_flag): self + { + $this->container['has_inline_attachments_flag'] = $has_inline_attachments_flag; + + return $this; + } + + /** + * Gets has_real_attachments_flag + * + * @return \Pipedrive\Model\NumberBooleanDefault0|null + */ + public function getHasRealAttachmentsFlag() + { + return $this->container['has_real_attachments_flag']; + } + + /** + * Sets has_real_attachments_flag + * + * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_real_attachments_flag Whether the mail message has an attachment (which is not inline) or not + * + * @return self + */ + public function setHasRealAttachmentsFlag($has_real_attachments_flag): self + { + $this->container['has_real_attachments_flag'] = $has_real_attachments_flag; + + return $this; + } + + /** + * Gets nylas_id + * + * @return string|null + */ + public function getNylasId() + { + return $this->container['nylas_id']; + } + + /** + * Sets nylas_id + * + * @param string|null $nylas_id The Mail Message ID assigned by the sync provider + * + * @return self + */ + public function setNylasId($nylas_id): self + { + $this->container['nylas_id'] = $nylas_id; + + return $this; + } + + /** + * Gets s3_bucket + * + * @return string|null + */ + public function getS3Bucket() + { + return $this->container['s3_bucket']; + } + + /** + * Sets s3_bucket + * + * @param string|null $s3_bucket The name of the S3 bucket + * + * @return self + */ + public function setS3Bucket($s3_bucket): self + { + $this->container['s3_bucket'] = $s3_bucket; + + return $this; + } + + /** + * Gets s3_bucket_path + * + * @return string|null + */ + public function getS3BucketPath() + { + return $this->container['s3_bucket_path']; + } + + /** + * Sets s3_bucket_path + * + * @param string|null $s3_bucket_path The path of the S3 bucket + * + * @return self + */ + public function setS3BucketPath($s3_bucket_path): self + { + $this->container['s3_bucket_path'] = $s3_bucket_path; + + return $this; + } + + /** + * Gets external_deleted_flag + * + * @return bool|null + */ + public function getExternalDeletedFlag() + { + return $this->container['external_deleted_flag']; + } + + /** + * Sets external_deleted_flag + * + * @param bool|null $external_deleted_flag If the Mail Message has been deleted on the provider side or not + * + * @return self + */ + public function setExternalDeletedFlag($external_deleted_flag): self + { + $this->container['external_deleted_flag'] = $external_deleted_flag; + + return $this; + } + + /** + * Gets mua_message_id + * + * @return string|null + */ + public function getMuaMessageId() + { + return $this->container['mua_message_id']; + } + + /** + * Sets mua_message_id + * + * @param string|null $mua_message_id The Mail Message ID assigned by the mail user agent + * + * @return self + */ + public function setMuaMessageId($mua_message_id): self + { + $this->container['mua_message_id'] = $mua_message_id; + + return $this; + } + + /** + * Gets template_id + * + * @return int|null + */ + public function getTemplateId() + { + return $this->container['template_id']; + } + + /** + * Sets template_id + * + * @param int|null $template_id The ID of the mail template + * + * @return self + */ + public function setTemplateId($template_id): self + { + $this->container['template_id'] = $template_id; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The add date and time of the Mail Message + * + * @return self + */ + public function setTimestamp($timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets item_type + * + * @return string|null + */ + public function getItemType() + { + return $this->container['item_type']; + } + + /** + * Sets item_type + * + * @param string|null $item_type The type of the data item + * + * @return self + */ + public function setItemType($item_type): self + { + $this->container['item_type'] = $item_type; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailMessageItemForListAllOf.php b/lib/Model/MailMessageItemForListAllOf.php new file mode 100644 index 00000000..c00c2003 --- /dev/null +++ b/lib/Model/MailMessageItemForListAllOf.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailMessageItemForListAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailMessageItemForList_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'nylas_id' => 'string', + 's3_bucket' => 'string', + 's3_bucket_path' => 'string', + 'external_deleted_flag' => 'bool', + 'mua_message_id' => 'string', + 'template_id' => 'int', + 'timestamp' => 'string', + 'item_type' => 'string', + 'company_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'nylas_id' => null, + 's3_bucket' => null, + 's3_bucket_path' => null, + 'external_deleted_flag' => null, + 'mua_message_id' => null, + 'template_id' => null, + 'timestamp' => null, + 'item_type' => null, + 'company_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'nylas_id' => 'nylas_id', + 's3_bucket' => 's3_bucket', + 's3_bucket_path' => 's3_bucket_path', + 'external_deleted_flag' => 'external_deleted_flag', + 'mua_message_id' => 'mua_message_id', + 'template_id' => 'template_id', + 'timestamp' => 'timestamp', + 'item_type' => 'item_type', + 'company_id' => 'company_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nylas_id' => 'setNylasId', + 's3_bucket' => 'setS3Bucket', + 's3_bucket_path' => 'setS3BucketPath', + 'external_deleted_flag' => 'setExternalDeletedFlag', + 'mua_message_id' => 'setMuaMessageId', + 'template_id' => 'setTemplateId', + 'timestamp' => 'setTimestamp', + 'item_type' => 'setItemType', + 'company_id' => 'setCompanyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nylas_id' => 'getNylasId', + 's3_bucket' => 'getS3Bucket', + 's3_bucket_path' => 'getS3BucketPath', + 'external_deleted_flag' => 'getExternalDeletedFlag', + 'mua_message_id' => 'getMuaMessageId', + 'template_id' => 'getTemplateId', + 'timestamp' => 'getTimestamp', + 'item_type' => 'getItemType', + 'company_id' => 'getCompanyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['nylas_id'] = $data['nylas_id'] ?? null; + $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; + $this->container['s3_bucket_path'] = $data['s3_bucket_path'] ?? null; + $this->container['external_deleted_flag'] = $data['external_deleted_flag'] ?? null; + $this->container['mua_message_id'] = $data['mua_message_id'] ?? null; + $this->container['template_id'] = $data['template_id'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['item_type'] = $data['item_type'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets nylas_id + * + * @return string|null + */ + public function getNylasId() + { + return $this->container['nylas_id']; + } + + /** + * Sets nylas_id + * + * @param string|null $nylas_id The Mail Message ID assigned by the sync provider + * + * @return self + */ + public function setNylasId($nylas_id): self + { + $this->container['nylas_id'] = $nylas_id; + + return $this; + } + + /** + * Gets s3_bucket + * + * @return string|null + */ + public function getS3Bucket() + { + return $this->container['s3_bucket']; + } + + /** + * Sets s3_bucket + * + * @param string|null $s3_bucket The name of the S3 bucket + * + * @return self + */ + public function setS3Bucket($s3_bucket): self + { + $this->container['s3_bucket'] = $s3_bucket; + + return $this; + } + + /** + * Gets s3_bucket_path + * + * @return string|null + */ + public function getS3BucketPath() + { + return $this->container['s3_bucket_path']; + } + + /** + * Sets s3_bucket_path + * + * @param string|null $s3_bucket_path The path of the S3 bucket + * + * @return self + */ + public function setS3BucketPath($s3_bucket_path): self + { + $this->container['s3_bucket_path'] = $s3_bucket_path; + + return $this; + } + + /** + * Gets external_deleted_flag + * + * @return bool|null + */ + public function getExternalDeletedFlag() + { + return $this->container['external_deleted_flag']; + } + + /** + * Sets external_deleted_flag + * + * @param bool|null $external_deleted_flag If the Mail Message has been deleted on the provider side or not + * + * @return self + */ + public function setExternalDeletedFlag($external_deleted_flag): self + { + $this->container['external_deleted_flag'] = $external_deleted_flag; + + return $this; + } + + /** + * Gets mua_message_id + * + * @return string|null + */ + public function getMuaMessageId() + { + return $this->container['mua_message_id']; + } + + /** + * Sets mua_message_id + * + * @param string|null $mua_message_id The Mail Message ID assigned by the mail user agent + * + * @return self + */ + public function setMuaMessageId($mua_message_id): self + { + $this->container['mua_message_id'] = $mua_message_id; + + return $this; + } + + /** + * Gets template_id + * + * @return int|null + */ + public function getTemplateId() + { + return $this->container['template_id']; + } + + /** + * Sets template_id + * + * @param int|null $template_id The ID of the mail template + * + * @return self + */ + public function setTemplateId($template_id): self + { + $this->container['template_id'] = $template_id; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The add date and time of the Mail Message + * + * @return self + */ + public function setTimestamp($timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets item_type + * + * @return string|null + */ + public function getItemType() + { + return $this->container['item_type']; + } + + /** + * Sets item_type + * + * @param string|null $item_type The type of the data item + * + * @return self + */ + public function setItemType($item_type): self + { + $this->container['item_type'] = $item_type; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailParticipant.php b/lib/Model/MailParticipant.php new file mode 100644 index 00000000..1f6168c1 --- /dev/null +++ b/lib/Model/MailParticipant.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailParticipant implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailParticipant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'email_address' => 'string', + 'name' => 'string', + 'linked_person_id' => 'int', + 'linked_person_name' => 'string', + 'mail_message_party_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'email_address' => null, + 'name' => null, + 'linked_person_id' => null, + 'linked_person_name' => null, + 'mail_message_party_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'email_address' => 'email_address', + 'name' => 'name', + 'linked_person_id' => 'linked_person_id', + 'linked_person_name' => 'linked_person_name', + 'mail_message_party_id' => 'mail_message_party_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'email_address' => 'setEmailAddress', + 'name' => 'setName', + 'linked_person_id' => 'setLinkedPersonId', + 'linked_person_name' => 'setLinkedPersonName', + 'mail_message_party_id' => 'setMailMessagePartyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'email_address' => 'getEmailAddress', + 'name' => 'getName', + 'linked_person_id' => 'getLinkedPersonId', + 'linked_person_name' => 'getLinkedPersonName', + 'mail_message_party_id' => 'getMailMessagePartyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['email_address'] = $data['email_address'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['linked_person_id'] = $data['linked_person_id'] ?? null; + $this->container['linked_person_name'] = $data['linked_person_name'] ?? null; + $this->container['mail_message_party_id'] = $data['mail_message_party_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail participant + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address Mail address of the mail participant + * + * @return self + */ + public function setEmailAddress($email_address): self + { + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the mail participant + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets linked_person_id + * + * @return int|null + */ + public function getLinkedPersonId() + { + return $this->container['linked_person_id']; + } + + /** + * Sets linked_person_id + * + * @param int|null $linked_person_id ID of the linked person to the mail message + * + * @return self + */ + public function setLinkedPersonId($linked_person_id): self + { + $this->container['linked_person_id'] = $linked_person_id; + + return $this; + } + + /** + * Gets linked_person_name + * + * @return string|null + */ + public function getLinkedPersonName() + { + return $this->container['linked_person_name']; + } + + /** + * Sets linked_person_name + * + * @param string|null $linked_person_name Name of the linked person to the mail message + * + * @return self + */ + public function setLinkedPersonName($linked_person_name): self + { + $this->container['linked_person_name'] = $linked_person_name; + + return $this; + } + + /** + * Gets mail_message_party_id + * + * @return int|null + */ + public function getMailMessagePartyId() + { + return $this->container['mail_message_party_id']; + } + + /** + * Sets mail_message_party_id + * + * @param int|null $mail_message_party_id ID of the mail message participant + * + * @return self + */ + public function setMailMessagePartyId($mail_message_party_id): self + { + $this->container['mail_message_party_id'] = $mail_message_party_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailServiceBaseResponse.php b/lib/Model/MailServiceBaseResponse.php new file mode 100644 index 00000000..6070d4ed --- /dev/null +++ b/lib/Model/MailServiceBaseResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailServiceBaseResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailServiceBaseResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'status_code' => 'int', + 'status_text' => 'string', + 'service' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'status_code' => null, + 'status_text' => null, + 'service' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'status_code' => 'statusCode', + 'status_text' => 'statusText', + 'service' => 'service' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'status_code' => 'setStatusCode', + 'status_text' => 'setStatusText', + 'service' => 'setService' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'status_code' => 'getStatusCode', + 'status_text' => 'getStatusText', + 'service' => 'getService' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['status_code'] = $data['status_code'] ?? null; + $this->container['status_text'] = $data['status_text'] ?? null; + $this->container['service'] = $data['service'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets status_code + * + * @return int|null + */ + public function getStatusCode() + { + return $this->container['status_code']; + } + + /** + * Sets status_code + * + * @param int|null $status_code The email service specific status code and it is returned through the response body. + * + * @return self + */ + public function setStatusCode($status_code): self + { + $this->container['status_code'] = $status_code; + + return $this; + } + + /** + * Gets status_text + * + * @return string|null + */ + public function getStatusText() + { + return $this->container['status_text']; + } + + /** + * Sets status_text + * + * @param string|null $status_text The status text of the response. + * + * @return self + */ + public function setStatusText($status_text): self + { + $this->container['status_text'] = $status_text; + + return $this; + } + + /** + * Gets service + * + * @return string|null + */ + public function getService() + { + return $this->container['service']; + } + + /** + * Sets service + * + * @param string|null $service The service name of the response. + * + * @return self + */ + public function setService($service): self + { + $this->container['service'] = $service; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThread.php b/lib/Model/MailThread.php new file mode 100644 index 00000000..6e59a534 --- /dev/null +++ b/lib/Model/MailThread.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThread implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThread'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseMailThread[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseMailThread[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseMailThread[]|null $data The array of mail threads + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadAllOf.php b/lib/Model/MailThreadAllOf.php new file mode 100644 index 00000000..7f542566 --- /dev/null +++ b/lib/Model/MailThreadAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThread_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseMailThread[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseMailThread[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseMailThread[]|null $data The array of mail threads + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadDelete.php b/lib/Model/MailThreadDelete.php new file mode 100644 index 00000000..d8bac44d --- /dev/null +++ b/lib/Model/MailThreadDelete.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadDelete implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadDelete'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\MailThreadDeleteAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\MailThreadDeleteAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MailThreadDeleteAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadDeleteAllOf.php b/lib/Model/MailThreadDeleteAllOf.php new file mode 100644 index 00000000..3e927603 --- /dev/null +++ b/lib/Model/MailThreadDeleteAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadDeleteAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadDelete_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\MailThreadDeleteAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\MailThreadDeleteAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MailThreadDeleteAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadDeleteAllOfData.php b/lib/Model/MailThreadDeleteAllOfData.php new file mode 100644 index 00000000..2424d58d --- /dev/null +++ b/lib/Model/MailThreadDeleteAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadDeleteAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadDelete_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deleted mail thread + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadMessages.php b/lib/Model/MailThreadMessages.php new file mode 100644 index 00000000..7dd29a6e --- /dev/null +++ b/lib/Model/MailThreadMessages.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadMessages implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadMessages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseMailThreadMessages[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseMailThreadMessages[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseMailThreadMessages[]|null $data The array of the mail messages of the mail thread + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadMessagesAllOf.php b/lib/Model/MailThreadMessagesAllOf.php new file mode 100644 index 00000000..c8be539a --- /dev/null +++ b/lib/Model/MailThreadMessagesAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadMessagesAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadMessages_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseMailThreadMessages[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseMailThreadMessages[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseMailThreadMessages[]|null $data The array of the mail messages of the mail thread + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadOne.php b/lib/Model/MailThreadOne.php new file mode 100644 index 00000000..b2578ca2 --- /dev/null +++ b/lib/Model/MailThreadOne.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadOne implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadOne'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'BaseMailThread' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return BaseMailThread|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param BaseMailThread|null $data The mail thread object + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadOneAllOf.php b/lib/Model/MailThreadOneAllOf.php new file mode 100644 index 00000000..5c4a6364 --- /dev/null +++ b/lib/Model/MailThreadOneAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadOneAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadOne_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => 'BaseMailThread' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return BaseMailThread|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param BaseMailThread|null $data The mail thread object + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadParticipant.php b/lib/Model/MailThreadParticipant.php new file mode 100644 index 00000000..c1c9cbd9 --- /dev/null +++ b/lib/Model/MailThreadParticipant.php @@ -0,0 +1,583 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadParticipant implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadParticipant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'latest_sent' => 'bool', + 'email_address' => 'string', + 'message_time' => 'float', + 'linked_person_id' => 'int', + 'linked_person_name' => 'string', + 'mail_message_party_id' => 'int', + 'linked_organization_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'latest_sent' => null, + 'email_address' => null, + 'message_time' => null, + 'linked_person_id' => null, + 'linked_person_name' => null, + 'mail_message_party_id' => null, + 'linked_organization_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'latest_sent' => 'latest_sent', + 'email_address' => 'email_address', + 'message_time' => 'message_time', + 'linked_person_id' => 'linked_person_id', + 'linked_person_name' => 'linked_person_name', + 'mail_message_party_id' => 'mail_message_party_id', + 'linked_organization_id' => 'linked_organization_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'latest_sent' => 'setLatestSent', + 'email_address' => 'setEmailAddress', + 'message_time' => 'setMessageTime', + 'linked_person_id' => 'setLinkedPersonId', + 'linked_person_name' => 'setLinkedPersonName', + 'mail_message_party_id' => 'setMailMessagePartyId', + 'linked_organization_id' => 'setLinkedOrganizationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'latest_sent' => 'getLatestSent', + 'email_address' => 'getEmailAddress', + 'message_time' => 'getMessageTime', + 'linked_person_id' => 'getLinkedPersonId', + 'linked_person_name' => 'getLinkedPersonName', + 'mail_message_party_id' => 'getMailMessagePartyId', + 'linked_organization_id' => 'getLinkedOrganizationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['latest_sent'] = $data['latest_sent'] ?? null; + $this->container['email_address'] = $data['email_address'] ?? null; + $this->container['message_time'] = $data['message_time'] ?? null; + $this->container['linked_person_id'] = $data['linked_person_id'] ?? null; + $this->container['linked_person_name'] = $data['linked_person_name'] ?? null; + $this->container['mail_message_party_id'] = $data['mail_message_party_id'] ?? null; + $this->container['linked_organization_id'] = $data['linked_organization_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of the mail thread participant + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the mail thread participant + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets latest_sent + * + * @return bool|null + */ + public function getLatestSent() + { + return $this->container['latest_sent']; + } + + /** + * Sets latest_sent + * + * @param bool|null $latest_sent Whether the mail thread participant was last to send an email + * + * @return self + */ + public function setLatestSent($latest_sent): self + { + $this->container['latest_sent'] = $latest_sent; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address Email address of the mail thread participant + * + * @return self + */ + public function setEmailAddress($email_address): self + { + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets message_time + * + * @return float|null + */ + public function getMessageTime() + { + return $this->container['message_time']; + } + + /** + * Sets message_time + * + * @param float|null $message_time Message time + * + * @return self + */ + public function setMessageTime($message_time): self + { + $this->container['message_time'] = $message_time; + + return $this; + } + + /** + * Gets linked_person_id + * + * @return int|null + */ + public function getLinkedPersonId() + { + return $this->container['linked_person_id']; + } + + /** + * Sets linked_person_id + * + * @param int|null $linked_person_id ID of the linked person + * + * @return self + */ + public function setLinkedPersonId($linked_person_id): self + { + $this->container['linked_person_id'] = $linked_person_id; + + return $this; + } + + /** + * Gets linked_person_name + * + * @return string|null + */ + public function getLinkedPersonName() + { + return $this->container['linked_person_name']; + } + + /** + * Sets linked_person_name + * + * @param string|null $linked_person_name Email of the linked person + * + * @return self + */ + public function setLinkedPersonName($linked_person_name): self + { + $this->container['linked_person_name'] = $linked_person_name; + + return $this; + } + + /** + * Gets mail_message_party_id + * + * @return int|null + */ + public function getMailMessagePartyId() + { + return $this->container['mail_message_party_id']; + } + + /** + * Sets mail_message_party_id + * + * @param int|null $mail_message_party_id ID of the mail message party + * + * @return self + */ + public function setMailMessagePartyId($mail_message_party_id): self + { + $this->container['mail_message_party_id'] = $mail_message_party_id; + + return $this; + } + + /** + * Gets linked_organization_id + * + * @return int|null + */ + public function getLinkedOrganizationId() + { + return $this->container['linked_organization_id']; + } + + /** + * Sets linked_organization_id + * + * @param int|null $linked_organization_id Linked Organization ID + * + * @return self + */ + public function setLinkedOrganizationId($linked_organization_id): self + { + $this->container['linked_organization_id'] = $linked_organization_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadPut.php b/lib/Model/MailThreadPut.php new file mode 100644 index 00000000..78ddf26c --- /dev/null +++ b/lib/Model/MailThreadPut.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadPut implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadPut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseMailThread' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseMailThread|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseMailThread|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MailThreadPutAllOf.php b/lib/Model/MailThreadPutAllOf.php new file mode 100644 index 00000000..bb3cd523 --- /dev/null +++ b/lib/Model/MailThreadPutAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MailThreadPutAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MailThreadPut_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseMailThread' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseMailThread|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseMailThread|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MarketingStatus.php b/lib/Model/MarketingStatus.php new file mode 100644 index 00000000..1901e50e --- /dev/null +++ b/lib/Model/MarketingStatus.php @@ -0,0 +1,68 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergeDealsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'mergeDealsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'merge_with_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merge_with_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merge_with_id' => 'merge_with_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merge_with_id' => 'setMergeWithId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merge_with_id' => 'getMergeWithId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['merge_with_id'] = $data['merge_with_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['merge_with_id'] === null) { + $invalidProperties[] = "'merge_with_id' 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 merge_with_id + * + * @return int + */ + public function getMergeWithId() + { + return $this->container['merge_with_id']; + } + + /** + * Sets merge_with_id + * + * @param int $merge_with_id The ID of the deal that the deal will be merged with + * + * @return self + */ + public function setMergeWithId($merge_with_id): self + { + $this->container['merge_with_id'] = $merge_with_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MergeOrganizationsRequest.php b/lib/Model/MergeOrganizationsRequest.php new file mode 100644 index 00000000..89b9e6a2 --- /dev/null +++ b/lib/Model/MergeOrganizationsRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergeOrganizationsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'mergeOrganizationsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'merge_with_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merge_with_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merge_with_id' => 'merge_with_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merge_with_id' => 'setMergeWithId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merge_with_id' => 'getMergeWithId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['merge_with_id'] = $data['merge_with_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['merge_with_id'] === null) { + $invalidProperties[] = "'merge_with_id' 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 merge_with_id + * + * @return int + */ + public function getMergeWithId() + { + return $this->container['merge_with_id']; + } + + /** + * Sets merge_with_id + * + * @param int $merge_with_id The ID of the organization that the organization will be merged with + * + * @return self + */ + public function setMergeWithId($merge_with_id): self + { + $this->container['merge_with_id'] = $merge_with_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MergePersonDealRelatedInfo.php b/lib/Model/MergePersonDealRelatedInfo.php new file mode 100644 index 00000000..050f5db9 --- /dev/null +++ b/lib/Model/MergePersonDealRelatedInfo.php @@ -0,0 +1,762 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergePersonDealRelatedInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MergePersonDealRelatedInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'participant_open_deals_count' => 'int', + 'participant_closed_deals_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'participant_open_deals_count' => null, + 'participant_closed_deals_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'participant_open_deals_count' => 'participant_open_deals_count', + 'participant_closed_deals_count' => 'participant_closed_deals_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'participant_open_deals_count' => 'setParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'setParticipantClosedDealsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'participant_open_deals_count' => 'getParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'getParticipantClosedDealsCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['participant_open_deals_count'] = $data['participant_open_deals_count'] ?? null; + $this->container['participant_closed_deals_count'] = $data['participant_closed_deals_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets participant_open_deals_count + * + * @return int|null + */ + public function getParticipantOpenDealsCount() + { + return $this->container['participant_open_deals_count']; + } + + /** + * Sets participant_open_deals_count + * + * @param int|null $participant_open_deals_count The count of open participant deals related with the item + * + * @return self + */ + public function setParticipantOpenDealsCount($participant_open_deals_count): self + { + $this->container['participant_open_deals_count'] = $participant_open_deals_count; + + return $this; + } + + /** + * Gets participant_closed_deals_count + * + * @return int|null + */ + public function getParticipantClosedDealsCount() + { + return $this->container['participant_closed_deals_count']; + } + + /** + * Sets participant_closed_deals_count + * + * @param int|null $participant_closed_deals_count The count of closed participant deals related with the item + * + * @return self + */ + public function setParticipantClosedDealsCount($participant_closed_deals_count): self + { + $this->container['participant_closed_deals_count'] = $participant_closed_deals_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MergePersonItem.php b/lib/Model/MergePersonItem.php new file mode 100644 index 00000000..7f5c905b --- /dev/null +++ b/lib/Model/MergePersonItem.php @@ -0,0 +1,1632 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergePersonItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MergePersonItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'active_flag' => 'bool', + 'phone' => '\Pipedrive\Model\BasePersonItemPhone[]', + 'email' => '\Pipedrive\Model\BasePersonItemEmail[]', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'picture_id' => '\Pipedrive\Model\PictureDataWithID', + 'label' => 'int', + 'org_name' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'owner_id' => 'int', + 'org_id' => 'int', + 'merge_what_id' => 'int', + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'participant_open_deals_count' => 'int', + 'participant_closed_deals_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'active_flag' => null, + 'phone' => null, + 'email' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'picture_id' => null, + 'label' => null, + 'org_name' => null, + 'owner_name' => null, + 'cc_email' => null, + 'owner_id' => null, + 'org_id' => null, + 'merge_what_id' => null, + 'name' => null, + 'first_name' => null, + 'last_name' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'participant_open_deals_count' => null, + 'participant_closed_deals_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'active_flag' => 'active_flag', + 'phone' => 'phone', + 'email' => 'email', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'picture_id' => 'picture_id', + 'label' => 'label', + 'org_name' => 'org_name', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'merge_what_id' => 'merge_what_id', + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'participant_open_deals_count' => 'participant_open_deals_count', + 'participant_closed_deals_count' => 'participant_closed_deals_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'active_flag' => 'setActiveFlag', + 'phone' => 'setPhone', + 'email' => 'setEmail', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'picture_id' => 'setPictureId', + 'label' => 'setLabel', + 'org_name' => 'setOrgName', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'merge_what_id' => 'setMergeWhatId', + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'participant_open_deals_count' => 'setParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'setParticipantClosedDealsCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'active_flag' => 'getActiveFlag', + 'phone' => 'getPhone', + 'email' => 'getEmail', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'picture_id' => 'getPictureId', + 'label' => 'getLabel', + 'org_name' => 'getOrgName', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'merge_what_id' => 'getMergeWhatId', + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'participant_open_deals_count' => 'getParticipantOpenDealsCount', + 'participant_closed_deals_count' => 'getParticipantClosedDealsCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['merge_what_id'] = $data['merge_what_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['participant_open_deals_count'] = $data['participant_open_deals_count'] ?? null; + $this->container['participant_closed_deals_count'] = $data['participant_closed_deals_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the person + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\BasePersonItemEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\BasePersonItemEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first letter of the name of the person + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the person + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithID|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithID|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The label assigned to the person + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the person + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the owner associated with the person + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email associated with the person + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner related to the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization related to the person + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets merge_what_id + * + * @return int|null + */ + public function getMergeWhatId() + { + return $this->container['merge_what_id']; + } + + /** + * Sets merge_what_id + * + * @param int|null $merge_what_id The ID of the person with what the main person was merged + * + * @return self + */ + public function setMergeWhatId($merge_what_id): self + { + $this->container['merge_what_id'] = $merge_what_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets participant_open_deals_count + * + * @return int|null + */ + public function getParticipantOpenDealsCount() + { + return $this->container['participant_open_deals_count']; + } + + /** + * Sets participant_open_deals_count + * + * @param int|null $participant_open_deals_count The count of open participant deals related with the item + * + * @return self + */ + public function setParticipantOpenDealsCount($participant_open_deals_count): self + { + $this->container['participant_open_deals_count'] = $participant_open_deals_count; + + return $this; + } + + /** + * Gets participant_closed_deals_count + * + * @return int|null + */ + public function getParticipantClosedDealsCount() + { + return $this->container['participant_closed_deals_count']; + } + + /** + * Sets participant_closed_deals_count + * + * @param int|null $participant_closed_deals_count The count of closed participant deals related with the item + * + * @return self + */ + public function setParticipantClosedDealsCount($participant_closed_deals_count): self + { + $this->container['participant_closed_deals_count'] = $participant_closed_deals_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MergePersonsRequest.php b/lib/Model/MergePersonsRequest.php new file mode 100644 index 00000000..b5931ffb --- /dev/null +++ b/lib/Model/MergePersonsRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergePersonsRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'mergePersonsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'merge_with_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merge_with_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merge_with_id' => 'merge_with_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merge_with_id' => 'setMergeWithId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merge_with_id' => 'getMergeWithId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['merge_with_id'] = $data['merge_with_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['merge_with_id'] === null) { + $invalidProperties[] = "'merge_with_id' 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 merge_with_id + * + * @return int + */ + public function getMergeWithId() + { + return $this->container['merge_with_id']; + } + + /** + * Sets merge_with_id + * + * @param int $merge_with_id The ID of the person that will not be overwritten. This person’s data will be prioritized in case of conflict with the other person. + * + * @return self + */ + public function setMergeWithId($merge_with_id): self + { + $this->container['merge_with_id'] = $merge_with_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MergePersonsResponse.php b/lib/Model/MergePersonsResponse.php new file mode 100644 index 00000000..3ebfc05c --- /dev/null +++ b/lib/Model/MergePersonsResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergePersonsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MergePersonsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\MergePersonItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\MergePersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MergePersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MergePersonsResponseAllOf.php b/lib/Model/MergePersonsResponseAllOf.php new file mode 100644 index 00000000..5dbf769b --- /dev/null +++ b/lib/Model/MergePersonsResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MergePersonsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MergePersonsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\MergePersonItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\MergePersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MergePersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MessageObject.php b/lib/Model/MessageObject.php new file mode 100644 index 00000000..adf079f8 --- /dev/null +++ b/lib/Model/MessageObject.php @@ -0,0 +1,673 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MessageObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MessageObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'channel_id' => 'string', + 'sender_id' => 'string', + 'conversation_id' => 'string', + 'message' => 'string', + 'status' => 'string', + 'created_at' => '\DateTime', + 'reply_by' => '\DateTime', + 'conversation_link' => 'string', + 'attachments' => '\Pipedrive\Model\MessageObjectAttachments[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'channel_id' => null, + 'sender_id' => null, + 'conversation_id' => null, + 'message' => null, + 'status' => null, + 'created_at' => 'date-time', + 'reply_by' => 'date-time', + 'conversation_link' => 'url', + 'attachments' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'channel_id' => 'channel_id', + 'sender_id' => 'sender_id', + 'conversation_id' => 'conversation_id', + 'message' => 'message', + 'status' => 'status', + 'created_at' => 'created_at', + 'reply_by' => 'reply_by', + 'conversation_link' => 'conversation_link', + 'attachments' => 'attachments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'channel_id' => 'setChannelId', + 'sender_id' => 'setSenderId', + 'conversation_id' => 'setConversationId', + 'message' => 'setMessage', + 'status' => 'setStatus', + 'created_at' => 'setCreatedAt', + 'reply_by' => 'setReplyBy', + 'conversation_link' => 'setConversationLink', + 'attachments' => 'setAttachments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'channel_id' => 'getChannelId', + 'sender_id' => 'getSenderId', + 'conversation_id' => 'getConversationId', + 'message' => 'getMessage', + 'status' => 'getStatus', + 'created_at' => 'getCreatedAt', + 'reply_by' => 'getReplyBy', + 'conversation_link' => 'getConversationLink', + 'attachments' => 'getAttachments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const STATUS_SENT = 'sent'; + const STATUS_DELIVERED = 'delivered'; + const STATUS_READ = 'read'; + const STATUS_FAILED = 'failed'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getStatusAllowableValues(): array + { + return [ + self::STATUS_SENT, + self::STATUS_DELIVERED, + self::STATUS_READ, + self::STATUS_FAILED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['channel_id'] = $data['channel_id'] ?? null; + $this->container['sender_id'] = $data['sender_id'] ?? null; + $this->container['conversation_id'] = $data['conversation_id'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['reply_by'] = $data['reply_by'] ?? null; + $this->container['conversation_link'] = $data['conversation_link'] ?? null; + $this->container['attachments'] = $data['attachments'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['channel_id'] === null) { + $invalidProperties[] = "'channel_id' can't be null"; + } + if ($this->container['sender_id'] === null) { + $invalidProperties[] = "'sender_id' can't be null"; + } + if ($this->container['conversation_id'] === null) { + $invalidProperties[] = "'conversation_id' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The ID of the message + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets channel_id + * + * @return string + */ + public function getChannelId() + { + return $this->container['channel_id']; + } + + /** + * Sets channel_id + * + * @param string $channel_id The channel ID as in the provider + * + * @return self + */ + public function setChannelId($channel_id): self + { + $this->container['channel_id'] = $channel_id; + + return $this; + } + + /** + * Gets sender_id + * + * @return string + */ + public function getSenderId() + { + return $this->container['sender_id']; + } + + /** + * Sets sender_id + * + * @param string $sender_id The ID of the provider's user that sent the message + * + * @return self + */ + public function setSenderId($sender_id): self + { + $this->container['sender_id'] = $sender_id; + + return $this; + } + + /** + * Gets conversation_id + * + * @return string + */ + public function getConversationId() + { + return $this->container['conversation_id']; + } + + /** + * Sets conversation_id + * + * @param string $conversation_id The ID of the conversation + * + * @return self + */ + public function setConversationId($conversation_id): self + { + $this->container['conversation_id'] = $conversation_id; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message The body of the message + * + * @return self + */ + public function setMessage($message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the message + * + * @return self + */ + public function setStatus($status): self + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM + * + * @return self + */ + public function setCreatedAt($created_at): self + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets reply_by + * + * @return \DateTime|null + */ + public function getReplyBy() + { + return $this->container['reply_by']; + } + + /** + * Sets reply_by + * + * @param \DateTime|null $reply_by The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM + * + * @return self + */ + public function setReplyBy($reply_by): self + { + $this->container['reply_by'] = $reply_by; + + return $this; + } + + /** + * Gets conversation_link + * + * @return string|null + */ + public function getConversationLink() + { + return $this->container['conversation_link']; + } + + /** + * Sets conversation_link + * + * @param string|null $conversation_link A URL that can open the conversation in the provider's side + * + * @return self + */ + public function setConversationLink($conversation_link): self + { + $this->container['conversation_link'] = $conversation_link; + + return $this; + } + + /** + * Gets attachments + * + * @return \Pipedrive\Model\MessageObjectAttachments[]|null + */ + public function getAttachments() + { + return $this->container['attachments']; + } + + /** + * Sets attachments + * + * @param \Pipedrive\Model\MessageObjectAttachments[]|null $attachments The list of attachments available in the message + * + * @return self + */ + public function setAttachments($attachments): self + { + $this->container['attachments'] = $attachments; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/MessageObjectAttachments.php b/lib/Model/MessageObjectAttachments.php new file mode 100644 index 00000000..cfd615e1 --- /dev/null +++ b/lib/Model/MessageObjectAttachments.php @@ -0,0 +1,531 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MessageObjectAttachments implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'MessageObject_attachments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'type' => 'string', + 'name' => 'string', + 'size' => 'float', + 'url' => 'string', + 'preview_url' => 'string', + 'link_expires' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'name' => null, + 'size' => null, + 'url' => null, + 'preview_url' => null, + 'link_expires' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'name' => 'name', + 'size' => 'size', + 'url' => 'url', + 'preview_url' => 'preview_url', + 'link_expires' => 'link_expires' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'name' => 'setName', + 'size' => 'setSize', + 'url' => 'setUrl', + 'preview_url' => 'setPreviewUrl', + 'link_expires' => 'setLinkExpires' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'name' => 'getName', + 'size' => 'getSize', + 'url' => 'getUrl', + 'preview_url' => 'getPreviewUrl', + 'link_expires' => 'getLinkExpires' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['size'] = $data['size'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['preview_url'] = $data['preview_url'] ?? null; + $this->container['link_expires'] = $data['link_expires'] ?? false; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The ID of the attachment + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The mime-type of the attachment + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the attachment + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets size + * + * @return float|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float|null $size The size of the attachment + * + * @return self + */ + public function setSize($size): self + { + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url A URL to the file + * + * @return self + */ + public function setUrl($url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets preview_url + * + * @return string|null + */ + public function getPreviewUrl() + { + return $this->container['preview_url']; + } + + /** + * Sets preview_url + * + * @param string|null $preview_url A URL to a preview picture of the file + * + * @return self + */ + public function setPreviewUrl($preview_url): self + { + $this->container['preview_url'] = $preview_url; + + return $this; + } + + /** + * Gets link_expires + * + * @return bool|null + */ + public function getLinkExpires() + { + return $this->container['link_expires']; + } + + /** + * Sets link_expires + * + * @param bool|null $link_expires If true, it will use the getMessageById endpoint for fetching updated attachment's urls. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension) + * + * @return self + */ + public function setLinkExpires($link_expires): self + { + $this->container['link_expires'] = $link_expires; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 00000000..c0c568f5 --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,106 @@ + + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array; + + /** + * Array of property to format mappings. Used for (de)serialization + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array; + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array; + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array; + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(): bool; +} diff --git a/lib/Model/NewDeal.php b/lib/Model/NewDeal.php new file mode 100644 index 00000000..40dd9099 --- /dev/null +++ b/lib/Model/NewDeal.php @@ -0,0 +1,775 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'value' => 'string', + 'currency' => 'string', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'pipeline_id' => 'int', + 'stage_id' => 'int', + 'status' => 'string', + 'expected_close_date' => '\DateTime', + 'probability' => 'float', + 'lost_reason' => 'string', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'value' => null, + 'currency' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'pipeline_id' => null, + 'stage_id' => null, + 'status' => null, + 'expected_close_date' => 'date', + 'probability' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'pipeline_id' => 'pipeline_id', + 'stage_id' => 'stage_id', + 'status' => 'status', + 'expected_close_date' => 'expected_close_date', + 'probability' => 'probability', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'pipeline_id' => 'setPipelineId', + 'stage_id' => 'setStageId', + 'status' => 'setStatus', + 'expected_close_date' => 'setExpectedCloseDate', + 'probability' => 'setProbability', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'pipeline_id' => 'getPipelineId', + 'stage_id' => 'getStageId', + 'status' => 'getStatus', + 'expected_close_date' => 'getExpectedCloseDate', + 'probability' => 'getProbability', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const STATUS_OPEN = 'open'; + const STATUS_WON = 'won'; + const STATUS_LOST = 'lost'; + const STATUS_DELETED = 'deleted'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getStatusAllowableValues(): array + { + return [ + self::STATUS_OPEN, + self::STATUS_WON, + self::STATUS_LOST, + self::STATUS_DELETED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value of the deal. If omitted, value will be set to 0. + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. + * + * @return self + */ + public function setStatus($status): self + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The optional message about why the deal was lost (to be used when status = lost) + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewDealAllOf.php b/lib/Model/NewDealAllOf.php new file mode 100644 index 00000000..698ad00c --- /dev/null +++ b/lib/Model/NewDealAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewDealAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewDeal_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewDealProduct.php b/lib/Model/NewDealProduct.php new file mode 100644 index 00000000..0e61dbb6 --- /dev/null +++ b/lib/Model/NewDealProduct.php @@ -0,0 +1,621 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewDealProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewDealProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'product_id' => 'int', + 'item_price' => 'float', + 'quantity' => 'int', + 'discount_percentage' => 'float', + 'duration' => 'float', + 'duration_unit' => 'DealProductUnitDuration', + 'product_variation_id' => 'int', + 'comments' => 'string', + 'tax' => 'float', + 'enabled_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'item_price' => null, + 'quantity' => null, + 'discount_percentage' => null, + 'duration' => null, + 'duration_unit' => null, + 'product_variation_id' => null, + 'comments' => null, + 'tax' => null, + 'enabled_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'item_price' => 'item_price', + 'quantity' => 'quantity', + 'discount_percentage' => 'discount_percentage', + 'duration' => 'duration', + 'duration_unit' => 'duration_unit', + 'product_variation_id' => 'product_variation_id', + 'comments' => 'comments', + 'tax' => 'tax', + 'enabled_flag' => 'enabled_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'item_price' => 'setItemPrice', + 'quantity' => 'setQuantity', + 'discount_percentage' => 'setDiscountPercentage', + 'duration' => 'setDuration', + 'duration_unit' => 'setDurationUnit', + 'product_variation_id' => 'setProductVariationId', + 'comments' => 'setComments', + 'tax' => 'setTax', + 'enabled_flag' => 'setEnabledFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'item_price' => 'getItemPrice', + 'quantity' => 'getQuantity', + 'discount_percentage' => 'getDiscountPercentage', + 'duration' => 'getDuration', + 'duration_unit' => 'getDurationUnit', + 'product_variation_id' => 'getProductVariationId', + 'comments' => 'getComments', + 'tax' => 'getTax', + 'enabled_flag' => 'getEnabledFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['item_price'] = $data['item_price'] ?? null; + $this->container['quantity'] = $data['quantity'] ?? null; + $this->container['discount_percentage'] = $data['discount_percentage'] ?? 0; + $this->container['duration'] = $data['duration'] ?? 1; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['product_variation_id'] = $data['product_variation_id'] ?? null; + $this->container['comments'] = $data['comments'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['enabled_flag'] = $data['enabled_flag'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['item_price'] === null) { + $invalidProperties[] = "'item_price' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' 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 product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id The ID of the product to use + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets item_price + * + * @return float + */ + public function getItemPrice() + { + return $this->container['item_price']; + } + + /** + * Sets item_price + * + * @param float $item_price The price at which this product will be added to the deal + * + * @return self + */ + public function setItemPrice($item_price): self + { + $this->container['item_price'] = $item_price; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity Quantity – e.g. how many items of this product will be added to the deal + * + * @return self + */ + public function setQuantity($quantity): self + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets discount_percentage + * + * @return float|null + */ + public function getDiscountPercentage() + { + return $this->container['discount_percentage']; + } + + /** + * Sets discount_percentage + * + * @param float|null $discount_percentage The discount %. If omitted, will be set to 0. + * + * @return self + */ + public function setDiscountPercentage($discount_percentage): self + { + $this->container['discount_percentage'] = $discount_percentage; + + return $this; + } + + /** + * Gets duration + * + * @return float|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param float|null $duration The duration of the product. If omitted, will be set to 1. + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets duration_unit + * + * @return DealProductUnitDuration|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param DealProductUnitDuration|null $duration_unit The unit duration of the product + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets product_variation_id + * + * @return int|null + */ + public function getProductVariationId() + { + return $this->container['product_variation_id']; + } + + /** + * Sets product_variation_id + * + * @param int|null $product_variation_id The ID of the product variation to use. When omitted, no variation will be used. + * + * @return self + */ + public function setProductVariationId($product_variation_id): self + { + $this->container['product_variation_id'] = $product_variation_id; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments A textual comment associated with this product-deal attachment + * + * @return self + */ + public function setComments($comments): self + { + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets enabled_flag + * + * @return bool|null + */ + public function getEnabledFlag() + { + return $this->container['enabled_flag']; + } + + /** + * Sets enabled_flag + * + * @param bool|null $enabled_flag Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. + * + * @return self + */ + public function setEnabledFlag($enabled_flag): self + { + $this->container['enabled_flag'] = $enabled_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewFollowerResponse.php b/lib/Model/NewFollowerResponse.php new file mode 100644 index 00000000..411ec37b --- /dev/null +++ b/lib/Model/NewFollowerResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewFollowerResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewFollowerResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\NewFollowerResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\NewFollowerResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\NewFollowerResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewFollowerResponseData.php b/lib/Model/NewFollowerResponseData.php new file mode 100644 index 00000000..2609e594 --- /dev/null +++ b/lib/Model/NewFollowerResponseData.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewFollowerResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewFollowerResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'id' => 'int', + 'product_id' => 'int', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'id' => null, + 'product_id' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'id' => 'id', + 'product_id' => 'product_id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'id' => 'setId', + 'product_id' => 'setProductId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'id' => 'getId', + 'product_id' => 'getProductId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user that was added as follower + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The follower creation time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewGoal.php b/lib/Model/NewGoal.php new file mode 100644 index 00000000..b95dead0 --- /dev/null +++ b/lib/Model/NewGoal.php @@ -0,0 +1,547 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewGoal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'assignee' => 'object', + 'type' => 'object', + 'expected_outcome' => 'object', + 'duration' => 'object', + 'interval' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'assignee' => null, + 'type' => null, + 'expected_outcome' => null, + 'duration' => null, + 'interval' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'assignee' => 'assignee', + 'type' => 'type', + 'expected_outcome' => 'expected_outcome', + 'duration' => 'duration', + 'interval' => 'interval' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'assignee' => 'setAssignee', + 'type' => 'setType', + 'expected_outcome' => 'setExpectedOutcome', + 'duration' => 'setDuration', + 'interval' => 'setInterval' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'assignee' => 'getAssignee', + 'type' => 'getType', + 'expected_outcome' => 'getExpectedOutcome', + 'duration' => 'getDuration', + 'interval' => 'getInterval' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const INTERVAL_WEEKLY = 'weekly'; + const INTERVAL_MONTHLY = 'monthly'; + const INTERVAL_QUARTERLY = 'quarterly'; + const INTERVAL_YEARLY = 'yearly'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getIntervalAllowableValues(): array + { + return [ + self::INTERVAL_WEEKLY, + self::INTERVAL_MONTHLY, + self::INTERVAL_QUARTERLY, + self::INTERVAL_YEARLY, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['assignee'] = $data['assignee'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['expected_outcome'] = $data['expected_outcome'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['interval'] = $data['interval'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['assignee'] === null) { + $invalidProperties[] = "'assignee' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['expected_outcome'] === null) { + $invalidProperties[] = "'expected_outcome' can't be null"; + } + if ($this->container['duration'] === null) { + $invalidProperties[] = "'duration' can't be null"; + } + if ($this->container['interval'] === null) { + $invalidProperties[] = "'interval' can't be null"; + } + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the goal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets assignee + * + * @return object + */ + public function getAssignee() + { + return $this->container['assignee']; + } + + /** + * Sets assignee + * + * @param object $assignee Who this goal is assigned to. It requires the following JSON structure: `{ \"id\": \"1\", \"type\": \"person\" }`. `type` can be either `person`, `company` or `team`. ID of the assignee person, company or team. + * + * @return self + */ + public function setAssignee($assignee): self + { + $this->container['assignee'] = $assignee; + + return $this; + } + + /** + * Gets type + * + * @return object + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param object $type The type of the goal. It requires the following JSON structure: `{ \"name\": \"deals_started\", \"params\": { \"pipeline_id\": [1, 2], \"activity_type_id\": [9] } }`. Type can be one of: `deals_won`, `deals_progressed`, `activities_completed`, `activities_added`, `deals_started` or `revenue_forecast`. `params` can include `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is related to only `deals_progressed` type of goals and `activity_type_id` to `activities_completed` or `activities_added` types of goals. The `pipeline_id` and `activity_type_id` need to be given as an array of integers. To track the goal in all pipelines, set `pipeline_id` as `null` and similarly, to track the goal for all activities, set `activity_type_id` as `null`.” + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets expected_outcome + * + * @return object + */ + public function getExpectedOutcome() + { + return $this->container['expected_outcome']; + } + + /** + * Sets expected_outcome + * + * @param object $expected_outcome The expected outcome of the goal. Expected outcome can be tracked either by `quantity` or by `sum`. It requires the following JSON structure: `{ \"target\": \"50\", \"tracking_metric\": \"quantity\" }` or `{ \"target\": \"50\", \"tracking_metric\": \"sum\", \"currency_id\": 1 }`. `currency_id` should only be added to `sum` type of goals. + * + * @return self + */ + public function setExpectedOutcome($expected_outcome): self + { + $this->container['expected_outcome'] = $expected_outcome; + + return $this; + } + + /** + * Gets duration + * + * @return object + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param object $duration The date when the goal starts and ends. It requires the following JSON structure: `{ \"start\": \"2019-01-01\", \"end\": \"2022-12-31\" }`. Date in format of YYYY-MM-DD. \"end\" can be set to `null` for an infinite, open-ended goal. + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets interval + * + * @return string + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string $interval The interval of the goal + * + * @return self + */ + public function setInterval($interval): self + { + $allowedValues = $this->getIntervalAllowableValues(); + if (!in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['interval'] = $interval; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewOrganization.php b/lib/Model/NewOrganization.php new file mode 100644 index 00000000..51154082 --- /dev/null +++ b/lib/Model/NewOrganization.php @@ -0,0 +1,435 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewOrganization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'add_time' => 'string', + 'owner_id' => 'int', + 'visible_to' => '\Pipedrive\Model\VisibleTo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'add_time' => null, + 'owner_id' => null, + 'visible_to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'add_time' => 'add_time', + 'owner_id' => 'owner_id', + 'visible_to' => 'visible_to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'add_time' => 'setAddTime', + 'owner_id' => 'setOwnerId', + 'visible_to' => 'setVisibleTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'add_time' => 'getAddTime', + 'owner_id' => 'getOwnerId', + 'visible_to' => 'getVisibleTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the organization in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewOrganizationAllOf.php b/lib/Model/NewOrganizationAllOf.php new file mode 100644 index 00000000..3f0330bf --- /dev/null +++ b/lib/Model/NewOrganizationAllOf.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewOrganizationAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewOrganization_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the organization in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewPerson.php b/lib/Model/NewPerson.php new file mode 100644 index 00000000..00d50e93 --- /dev/null +++ b/lib/Model/NewPerson.php @@ -0,0 +1,555 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewPerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewPerson'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'org_id' => 'int', + 'email' => '\Pipedrive\Model\BasicPersonEmail[]', + 'phone' => '\Pipedrive\Model\BasePersonItemPhone[]', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'marketing_status' => '\Pipedrive\Model\MarketingStatus', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'org_id' => null, + 'email' => null, + 'phone' => null, + 'visible_to' => null, + 'marketing_status' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'email' => 'email', + 'phone' => 'phone', + 'visible_to' => 'visible_to', + 'marketing_status' => 'marketing_status', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'visible_to' => 'setVisibleTo', + 'marketing_status' => 'setMarketingStatus', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'visible_to' => 'getVisibleTo', + 'marketing_status' => 'getMarketingStatus', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['marketing_status'] = $data['marketing_status'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this person will belong to + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\BasicPersonEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\BasicPersonEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets marketing_status + * + * @return MarketingStatus|null + */ + public function getMarketingStatus() + { + return $this->container['marketing_status']; + } + + /** + * Sets marketing_status + * + * @param MarketingStatus|null $marketing_status If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
+ * + * @return self + */ + public function setMarketingStatus($marketing_status): self + { + $this->container['marketing_status'] = $marketing_status; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewPersonAllOf.php b/lib/Model/NewPersonAllOf.php new file mode 100644 index 00000000..561ca54b --- /dev/null +++ b/lib/Model/NewPersonAllOf.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewPersonAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewPerson_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NewProductField.php b/lib/Model/NewProductField.php new file mode 100644 index 00000000..7a75a3eb --- /dev/null +++ b/lib/Model/NewProductField.php @@ -0,0 +1,472 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NewProductField implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NewProductField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'options' => 'object[]', + 'field_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'options' => null, + 'field_type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'options' => 'options', + 'field_type' => 'field_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'options' => 'setOptions', + 'field_type' => 'setFieldType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'options' => 'getOptions', + 'field_type' => 'getFieldType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const FIELD_TYPE_VARCHAR = 'varchar'; + const FIELD_TYPE_VARCHAR_AUTO = 'varchar_auto'; + const FIELD_TYPE_TEXT = 'text'; + const FIELD_TYPE_DOUBLE = 'double'; + const FIELD_TYPE_MONETARY = 'monetary'; + const FIELD_TYPE_DATE = 'date'; + const FIELD_TYPE_SET = 'set'; + const FIELD_TYPE_ENUM = 'enum'; + const FIELD_TYPE_USER = 'user'; + const FIELD_TYPE_ORG = 'org'; + const FIELD_TYPE_PEOPLE = 'people'; + const FIELD_TYPE_PHONE = 'phone'; + const FIELD_TYPE_TIME = 'time'; + const FIELD_TYPE_TIMERANGE = 'timerange'; + const FIELD_TYPE_DATERANGE = 'daterange'; + const FIELD_TYPE_ADDRESS = 'address'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getFieldTypeAllowableValues(): array + { + return [ + self::FIELD_TYPE_VARCHAR, + self::FIELD_TYPE_VARCHAR_AUTO, + self::FIELD_TYPE_TEXT, + self::FIELD_TYPE_DOUBLE, + self::FIELD_TYPE_MONETARY, + self::FIELD_TYPE_DATE, + self::FIELD_TYPE_SET, + self::FIELD_TYPE_ENUM, + self::FIELD_TYPE_USER, + self::FIELD_TYPE_ORG, + self::FIELD_TYPE_PEOPLE, + self::FIELD_TYPE_PHONE, + self::FIELD_TYPE_TIME, + self::FIELD_TYPE_TIMERANGE, + self::FIELD_TYPE_DATERANGE, + self::FIELD_TYPE_ADDRESS, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['options'] = $data['options'] ?? null; + $this->container['field_type'] = $data['field_type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['field_type'] === null) { + $invalidProperties[] = "'field_type' can't be null"; + } + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!is_null($this->container['field_type']) && !in_array($this->container['field_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'field_type', must be one of '%s'", + $this->container['field_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return object[]|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param object[]|null $options When `field_type` is either `set` or `enum`, possible options must be supplied as a JSON-encoded sequential array, for example:
`[{\"label\":\"red\"}, {\"label\":\"blue\"}, {\"label\":\"lilac\"}]` + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets field_type + * + * @return string + */ + public function getFieldType() + { + return $this->container['field_type']; + } + + /** + * Sets field_type + * + * @param string $field_type The type of the field
ValueDescription
`varchar`Text (up to 255 characters)
`varchar_auto`Autocomplete text (up to 255 characters)
`text`Long text (up to 65k characters)
`double`Numeric value
`monetary`Monetary field (has a numeric value and a currency value)
`date`Date (format YYYY-MM-DD)
`set`Options field with a possibility of having multiple chosen options
`enum`Options field with a single possible chosen option
`user`User field (contains a user ID of another Pipedrive user)
`org`Organization field (contains an organization ID which is stored on the same account)
`people`Person field (contains a product ID which is stored on the same account)
`phone`Phone field (up to 255 numbers and/or characters)
`time`Time field (format HH:MM:SS)
`timerange`Time-range field (has a start time and end time value, both HH:MM:SS)
`daterange`Date-range field (has a start date and end date value, both YYYY-MM-DD)
`address`Address field (autocompleted by Google Maps)
+ * + * @return self + */ + public function setFieldType($field_type): self + { + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Note.php b/lib/Model/Note.php new file mode 100644 index 00000000..5e110e26 --- /dev/null +++ b/lib/Model/Note.php @@ -0,0 +1,642 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +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 string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'content' => 'string', + 'lead_id' => 'string', + 'deal_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'user_id' => 'int', + 'add_time' => 'string', + 'pinned_to_lead_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_deal_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_organization_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_person_flag' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null, + 'lead_id' => 'uuid', + 'deal_id' => null, + 'person_id' => null, + 'org_id' => null, + 'user_id' => null, + 'add_time' => null, + 'pinned_to_lead_flag' => null, + 'pinned_to_deal_flag' => null, + 'pinned_to_organization_flag' => null, + 'pinned_to_person_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content', + 'lead_id' => 'lead_id', + 'deal_id' => 'deal_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'user_id' => 'user_id', + 'add_time' => 'add_time', + 'pinned_to_lead_flag' => 'pinned_to_lead_flag', + 'pinned_to_deal_flag' => 'pinned_to_deal_flag', + 'pinned_to_organization_flag' => 'pinned_to_organization_flag', + 'pinned_to_person_flag' => 'pinned_to_person_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent', + 'lead_id' => 'setLeadId', + 'deal_id' => 'setDealId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'user_id' => 'setUserId', + 'add_time' => 'setAddTime', + 'pinned_to_lead_flag' => 'setPinnedToLeadFlag', + 'pinned_to_deal_flag' => 'setPinnedToDealFlag', + 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'setPinnedToPersonFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent', + 'lead_id' => 'getLeadId', + 'deal_id' => 'getDealId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'user_id' => 'getUserId', + 'add_time' => 'getAddTime', + 'pinned_to_lead_flag' => 'getPinnedToLeadFlag', + 'pinned_to_deal_flag' => 'getPinnedToDealFlag', + 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'getPinnedToPersonFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = $data['content'] ?? null; + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['pinned_to_lead_flag'] = $data['pinned_to_lead_flag'] ?? null; + $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; + $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; + $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content The content of the note in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead the note will be attached to + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal the note will be attached to + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person the note will be attached to + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization the note will be attached to + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user who will be marked as the author of the note. Only an admin can change the author. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets pinned_to_lead_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToLeadFlag() + { + return $this->container['pinned_to_lead_flag']; + } + + /** + * Sets pinned_to_lead_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (`lead_id` is also required) + * + * @return self + */ + public function setPinnedToLeadFlag($pinned_to_lead_flag): self + { + $this->container['pinned_to_lead_flag'] = $pinned_to_lead_flag; + + return $this; + } + + /** + * Gets pinned_to_deal_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToDealFlag() + { + return $this->container['pinned_to_deal_flag']; + } + + /** + * Sets pinned_to_deal_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (`deal_id` is also required) + * + * @return self + */ + public function setPinnedToDealFlag($pinned_to_deal_flag): self + { + $this->container['pinned_to_deal_flag'] = $pinned_to_deal_flag; + + return $this; + } + + /** + * Gets pinned_to_organization_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToOrganizationFlag() + { + return $this->container['pinned_to_organization_flag']; + } + + /** + * Sets pinned_to_organization_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (`org_id` is also required) + * + * @return self + */ + public function setPinnedToOrganizationFlag($pinned_to_organization_flag): self + { + $this->container['pinned_to_organization_flag'] = $pinned_to_organization_flag; + + return $this; + } + + /** + * Gets pinned_to_person_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToPersonFlag() + { + return $this->container['pinned_to_person_flag']; + } + + /** + * Sets pinned_to_person_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (`person_id` is also required) + * + * @return self + */ + public function setPinnedToPersonFlag($pinned_to_person_flag): self + { + $this->container['pinned_to_person_flag'] = $pinned_to_person_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteAllOf.php b/lib/Model/NoteAllOf.php new file mode 100644 index 00000000..ab732822 --- /dev/null +++ b/lib/Model/NoteAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Note_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'content' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'content' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'content' => 'content' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'content' => 'setContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'content' => 'getContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['content'] = $data['content'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets content + * + * @return string|null + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string|null $content The content of the note in HTML format. Subject to sanitization on the back-end. + * + * @return self + */ + public function setContent($content): self + { + $this->container['content'] = $content; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteConnectToParams.php b/lib/Model/NoteConnectToParams.php new file mode 100644 index 00000000..570e8e66 --- /dev/null +++ b/lib/Model/NoteConnectToParams.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteConnectToParams implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteConnectToParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'lead_id' => 'string', + 'deal_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'lead_id' => 'uuid', + 'deal_id' => null, + 'person_id' => null, + 'org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lead_id' => 'lead_id', + 'deal_id' => 'deal_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lead_id' => 'setLeadId', + 'deal_id' => 'setDealId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lead_id' => 'getLeadId', + 'deal_id' => 'getDealId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['lead_id'] = $data['lead_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets lead_id + * + * @return string|null + */ + public function getLeadId() + { + return $this->container['lead_id']; + } + + /** + * Sets lead_id + * + * @param string|null $lead_id The ID of the lead the note will be attached to + * + * @return self + */ + public function setLeadId($lead_id): self + { + $this->container['lead_id'] = $lead_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal the note will be attached to + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person the note will be attached to + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization the note will be attached to + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteCreatorUser.php b/lib/Model/NoteCreatorUser.php new file mode 100644 index 00000000..39bc57f2 --- /dev/null +++ b/lib/Model/NoteCreatorUser.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteCreatorUser implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteCreatorUser'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email' => 'string', + 'icon_url' => 'string', + 'is_you' => 'bool', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email' => null, + 'icon_url' => null, + 'is_you' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'icon_url' => 'icon_url', + 'is_you' => 'is_you', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'icon_url' => 'setIconUrl', + 'is_you' => 'setIsYou', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'icon_url' => 'getIconUrl', + 'is_you' => 'getIsYou', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = $data['email'] ?? null; + $this->container['icon_url'] = $data['icon_url'] ?? null; + $this->container['is_you'] = $data['is_you'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the note creator + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url The URL of the note creator avatar picture + * + * @return self + */ + public function setIconUrl($icon_url): self + { + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets is_you + * + * @return bool|null + */ + public function getIsYou() + { + return $this->container['is_you']; + } + + /** + * Sets is_you + * + * @param bool|null $is_you Whether the note is created by you or not + * + * @return self + */ + public function setIsYou($is_you): self + { + $this->container['is_you'] = $is_you; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the note creator + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteField.php b/lib/Model/NoteField.php new file mode 100644 index 00000000..e554b4ca --- /dev/null +++ b/lib/Model/NoteField.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteField implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'key' => 'string', + 'name' => 'string', + 'field_type' => '\Pipedrive\Model\FieldTypeAsString', + 'active_flag' => 'bool', + 'edit_flag' => 'bool', + 'bulk_edit_allowed' => 'bool', + 'mandatory_flag' => 'bool', + 'options' => '\Pipedrive\Model\NoteFieldOptions[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'key' => null, + 'name' => null, + 'field_type' => null, + 'active_flag' => null, + 'edit_flag' => null, + 'bulk_edit_allowed' => null, + 'mandatory_flag' => null, + 'options' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'name' => 'name', + 'field_type' => 'field_type', + 'active_flag' => 'active_flag', + 'edit_flag' => 'edit_flag', + 'bulk_edit_allowed' => 'bulk_edit_allowed', + 'mandatory_flag' => 'mandatory_flag', + 'options' => 'options' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'name' => 'setName', + 'field_type' => 'setFieldType', + 'active_flag' => 'setActiveFlag', + 'edit_flag' => 'setEditFlag', + 'bulk_edit_allowed' => 'setBulkEditAllowed', + 'mandatory_flag' => 'setMandatoryFlag', + 'options' => 'setOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'name' => 'getName', + 'field_type' => 'getFieldType', + 'active_flag' => 'getActiveFlag', + 'edit_flag' => 'getEditFlag', + 'bulk_edit_allowed' => 'getBulkEditAllowed', + 'mandatory_flag' => 'getMandatoryFlag', + 'options' => 'getOptions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['key'] = $data['key'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['field_type'] = $data['field_type'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['edit_flag'] = $data['edit_flag'] ?? null; + $this->container['bulk_edit_allowed'] = $data['bulk_edit_allowed'] ?? null; + $this->container['mandatory_flag'] = $data['mandatory_flag'] ?? null; + $this->container['options'] = $data['options'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the field + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key of the field + * + * @return self + */ + public function setKey($key): self + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets field_type + * + * @return \Pipedrive\Model\FieldTypeAsString|null + */ + public function getFieldType() + { + return $this->container['field_type']; + } + + /** + * Sets field_type + * + * @param \Pipedrive\Model\FieldTypeAsString|null $field_type field_type + * + * @return self + */ + public function setFieldType($field_type): self + { + $this->container['field_type'] = $field_type; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag The active flag of the field + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets edit_flag + * + * @return bool|null + */ + public function getEditFlag() + { + return $this->container['edit_flag']; + } + + /** + * Sets edit_flag + * + * @param bool|null $edit_flag The edit flag of the field + * + * @return self + */ + public function setEditFlag($edit_flag): self + { + $this->container['edit_flag'] = $edit_flag; + + return $this; + } + + /** + * Gets bulk_edit_allowed + * + * @return bool|null + */ + public function getBulkEditAllowed() + { + return $this->container['bulk_edit_allowed']; + } + + /** + * Sets bulk_edit_allowed + * + * @param bool|null $bulk_edit_allowed Not used + * + * @return self + */ + public function setBulkEditAllowed($bulk_edit_allowed): self + { + $this->container['bulk_edit_allowed'] = $bulk_edit_allowed; + + return $this; + } + + /** + * Gets mandatory_flag + * + * @return bool|null + */ + public function getMandatoryFlag() + { + return $this->container['mandatory_flag']; + } + + /** + * Sets mandatory_flag + * + * @param bool|null $mandatory_flag Whether or not the field is mandatory + * + * @return self + */ + public function setMandatoryFlag($mandatory_flag): self + { + $this->container['mandatory_flag'] = $mandatory_flag; + + return $this; + } + + /** + * Gets options + * + * @return \Pipedrive\Model\NoteFieldOptions[]|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param \Pipedrive\Model\NoteFieldOptions[]|null $options The options of the field. When there are no options, `null` is returned. + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteFieldOptions.php b/lib/Model/NoteFieldOptions.php new file mode 100644 index 00000000..49dcc56e --- /dev/null +++ b/lib/Model/NoteFieldOptions.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteFieldOptions implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteField_options'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['label'] = $data['label'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteFieldsResponse.php b/lib/Model/NoteFieldsResponse.php new file mode 100644 index 00000000..5a07963b --- /dev/null +++ b/lib/Model/NoteFieldsResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteFieldsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteFieldsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\NoteField[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\NoteField[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\NoteField[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteFieldsResponseAllOf.php b/lib/Model/NoteFieldsResponseAllOf.php new file mode 100644 index 00000000..b7eab505 --- /dev/null +++ b/lib/Model/NoteFieldsResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteFieldsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteFieldsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\NoteField[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\NoteField[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\NoteField[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NoteParams.php b/lib/Model/NoteParams.php new file mode 100644 index 00000000..7541bcfe --- /dev/null +++ b/lib/Model/NoteParams.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class NoteParams implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'NoteParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'add_time' => 'string', + 'pinned_to_lead_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_deal_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_organization_flag' => '\Pipedrive\Model\NumberBoolean', + 'pinned_to_person_flag' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'add_time' => null, + 'pinned_to_lead_flag' => null, + 'pinned_to_deal_flag' => null, + 'pinned_to_organization_flag' => null, + 'pinned_to_person_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'add_time' => 'add_time', + 'pinned_to_lead_flag' => 'pinned_to_lead_flag', + 'pinned_to_deal_flag' => 'pinned_to_deal_flag', + 'pinned_to_organization_flag' => 'pinned_to_organization_flag', + 'pinned_to_person_flag' => 'pinned_to_person_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'add_time' => 'setAddTime', + 'pinned_to_lead_flag' => 'setPinnedToLeadFlag', + 'pinned_to_deal_flag' => 'setPinnedToDealFlag', + 'pinned_to_organization_flag' => 'setPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'setPinnedToPersonFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'add_time' => 'getAddTime', + 'pinned_to_lead_flag' => 'getPinnedToLeadFlag', + 'pinned_to_deal_flag' => 'getPinnedToDealFlag', + 'pinned_to_organization_flag' => 'getPinnedToOrganizationFlag', + 'pinned_to_person_flag' => 'getPinnedToPersonFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['pinned_to_lead_flag'] = $data['pinned_to_lead_flag'] ?? null; + $this->container['pinned_to_deal_flag'] = $data['pinned_to_deal_flag'] ?? null; + $this->container['pinned_to_organization_flag'] = $data['pinned_to_organization_flag'] ?? null; + $this->container['pinned_to_person_flag'] = $data['pinned_to_person_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user who will be marked as the author of the note. Only an admin can change the author. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets pinned_to_lead_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToLeadFlag() + { + return $this->container['pinned_to_lead_flag']; + } + + /** + * Sets pinned_to_lead_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_lead_flag If set, the results are filtered by note to lead pinning state (`lead_id` is also required) + * + * @return self + */ + public function setPinnedToLeadFlag($pinned_to_lead_flag): self + { + $this->container['pinned_to_lead_flag'] = $pinned_to_lead_flag; + + return $this; + } + + /** + * Gets pinned_to_deal_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToDealFlag() + { + return $this->container['pinned_to_deal_flag']; + } + + /** + * Sets pinned_to_deal_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_deal_flag If set, the results are filtered by note to deal pinning state (`deal_id` is also required) + * + * @return self + */ + public function setPinnedToDealFlag($pinned_to_deal_flag): self + { + $this->container['pinned_to_deal_flag'] = $pinned_to_deal_flag; + + return $this; + } + + /** + * Gets pinned_to_organization_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToOrganizationFlag() + { + return $this->container['pinned_to_organization_flag']; + } + + /** + * Sets pinned_to_organization_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_organization_flag If set, the results are filtered by note to organization pinning state (`org_id` is also required) + * + * @return self + */ + public function setPinnedToOrganizationFlag($pinned_to_organization_flag): self + { + $this->container['pinned_to_organization_flag'] = $pinned_to_organization_flag; + + return $this; + } + + /** + * Gets pinned_to_person_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getPinnedToPersonFlag() + { + return $this->container['pinned_to_person_flag']; + } + + /** + * Sets pinned_to_person_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $pinned_to_person_flag If set, the results are filtered by note to person pinning state (`person_id` is also required) + * + * @return self + */ + public function setPinnedToPersonFlag($pinned_to_person_flag): self + { + $this->container['pinned_to_person_flag'] = $pinned_to_person_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/NumberBoolean.php b/lib/Model/NumberBoolean.php new file mode 100644 index 00000000..c3023ca2 --- /dev/null +++ b/lib/Model/NumberBoolean.php @@ -0,0 +1,62 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ObjectPrices implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ObjectPrices'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'prices' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets prices + * + * @return object|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object|null $prices Object of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OneLeadResponse200.php b/lib/Model/OneLeadResponse200.php new file mode 100644 index 00000000..de3d16f6 --- /dev/null +++ b/lib/Model/OneLeadResponse200.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OneLeadResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'oneLeadResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\LeadResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\LeadResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\LeadResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OptionalNameObject.php b/lib/Model/OptionalNameObject.php new file mode 100644 index 00000000..027e7a5f --- /dev/null +++ b/lib/Model/OptionalNameObject.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OptionalNameObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OptionalNameObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrgAndOwnerId.php b/lib/Model/OrgAndOwnerId.php new file mode 100644 index 00000000..c20cc05c --- /dev/null +++ b/lib/Model/OrgAndOwnerId.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrgAndOwnerId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrgAndOwnerId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => '\Pipedrive\Model\Owner', + 'org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationAddressInfo.php b/lib/Model/OrganizationAddressInfo.php new file mode 100644 index 00000000..ef005a8e --- /dev/null +++ b/lib/Model/OrganizationAddressInfo.php @@ -0,0 +1,642 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationAddressInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationAddressInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'address' => 'string', + 'address_subpremise' => 'string', + 'address_street_number' => 'string', + 'address_route' => 'string', + 'address_sublocality' => 'string', + 'address_locality' => 'string', + 'address_admin_area_level_1' => 'string', + 'address_admin_area_level_2' => 'string', + 'address_country' => 'string', + 'address_postal_code' => 'string', + 'address_formatted_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'address_subpremise' => null, + 'address_street_number' => null, + 'address_route' => null, + 'address_sublocality' => null, + 'address_locality' => null, + 'address_admin_area_level_1' => null, + 'address_admin_area_level_2' => null, + 'address_country' => null, + 'address_postal_code' => null, + 'address_formatted_address' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'address_subpremise' => 'address_subpremise', + 'address_street_number' => 'address_street_number', + 'address_route' => 'address_route', + 'address_sublocality' => 'address_sublocality', + 'address_locality' => 'address_locality', + 'address_admin_area_level_1' => 'address_admin_area_level_1', + 'address_admin_area_level_2' => 'address_admin_area_level_2', + 'address_country' => 'address_country', + 'address_postal_code' => 'address_postal_code', + 'address_formatted_address' => 'address_formatted_address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'address_subpremise' => 'setAddressSubpremise', + 'address_street_number' => 'setAddressStreetNumber', + 'address_route' => 'setAddressRoute', + 'address_sublocality' => 'setAddressSublocality', + 'address_locality' => 'setAddressLocality', + 'address_admin_area_level_1' => 'setAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'setAddressAdminAreaLevel2', + 'address_country' => 'setAddressCountry', + 'address_postal_code' => 'setAddressPostalCode', + 'address_formatted_address' => 'setAddressFormattedAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'address_subpremise' => 'getAddressSubpremise', + 'address_street_number' => 'getAddressStreetNumber', + 'address_route' => 'getAddressRoute', + 'address_sublocality' => 'getAddressSublocality', + 'address_locality' => 'getAddressLocality', + 'address_admin_area_level_1' => 'getAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'getAddressAdminAreaLevel2', + 'address_country' => 'getAddressCountry', + 'address_postal_code' => 'getAddressPostalCode', + 'address_formatted_address' => 'getAddressFormattedAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = $data['address'] ?? null; + $this->container['address_subpremise'] = $data['address_subpremise'] ?? null; + $this->container['address_street_number'] = $data['address_street_number'] ?? null; + $this->container['address_route'] = $data['address_route'] ?? null; + $this->container['address_sublocality'] = $data['address_sublocality'] ?? null; + $this->container['address_locality'] = $data['address_locality'] ?? null; + $this->container['address_admin_area_level_1'] = $data['address_admin_area_level_1'] ?? null; + $this->container['address_admin_area_level_2'] = $data['address_admin_area_level_2'] ?? null; + $this->container['address_country'] = $data['address_country'] ?? null; + $this->container['address_postal_code'] = $data['address_postal_code'] ?? null; + $this->container['address_formatted_address'] = $data['address_formatted_address'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The full address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets address_subpremise + * + * @return string|null + */ + public function getAddressSubpremise() + { + return $this->container['address_subpremise']; + } + + /** + * Sets address_subpremise + * + * @param string|null $address_subpremise The sub-premise of the organization location + * + * @return self + */ + public function setAddressSubpremise($address_subpremise): self + { + $this->container['address_subpremise'] = $address_subpremise; + + return $this; + } + + /** + * Gets address_street_number + * + * @return string|null + */ + public function getAddressStreetNumber() + { + return $this->container['address_street_number']; + } + + /** + * Sets address_street_number + * + * @param string|null $address_street_number The street number of the organization location + * + * @return self + */ + public function setAddressStreetNumber($address_street_number): self + { + $this->container['address_street_number'] = $address_street_number; + + return $this; + } + + /** + * Gets address_route + * + * @return string|null + */ + public function getAddressRoute() + { + return $this->container['address_route']; + } + + /** + * Sets address_route + * + * @param string|null $address_route The route of the organization location + * + * @return self + */ + public function setAddressRoute($address_route): self + { + $this->container['address_route'] = $address_route; + + return $this; + } + + /** + * Gets address_sublocality + * + * @return string|null + */ + public function getAddressSublocality() + { + return $this->container['address_sublocality']; + } + + /** + * Sets address_sublocality + * + * @param string|null $address_sublocality The sub-locality of the organization location + * + * @return self + */ + public function setAddressSublocality($address_sublocality): self + { + $this->container['address_sublocality'] = $address_sublocality; + + return $this; + } + + /** + * Gets address_locality + * + * @return string|null + */ + public function getAddressLocality() + { + return $this->container['address_locality']; + } + + /** + * Sets address_locality + * + * @param string|null $address_locality The locality of the organization location + * + * @return self + */ + public function setAddressLocality($address_locality): self + { + $this->container['address_locality'] = $address_locality; + + return $this; + } + + /** + * Gets address_admin_area_level_1 + * + * @return string|null + */ + public function getAddressAdminAreaLevel1() + { + return $this->container['address_admin_area_level_1']; + } + + /** + * Sets address_admin_area_level_1 + * + * @param string|null $address_admin_area_level_1 The level 1 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel1($address_admin_area_level_1): self + { + $this->container['address_admin_area_level_1'] = $address_admin_area_level_1; + + return $this; + } + + /** + * Gets address_admin_area_level_2 + * + * @return string|null + */ + public function getAddressAdminAreaLevel2() + { + return $this->container['address_admin_area_level_2']; + } + + /** + * Sets address_admin_area_level_2 + * + * @param string|null $address_admin_area_level_2 The level 2 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel2($address_admin_area_level_2): self + { + $this->container['address_admin_area_level_2'] = $address_admin_area_level_2; + + return $this; + } + + /** + * Gets address_country + * + * @return string|null + */ + public function getAddressCountry() + { + return $this->container['address_country']; + } + + /** + * Sets address_country + * + * @param string|null $address_country The country of the organization location + * + * @return self + */ + public function setAddressCountry($address_country): self + { + $this->container['address_country'] = $address_country; + + return $this; + } + + /** + * Gets address_postal_code + * + * @return string|null + */ + public function getAddressPostalCode() + { + return $this->container['address_postal_code']; + } + + /** + * Sets address_postal_code + * + * @param string|null $address_postal_code The postal code of the organization location + * + * @return self + */ + public function setAddressPostalCode($address_postal_code): self + { + $this->container['address_postal_code'] = $address_postal_code; + + return $this; + } + + /** + * Gets address_formatted_address + * + * @return string|null + */ + public function getAddressFormattedAddress() + { + return $this->container['address_formatted_address']; + } + + /** + * Sets address_formatted_address + * + * @param string|null $address_formatted_address The formatted organization location + * + * @return self + */ + public function setAddressFormattedAddress($address_formatted_address): self + { + $this->container['address_formatted_address'] = $address_formatted_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationCountAndAddressInfo.php b/lib/Model/OrganizationCountAndAddressInfo.php new file mode 100644 index 00000000..19269f2a --- /dev/null +++ b/lib/Model/OrganizationCountAndAddressInfo.php @@ -0,0 +1,882 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationCountAndAddressInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationCountAndAddressInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email_messages_count' => 'int', + 'people_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'address' => 'string', + 'address_subpremise' => 'string', + 'address_street_number' => 'string', + 'address_route' => 'string', + 'address_sublocality' => 'string', + 'address_locality' => 'string', + 'address_admin_area_level_1' => 'string', + 'address_admin_area_level_2' => 'string', + 'address_country' => 'string', + 'address_postal_code' => 'string', + 'address_formatted_address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email_messages_count' => null, + 'people_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'address' => null, + 'address_subpremise' => null, + 'address_street_number' => null, + 'address_route' => null, + 'address_sublocality' => null, + 'address_locality' => null, + 'address_admin_area_level_1' => null, + 'address_admin_area_level_2' => null, + 'address_country' => null, + 'address_postal_code' => null, + 'address_formatted_address' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_messages_count' => 'email_messages_count', + 'people_count' => 'people_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'address' => 'address', + 'address_subpremise' => 'address_subpremise', + 'address_street_number' => 'address_street_number', + 'address_route' => 'address_route', + 'address_sublocality' => 'address_sublocality', + 'address_locality' => 'address_locality', + 'address_admin_area_level_1' => 'address_admin_area_level_1', + 'address_admin_area_level_2' => 'address_admin_area_level_2', + 'address_country' => 'address_country', + 'address_postal_code' => 'address_postal_code', + 'address_formatted_address' => 'address_formatted_address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_messages_count' => 'setEmailMessagesCount', + 'people_count' => 'setPeopleCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'address' => 'setAddress', + 'address_subpremise' => 'setAddressSubpremise', + 'address_street_number' => 'setAddressStreetNumber', + 'address_route' => 'setAddressRoute', + 'address_sublocality' => 'setAddressSublocality', + 'address_locality' => 'setAddressLocality', + 'address_admin_area_level_1' => 'setAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'setAddressAdminAreaLevel2', + 'address_country' => 'setAddressCountry', + 'address_postal_code' => 'setAddressPostalCode', + 'address_formatted_address' => 'setAddressFormattedAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_messages_count' => 'getEmailMessagesCount', + 'people_count' => 'getPeopleCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'address' => 'getAddress', + 'address_subpremise' => 'getAddressSubpremise', + 'address_street_number' => 'getAddressStreetNumber', + 'address_route' => 'getAddressRoute', + 'address_sublocality' => 'getAddressSublocality', + 'address_locality' => 'getAddressLocality', + 'address_admin_area_level_1' => 'getAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'getAddressAdminAreaLevel2', + 'address_country' => 'getAddressCountry', + 'address_postal_code' => 'getAddressPostalCode', + 'address_formatted_address' => 'getAddressFormattedAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['address_subpremise'] = $data['address_subpremise'] ?? null; + $this->container['address_street_number'] = $data['address_street_number'] ?? null; + $this->container['address_route'] = $data['address_route'] ?? null; + $this->container['address_sublocality'] = $data['address_sublocality'] ?? null; + $this->container['address_locality'] = $data['address_locality'] ?? null; + $this->container['address_admin_area_level_1'] = $data['address_admin_area_level_1'] ?? null; + $this->container['address_admin_area_level_2'] = $data['address_admin_area_level_2'] ?? null; + $this->container['address_country'] = $data['address_country'] ?? null; + $this->container['address_postal_code'] = $data['address_postal_code'] ?? null; + $this->container['address_formatted_address'] = $data['address_formatted_address'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the organization + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The count of persons related to the organization + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the organization + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the organization + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the organization + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the organization + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the organization + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the organization + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The full address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets address_subpremise + * + * @return string|null + */ + public function getAddressSubpremise() + { + return $this->container['address_subpremise']; + } + + /** + * Sets address_subpremise + * + * @param string|null $address_subpremise The sub-premise of the organization location + * + * @return self + */ + public function setAddressSubpremise($address_subpremise): self + { + $this->container['address_subpremise'] = $address_subpremise; + + return $this; + } + + /** + * Gets address_street_number + * + * @return string|null + */ + public function getAddressStreetNumber() + { + return $this->container['address_street_number']; + } + + /** + * Sets address_street_number + * + * @param string|null $address_street_number The street number of the organization location + * + * @return self + */ + public function setAddressStreetNumber($address_street_number): self + { + $this->container['address_street_number'] = $address_street_number; + + return $this; + } + + /** + * Gets address_route + * + * @return string|null + */ + public function getAddressRoute() + { + return $this->container['address_route']; + } + + /** + * Sets address_route + * + * @param string|null $address_route The route of the organization location + * + * @return self + */ + public function setAddressRoute($address_route): self + { + $this->container['address_route'] = $address_route; + + return $this; + } + + /** + * Gets address_sublocality + * + * @return string|null + */ + public function getAddressSublocality() + { + return $this->container['address_sublocality']; + } + + /** + * Sets address_sublocality + * + * @param string|null $address_sublocality The sub-locality of the organization location + * + * @return self + */ + public function setAddressSublocality($address_sublocality): self + { + $this->container['address_sublocality'] = $address_sublocality; + + return $this; + } + + /** + * Gets address_locality + * + * @return string|null + */ + public function getAddressLocality() + { + return $this->container['address_locality']; + } + + /** + * Sets address_locality + * + * @param string|null $address_locality The locality of the organization location + * + * @return self + */ + public function setAddressLocality($address_locality): self + { + $this->container['address_locality'] = $address_locality; + + return $this; + } + + /** + * Gets address_admin_area_level_1 + * + * @return string|null + */ + public function getAddressAdminAreaLevel1() + { + return $this->container['address_admin_area_level_1']; + } + + /** + * Sets address_admin_area_level_1 + * + * @param string|null $address_admin_area_level_1 The level 1 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel1($address_admin_area_level_1): self + { + $this->container['address_admin_area_level_1'] = $address_admin_area_level_1; + + return $this; + } + + /** + * Gets address_admin_area_level_2 + * + * @return string|null + */ + public function getAddressAdminAreaLevel2() + { + return $this->container['address_admin_area_level_2']; + } + + /** + * Sets address_admin_area_level_2 + * + * @param string|null $address_admin_area_level_2 The level 2 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel2($address_admin_area_level_2): self + { + $this->container['address_admin_area_level_2'] = $address_admin_area_level_2; + + return $this; + } + + /** + * Gets address_country + * + * @return string|null + */ + public function getAddressCountry() + { + return $this->container['address_country']; + } + + /** + * Sets address_country + * + * @param string|null $address_country The country of the organization location + * + * @return self + */ + public function setAddressCountry($address_country): self + { + $this->container['address_country'] = $address_country; + + return $this; + } + + /** + * Gets address_postal_code + * + * @return string|null + */ + public function getAddressPostalCode() + { + return $this->container['address_postal_code']; + } + + /** + * Sets address_postal_code + * + * @param string|null $address_postal_code The postal code of the organization location + * + * @return self + */ + public function setAddressPostalCode($address_postal_code): self + { + $this->container['address_postal_code'] = $address_postal_code; + + return $this; + } + + /** + * Gets address_formatted_address + * + * @return string|null + */ + public function getAddressFormattedAddress() + { + return $this->container['address_formatted_address']; + } + + /** + * Sets address_formatted_address + * + * @param string|null $address_formatted_address The formatted organization location + * + * @return self + */ + public function setAddressFormattedAddress($address_formatted_address): self + { + $this->container['address_formatted_address'] = $address_formatted_address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationCountInfo.php b/lib/Model/OrganizationCountInfo.php new file mode 100644 index 00000000..e2b7954d --- /dev/null +++ b/lib/Model/OrganizationCountInfo.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationCountInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationCountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email_messages_count' => 'int', + 'people_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email_messages_count' => null, + 'people_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_messages_count' => 'email_messages_count', + 'people_count' => 'people_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_messages_count' => 'setEmailMessagesCount', + 'people_count' => 'setPeopleCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_messages_count' => 'getEmailMessagesCount', + 'people_count' => 'getPeopleCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the organization + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The count of persons related to the organization + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the organization + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the organization + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the organization + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the organization + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the organization + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the organization + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationData.php b/lib/Model/OrganizationData.php new file mode 100644 index 00000000..71f76cc4 --- /dev/null +++ b/lib/Model/OrganizationData.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the item + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the item + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDataWithId.php b/lib/Model/OrganizationDataWithId.php new file mode 100644 index 00000000..347afb87 --- /dev/null +++ b/lib/Model/OrganizationDataWithId.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDataWithId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDataWithId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the item + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the item + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDataWithIdAllOf.php b/lib/Model/OrganizationDataWithIdAllOf.php new file mode 100644 index 00000000..14430238 --- /dev/null +++ b/lib/Model/OrganizationDataWithIdAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDataWithIdAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDataWithId_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDataWithIdAndActiveFlag.php b/lib/Model/OrganizationDataWithIdAndActiveFlag.php new file mode 100644 index 00000000..f562c868 --- /dev/null +++ b/lib/Model/OrganizationDataWithIdAndActiveFlag.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDataWithIdAndActiveFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDataWithIdAndActiveFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool', + 'id' => 'int', + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'cc_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null, + 'id' => null, + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'cc_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag', + 'id' => 'id', + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'cc_email' => 'cc_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag', + 'id' => 'setId', + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'cc_email' => 'setCcEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag', + 'id' => 'getId', + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'cc_email' => 'getCcEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the item + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the item + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDataWithIdAndActiveFlagAllOf.php b/lib/Model/OrganizationDataWithIdAndActiveFlagAllOf.php new file mode 100644 index 00000000..0aafc0be --- /dev/null +++ b/lib/Model/OrganizationDataWithIdAndActiveFlagAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDataWithIdAndActiveFlagAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDataWithIdAndActiveFlag_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDeleteResponse.php b/lib/Model/OrganizationDeleteResponse.php new file mode 100644 index 00000000..664c3bb0 --- /dev/null +++ b/lib/Model/OrganizationDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationDeleteResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationDeleteResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationDeleteResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDeleteResponseData.php b/lib/Model/OrganizationDeleteResponseData.php new file mode 100644 index 00000000..7949de3d --- /dev/null +++ b/lib/Model/OrganizationDeleteResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDeleteResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDeleteResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization that was deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDetailsGetResponse.php b/lib/Model/OrganizationDetailsGetResponse.php new file mode 100644 index 00000000..1b337b81 --- /dev/null +++ b/lib/Model/OrganizationDetailsGetResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDetailsGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDetailsGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationItem', + 'additional_data' => '\Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDetailsGetResponseAllOf.php b/lib/Model/OrganizationDetailsGetResponseAllOf.php new file mode 100644 index 00000000..1e67e250 --- /dev/null +++ b/lib/Model/OrganizationDetailsGetResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDetailsGetResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDetailsGetResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\OrganizationItem', + 'additional_data' => '\Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\OrganizationDetailsGetResponseAllOfAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationDetailsGetResponseAllOfAdditionalData.php b/lib/Model/OrganizationDetailsGetResponseAllOfAdditionalData.php new file mode 100644 index 00000000..c7a3cf0c --- /dev/null +++ b/lib/Model/OrganizationDetailsGetResponseAllOfAdditionalData.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationDetailsGetResponseAllOfAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationDetailsGetResponse_allOf_additional_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'followers' => '\Pipedrive\Model\RelatedFollowerData', + 'dropbox_email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'followers' => null, + 'dropbox_email' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'followers' => 'followers', + 'dropbox_email' => 'dropbox_email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'followers' => 'setFollowers', + 'dropbox_email' => 'setDropboxEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'followers' => 'getFollowers', + 'dropbox_email' => 'getDropboxEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['followers'] = $data['followers'] ?? null; + $this->container['dropbox_email'] = $data['dropbox_email'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets followers + * + * @return \Pipedrive\Model\RelatedFollowerData|null + */ + public function getFollowers() + { + return $this->container['followers']; + } + + /** + * Sets followers + * + * @param \Pipedrive\Model\RelatedFollowerData|null $followers followers + * + * @return self + */ + public function setFollowers($followers): self + { + $this->container['followers'] = $followers; + + return $this; + } + + /** + * Gets dropbox_email + * + * @return string|null + */ + public function getDropboxEmail() + { + return $this->container['dropbox_email']; + } + + /** + * Sets dropbox_email + * + * @param string|null $dropbox_email Dropbox email for the organization + * + * @return self + */ + public function setDropboxEmail($dropbox_email): self + { + $this->container['dropbox_email'] = $dropbox_email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFlowResponse.php b/lib/Model/OrganizationFlowResponse.php new file mode 100644 index 00000000..d9ba7120 --- /dev/null +++ b/lib/Model/OrganizationFlowResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFlowResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFlowResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationFlowResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationFlowResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationFlowResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFlowResponseAllOf.php b/lib/Model/OrganizationFlowResponseAllOf.php new file mode 100644 index 00000000..24757bee --- /dev/null +++ b/lib/Model/OrganizationFlowResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFlowResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFlowResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\OrganizationFlowResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationFlowResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationFlowResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\OrganizationFlowResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFlowResponseAllOfData.php b/lib/Model/OrganizationFlowResponseAllOfData.php new file mode 100644 index 00000000..706f03e2 --- /dev/null +++ b/lib/Model/OrganizationFlowResponseAllOfData.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFlowResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFlowResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'object' => 'string', + 'timestamp' => 'string', + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'timestamp' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'timestamp' => 'timestamp', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'timestamp' => 'setTimestamp', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'timestamp' => 'getTimestamp', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['object'] = $data['object'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object The type of the person update. (Possible object types - organizationChange, dealChange, file, activity) + * + * @return self + */ + public function setObject($object): self + { + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The creation date and time of the update + * + * @return self + */ + public function setTimestamp($timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data The data related to the update + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFlowResponseAllOfRelatedObjects.php b/lib/Model/OrganizationFlowResponseAllOfRelatedObjects.php new file mode 100644 index 00000000..08f2c4a3 --- /dev/null +++ b/lib/Model/OrganizationFlowResponseAllOfRelatedObjects.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFlowResponseAllOfRelatedObjects implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFlowResponse_allOf_related_objects'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization' => '\Pipedrive\Model\RelatedOrganizationData', + 'user' => '\Pipedrive\Model\RelatedUserData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization' => null, + 'user' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization' => 'organization', + 'user' => 'user' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization' => 'setOrganization', + 'user' => 'setUser' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization' => 'getOrganization', + 'user' => 'getUser' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization'] = $data['organization'] ?? null; + $this->container['user'] = $data['user'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization + * + * @return \Pipedrive\Model\RelatedOrganizationData|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\RelatedOrganizationData|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets user + * + * @return \Pipedrive\Model\RelatedUserData|null + */ + public function getUser() + { + return $this->container['user']; + } + + /** + * Sets user + * + * @param \Pipedrive\Model\RelatedUserData|null $user user + * + * @return self + */ + public function setUser($user): self + { + $this->container['user'] = $user; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFollowerDeleteResponse.php b/lib/Model/OrganizationFollowerDeleteResponse.php new file mode 100644 index 00000000..24a55e77 --- /dev/null +++ b/lib/Model/OrganizationFollowerDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFollowerDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFollowerDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationFollowerDeleteResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationFollowerDeleteResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationFollowerDeleteResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFollowerDeleteResponseData.php b/lib/Model/OrganizationFollowerDeleteResponseData.php new file mode 100644 index 00000000..34fd458b --- /dev/null +++ b/lib/Model/OrganizationFollowerDeleteResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFollowerDeleteResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFollowerDeleteResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower that was deleted from the organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFollowerItem.php b/lib/Model/OrganizationFollowerItem.php new file mode 100644 index 00000000..123d326d --- /dev/null +++ b/lib/Model/OrganizationFollowerItem.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFollowerItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFollowerItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'org_id' => 'int', + 'user_id' => 'int', + 'id' => 'int', + 'add_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'org_id' => null, + 'user_id' => null, + 'id' => null, + 'add_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'org_id' => 'org_id', + 'user_id' => 'user_id', + 'id' => 'id', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'org_id' => 'setOrgId', + 'user_id' => 'setUserId', + 'id' => 'setId', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'org_id' => 'getOrgId', + 'user_id' => 'getUserId', + 'id' => 'getId', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID of the follower related to the item + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the follower + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets add_time + * + * @return \DateTime|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param \DateTime|null $add_time The date and time of adding the follower to the item + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFollowerItemAllOf.php b/lib/Model/OrganizationFollowerItemAllOf.php new file mode 100644 index 00000000..c18e212a --- /dev/null +++ b/lib/Model/OrganizationFollowerItemAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFollowerItemAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFollowerItem_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'org_id' => 'org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'org_id' => 'setOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'org_id' => 'getOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['org_id'] = $data['org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFollowerPostResponse.php b/lib/Model/OrganizationFollowerPostResponse.php new file mode 100644 index 00000000..2009d1ca --- /dev/null +++ b/lib/Model/OrganizationFollowerPostResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFollowerPostResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFollowerPostResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationFollowerItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationFollowerItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationFollowerItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationFollowersListResponse.php b/lib/Model/OrganizationFollowersListResponse.php new file mode 100644 index 00000000..5d21d2e3 --- /dev/null +++ b/lib/Model/OrganizationFollowersListResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationFollowersListResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationFollowersListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationFollowerItem[]', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationFollowerItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationFollowerItem[]|null $data The array of followers + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationItem.php b/lib/Model/OrganizationItem.php new file mode 100644 index 00000000..245291b5 --- /dev/null +++ b/lib/Model/OrganizationItem.php @@ -0,0 +1,1782 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'owner_id' => '\Pipedrive\Model\Owner', + 'name' => 'string', + 'active_flag' => 'bool', + 'picture_id' => '\Pipedrive\Model\PictureDataWithValue', + 'country_code' => 'string', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'label' => 'int', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'email_messages_count' => 'int', + 'people_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'address' => 'string', + 'address_subpremise' => 'string', + 'address_street_number' => 'string', + 'address_route' => 'string', + 'address_sublocality' => 'string', + 'address_locality' => 'string', + 'address_admin_area_level_1' => 'string', + 'address_admin_area_level_2' => 'string', + 'address_country' => 'string', + 'address_postal_code' => 'string', + 'address_formatted_address' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'edit_name' => 'bool', + 'last_activity' => 'object', + 'next_activity' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'owner_id' => null, + 'name' => null, + 'active_flag' => null, + 'picture_id' => null, + 'country_code' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'label' => null, + 'owner_name' => null, + 'cc_email' => null, + 'email_messages_count' => null, + 'people_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'address' => null, + 'address_subpremise' => null, + 'address_street_number' => null, + 'address_route' => null, + 'address_sublocality' => null, + 'address_locality' => null, + 'address_admin_area_level_1' => null, + 'address_admin_area_level_2' => null, + 'address_country' => null, + 'address_postal_code' => null, + 'address_formatted_address' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'edit_name' => null, + 'last_activity' => null, + 'next_activity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'owner_id' => 'owner_id', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'picture_id' => 'picture_id', + 'country_code' => 'country_code', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'label' => 'label', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'email_messages_count' => 'email_messages_count', + 'people_count' => 'people_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'address' => 'address', + 'address_subpremise' => 'address_subpremise', + 'address_street_number' => 'address_street_number', + 'address_route' => 'address_route', + 'address_sublocality' => 'address_sublocality', + 'address_locality' => 'address_locality', + 'address_admin_area_level_1' => 'address_admin_area_level_1', + 'address_admin_area_level_2' => 'address_admin_area_level_2', + 'address_country' => 'address_country', + 'address_postal_code' => 'address_postal_code', + 'address_formatted_address' => 'address_formatted_address', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'edit_name' => 'edit_name', + 'last_activity' => 'last_activity', + 'next_activity' => 'next_activity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'owner_id' => 'setOwnerId', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'picture_id' => 'setPictureId', + 'country_code' => 'setCountryCode', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'label' => 'setLabel', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'email_messages_count' => 'setEmailMessagesCount', + 'people_count' => 'setPeopleCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'address' => 'setAddress', + 'address_subpremise' => 'setAddressSubpremise', + 'address_street_number' => 'setAddressStreetNumber', + 'address_route' => 'setAddressRoute', + 'address_sublocality' => 'setAddressSublocality', + 'address_locality' => 'setAddressLocality', + 'address_admin_area_level_1' => 'setAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'setAddressAdminAreaLevel2', + 'address_country' => 'setAddressCountry', + 'address_postal_code' => 'setAddressPostalCode', + 'address_formatted_address' => 'setAddressFormattedAddress', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'edit_name' => 'setEditName', + 'last_activity' => 'setLastActivity', + 'next_activity' => 'setNextActivity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'owner_id' => 'getOwnerId', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'picture_id' => 'getPictureId', + 'country_code' => 'getCountryCode', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'label' => 'getLabel', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'email_messages_count' => 'getEmailMessagesCount', + 'people_count' => 'getPeopleCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'address' => 'getAddress', + 'address_subpremise' => 'getAddressSubpremise', + 'address_street_number' => 'getAddressStreetNumber', + 'address_route' => 'getAddressRoute', + 'address_sublocality' => 'getAddressSublocality', + 'address_locality' => 'getAddressLocality', + 'address_admin_area_level_1' => 'getAddressAdminAreaLevel1', + 'address_admin_area_level_2' => 'getAddressAdminAreaLevel2', + 'address_country' => 'getAddressCountry', + 'address_postal_code' => 'getAddressPostalCode', + 'address_formatted_address' => 'getAddressFormattedAddress', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'edit_name' => 'getEditName', + 'last_activity' => 'getLastActivity', + 'next_activity' => 'getNextActivity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['address_subpremise'] = $data['address_subpremise'] ?? null; + $this->container['address_street_number'] = $data['address_street_number'] ?? null; + $this->container['address_route'] = $data['address_route'] ?? null; + $this->container['address_sublocality'] = $data['address_sublocality'] ?? null; + $this->container['address_locality'] = $data['address_locality'] ?? null; + $this->container['address_admin_area_level_1'] = $data['address_admin_area_level_1'] ?? null; + $this->container['address_admin_area_level_2'] = $data['address_admin_area_level_2'] ?? null; + $this->container['address_country'] = $data['address_country'] ?? null; + $this->container['address_postal_code'] = $data['address_postal_code'] ?? null; + $this->container['address_formatted_address'] = $data['address_formatted_address'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['edit_name'] = $data['edit_name'] ?? null; + $this->container['last_activity'] = $data['last_activity'] ?? null; + $this->container['next_activity'] = $data['next_activity'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the organization + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithValue|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithValue|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The country code of the organization + * + * @return self + */ + public function setCountryCode($country_code): self + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first character of the organization name + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the organization + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the organization + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The ID of the label + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the organization owner + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the organization + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The count of persons related to the organization + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the organization + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the organization + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the organization + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the organization + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the organization + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the organization + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The full address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets address_subpremise + * + * @return string|null + */ + public function getAddressSubpremise() + { + return $this->container['address_subpremise']; + } + + /** + * Sets address_subpremise + * + * @param string|null $address_subpremise The sub-premise of the organization location + * + * @return self + */ + public function setAddressSubpremise($address_subpremise): self + { + $this->container['address_subpremise'] = $address_subpremise; + + return $this; + } + + /** + * Gets address_street_number + * + * @return string|null + */ + public function getAddressStreetNumber() + { + return $this->container['address_street_number']; + } + + /** + * Sets address_street_number + * + * @param string|null $address_street_number The street number of the organization location + * + * @return self + */ + public function setAddressStreetNumber($address_street_number): self + { + $this->container['address_street_number'] = $address_street_number; + + return $this; + } + + /** + * Gets address_route + * + * @return string|null + */ + public function getAddressRoute() + { + return $this->container['address_route']; + } + + /** + * Sets address_route + * + * @param string|null $address_route The route of the organization location + * + * @return self + */ + public function setAddressRoute($address_route): self + { + $this->container['address_route'] = $address_route; + + return $this; + } + + /** + * Gets address_sublocality + * + * @return string|null + */ + public function getAddressSublocality() + { + return $this->container['address_sublocality']; + } + + /** + * Sets address_sublocality + * + * @param string|null $address_sublocality The sub-locality of the organization location + * + * @return self + */ + public function setAddressSublocality($address_sublocality): self + { + $this->container['address_sublocality'] = $address_sublocality; + + return $this; + } + + /** + * Gets address_locality + * + * @return string|null + */ + public function getAddressLocality() + { + return $this->container['address_locality']; + } + + /** + * Sets address_locality + * + * @param string|null $address_locality The locality of the organization location + * + * @return self + */ + public function setAddressLocality($address_locality): self + { + $this->container['address_locality'] = $address_locality; + + return $this; + } + + /** + * Gets address_admin_area_level_1 + * + * @return string|null + */ + public function getAddressAdminAreaLevel1() + { + return $this->container['address_admin_area_level_1']; + } + + /** + * Sets address_admin_area_level_1 + * + * @param string|null $address_admin_area_level_1 The level 1 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel1($address_admin_area_level_1): self + { + $this->container['address_admin_area_level_1'] = $address_admin_area_level_1; + + return $this; + } + + /** + * Gets address_admin_area_level_2 + * + * @return string|null + */ + public function getAddressAdminAreaLevel2() + { + return $this->container['address_admin_area_level_2']; + } + + /** + * Sets address_admin_area_level_2 + * + * @param string|null $address_admin_area_level_2 The level 2 admin area of the organization location + * + * @return self + */ + public function setAddressAdminAreaLevel2($address_admin_area_level_2): self + { + $this->container['address_admin_area_level_2'] = $address_admin_area_level_2; + + return $this; + } + + /** + * Gets address_country + * + * @return string|null + */ + public function getAddressCountry() + { + return $this->container['address_country']; + } + + /** + * Sets address_country + * + * @param string|null $address_country The country of the organization location + * + * @return self + */ + public function setAddressCountry($address_country): self + { + $this->container['address_country'] = $address_country; + + return $this; + } + + /** + * Gets address_postal_code + * + * @return string|null + */ + public function getAddressPostalCode() + { + return $this->container['address_postal_code']; + } + + /** + * Sets address_postal_code + * + * @param string|null $address_postal_code The postal code of the organization location + * + * @return self + */ + public function setAddressPostalCode($address_postal_code): self + { + $this->container['address_postal_code'] = $address_postal_code; + + return $this; + } + + /** + * Gets address_formatted_address + * + * @return string|null + */ + public function getAddressFormattedAddress() + { + return $this->container['address_formatted_address']; + } + + /** + * Sets address_formatted_address + * + * @param string|null $address_formatted_address The formatted organization location + * + * @return self + */ + public function setAddressFormattedAddress($address_formatted_address): self + { + $this->container['address_formatted_address'] = $address_formatted_address; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets edit_name + * + * @return bool|null + */ + public function getEditName() + { + return $this->container['edit_name']; + } + + /** + * Sets edit_name + * + * @param bool|null $edit_name If the company ID of the organization and company ID of the request is same or not + * + * @return self + */ + public function setEditName($edit_name): self + { + $this->container['edit_name'] = $edit_name; + + return $this; + } + + /** + * Gets last_activity + * + * @return object|null + */ + public function getLastActivity() + { + return $this->container['last_activity']; + } + + /** + * Sets last_activity + * + * @param object|null $last_activity Please refer to response schema of Activity + * + * @return self + */ + public function setLastActivity($last_activity): self + { + $this->container['last_activity'] = $last_activity; + + return $this; + } + + /** + * Gets next_activity + * + * @return object|null + */ + public function getNextActivity() + { + return $this->container['next_activity']; + } + + /** + * Sets next_activity + * + * @param object|null $next_activity Please refer to response schema of Activity + * + * @return self + */ + public function setNextActivity($next_activity): self + { + $this->container['next_activity'] = $next_activity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationItemAllOf.php b/lib/Model/OrganizationItemAllOf.php new file mode 100644 index 00000000..e2395908 --- /dev/null +++ b/lib/Model/OrganizationItemAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationItemAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationItem_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'last_activity' => 'object', + 'next_activity' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'last_activity' => null, + 'next_activity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'last_activity' => 'last_activity', + 'next_activity' => 'next_activity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'last_activity' => 'setLastActivity', + 'next_activity' => 'setNextActivity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'last_activity' => 'getLastActivity', + 'next_activity' => 'getNextActivity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['last_activity'] = $data['last_activity'] ?? null; + $this->container['next_activity'] = $data['next_activity'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets last_activity + * + * @return object|null + */ + public function getLastActivity() + { + return $this->container['last_activity']; + } + + /** + * Sets last_activity + * + * @param object|null $last_activity Please refer to response schema of Activity + * + * @return self + */ + public function setLastActivity($last_activity): self + { + $this->container['last_activity'] = $last_activity; + + return $this; + } + + /** + * Gets next_activity + * + * @return object|null + */ + public function getNextActivity() + { + return $this->container['next_activity']; + } + + /** + * Sets next_activity + * + * @param object|null $next_activity Please refer to response schema of Activity + * + * @return self + */ + public function setNextActivity($next_activity): self + { + $this->container['next_activity'] = $next_activity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationPostResponse.php b/lib/Model/OrganizationPostResponse.php new file mode 100644 index 00000000..2ffd5f7a --- /dev/null +++ b/lib/Model/OrganizationPostResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationPostResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationPostResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseOrganizationItemWithEditNameFlag', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItemWithEditNameFlag|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItemWithEditNameFlag|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationPostResponseAllOf.php b/lib/Model/OrganizationPostResponseAllOf.php new file mode 100644 index 00000000..de08387b --- /dev/null +++ b/lib/Model/OrganizationPostResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationPostResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationPostResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseOrganizationItemWithEditNameFlag', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItemWithEditNameFlag|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItemWithEditNameFlag|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationship.php b/lib/Model/OrganizationRelationship.php new file mode 100644 index 00000000..a9f23521 --- /dev/null +++ b/lib/Model/OrganizationRelationship.php @@ -0,0 +1,468 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationship implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationship'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'org_id' => 'int', + 'type' => 'string', + 'rel_owner_org_id' => 'int', + 'rel_linked_org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'org_id' => null, + 'type' => null, + 'rel_owner_org_id' => null, + 'rel_linked_org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'org_id' => 'org_id', + 'type' => 'type', + 'rel_owner_org_id' => 'rel_owner_org_id', + 'rel_linked_org_id' => 'rel_linked_org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'org_id' => 'setOrgId', + 'type' => 'setType', + 'rel_owner_org_id' => 'setRelOwnerOrgId', + 'rel_linked_org_id' => 'setRelLinkedOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'org_id' => 'getOrgId', + 'type' => 'getType', + 'rel_owner_org_id' => 'getRelOwnerOrgId', + 'rel_linked_org_id' => 'getRelLinkedOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const TYPE_PARENT = 'parent'; + const TYPE_RELATED = 'related'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getTypeAllowableValues(): array + { + return [ + self::TYPE_PARENT, + self::TYPE_RELATED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['rel_owner_org_id'] = $data['rel_owner_org_id'] ?? null; + $this->container['rel_linked_org_id'] = $data['rel_linked_org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the base organization for the returned calculated values + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of organization relationship + * + * @return self + */ + public function setType($type): self + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rel_owner_org_id + * + * @return int|null + */ + public function getRelOwnerOrgId() + { + return $this->container['rel_owner_org_id']; + } + + /** + * Sets rel_owner_org_id + * + * @param int|null $rel_owner_org_id The owner of this relationship. If type is `parent`, then the owner is the parent and the linked organization is the daughter. + * + * @return self + */ + public function setRelOwnerOrgId($rel_owner_org_id): self + { + $this->container['rel_owner_org_id'] = $rel_owner_org_id; + + return $this; + } + + /** + * Gets rel_linked_org_id + * + * @return int|null + */ + public function getRelLinkedOrgId() + { + return $this->container['rel_linked_org_id']; + } + + /** + * Sets rel_linked_org_id + * + * @param int|null $rel_linked_org_id The linked organization in this relationship. If type is `parent`, then the linked organization is the daughter. + * + * @return self + */ + public function setRelLinkedOrgId($rel_linked_org_id): self + { + $this->container['rel_linked_org_id'] = $rel_linked_org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipDeleteResponse.php b/lib/Model/OrganizationRelationshipDeleteResponse.php new file mode 100644 index 00000000..54a578cb --- /dev/null +++ b/lib/Model/OrganizationRelationshipDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipDeleteResponseAllOf.php b/lib/Model/OrganizationRelationshipDeleteResponseAllOf.php new file mode 100644 index 00000000..2b72eeda --- /dev/null +++ b/lib/Model/OrganizationRelationshipDeleteResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipDeleteResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipDeleteResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationRelationshipDeleteResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipDeleteResponseAllOfData.php b/lib/Model/OrganizationRelationshipDeleteResponseAllOfData.php new file mode 100644 index 00000000..e8262a2c --- /dev/null +++ b/lib/Model/OrganizationRelationshipDeleteResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipDeleteResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipDeleteResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deleted organization relationship + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipDetails.php b/lib/Model/OrganizationRelationshipDetails.php new file mode 100644 index 00000000..354aac82 --- /dev/null +++ b/lib/Model/OrganizationRelationshipDetails.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'rel_owner_org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItem', + 'rel_linked_org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItem', + 'add_time' => 'string', + 'update_time' => 'string', + 'active_flag' => 'string', + 'calculated_type' => 'string', + 'calculated_related_org_id' => 'int', + 'related_organization_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'rel_owner_org_id' => null, + 'rel_linked_org_id' => null, + 'add_time' => null, + 'update_time' => null, + 'active_flag' => null, + 'calculated_type' => null, + 'calculated_related_org_id' => null, + 'related_organization_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'rel_owner_org_id' => 'rel_owner_org_id', + 'rel_linked_org_id' => 'rel_linked_org_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'active_flag' => 'active_flag', + 'calculated_type' => 'calculated_type', + 'calculated_related_org_id' => 'calculated_related_org_id', + 'related_organization_name' => 'related_organization_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'rel_owner_org_id' => 'setRelOwnerOrgId', + 'rel_linked_org_id' => 'setRelLinkedOrgId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'active_flag' => 'setActiveFlag', + 'calculated_type' => 'setCalculatedType', + 'calculated_related_org_id' => 'setCalculatedRelatedOrgId', + 'related_organization_name' => 'setRelatedOrganizationName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'rel_owner_org_id' => 'getRelOwnerOrgId', + 'rel_linked_org_id' => 'getRelLinkedOrgId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'active_flag' => 'getActiveFlag', + 'calculated_type' => 'getCalculatedType', + 'calculated_related_org_id' => 'getCalculatedRelatedOrgId', + 'related_organization_name' => 'getRelatedOrganizationName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['rel_owner_org_id'] = $data['rel_owner_org_id'] ?? null; + $this->container['rel_linked_org_id'] = $data['rel_linked_org_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['calculated_type'] = $data['calculated_type'] ?? null; + $this->container['calculated_related_org_id'] = $data['calculated_related_org_id'] ?? null; + $this->container['related_organization_name'] = $data['related_organization_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization relationship + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the relationship + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rel_owner_org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItem|null + */ + public function getRelOwnerOrgId() + { + return $this->container['rel_owner_org_id']; + } + + /** + * Sets rel_owner_org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItem|null $rel_owner_org_id rel_owner_org_id + * + * @return self + */ + public function setRelOwnerOrgId($rel_owner_org_id): self + { + $this->container['rel_owner_org_id'] = $rel_owner_org_id; + + return $this; + } + + /** + * Gets rel_linked_org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItem|null + */ + public function getRelLinkedOrgId() + { + return $this->container['rel_linked_org_id']; + } + + /** + * Sets rel_linked_org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItem|null $rel_linked_org_id rel_linked_org_id + * + * @return self + */ + public function setRelLinkedOrgId($rel_linked_org_id): self + { + $this->container['rel_linked_org_id'] = $rel_linked_org_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the relationship + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the relationship + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets active_flag + * + * @return string|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param string|null $active_flag Whether the relationship is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets calculated_type + * + * @return string|null + */ + public function getCalculatedType() + { + return $this->container['calculated_type']; + } + + /** + * Sets calculated_type + * + * @param string|null $calculated_type The calculated type of the relationship with the linked organization + * + * @return self + */ + public function setCalculatedType($calculated_type): self + { + $this->container['calculated_type'] = $calculated_type; + + return $this; + } + + /** + * Gets calculated_related_org_id + * + * @return int|null + */ + public function getCalculatedRelatedOrgId() + { + return $this->container['calculated_related_org_id']; + } + + /** + * Sets calculated_related_org_id + * + * @param int|null $calculated_related_org_id The ID of the linked organization + * + * @return self + */ + public function setCalculatedRelatedOrgId($calculated_related_org_id): self + { + $this->container['calculated_related_org_id'] = $calculated_related_org_id; + + return $this; + } + + /** + * Gets related_organization_name + * + * @return string|null + */ + public function getRelatedOrganizationName() + { + return $this->container['related_organization_name']; + } + + /** + * Sets related_organization_name + * + * @param string|null $related_organization_name The name of the linked organization + * + * @return self + */ + public function setRelatedOrganizationName($related_organization_name): self + { + $this->container['related_organization_name'] = $related_organization_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipGetResponse.php b/lib/Model/OrganizationRelationshipGetResponse.php new file mode 100644 index 00000000..308be5cd --- /dev/null +++ b/lib/Model/OrganizationRelationshipGetResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationRelationshipWithCalculatedFields', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationRelationshipWithCalculatedFields|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationRelationshipWithCalculatedFields|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipGetResponseAllOf.php b/lib/Model/OrganizationRelationshipGetResponseAllOf.php new file mode 100644 index 00000000..eac91cd0 --- /dev/null +++ b/lib/Model/OrganizationRelationshipGetResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipGetResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipGetResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\OrganizationRelationshipWithCalculatedFields', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationRelationshipWithCalculatedFields|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationRelationshipWithCalculatedFields|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipPostResponse.php b/lib/Model/OrganizationRelationshipPostResponse.php new file mode 100644 index 00000000..382ed6d9 --- /dev/null +++ b/lib/Model/OrganizationRelationshipPostResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipPostResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipPostResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseOrganizationRelationshipItem', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationRelationshipItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationRelationshipItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipPostResponseAllOf.php b/lib/Model/OrganizationRelationshipPostResponseAllOf.php new file mode 100644 index 00000000..0b405270 --- /dev/null +++ b/lib/Model/OrganizationRelationshipPostResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipPostResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipPostResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseOrganizationRelationshipItem', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationRelationshipItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationRelationshipItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipUpdateResponse.php b/lib/Model/OrganizationRelationshipUpdateResponse.php new file mode 100644 index 00000000..6d8e7ef2 --- /dev/null +++ b/lib/Model/OrganizationRelationshipUpdateResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipUpdateResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipUpdateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseOrganizationRelationshipItem', + 'related_objects' => '\Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationRelationshipItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationRelationshipItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationRelationshipsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationRelationshipWithCalculatedFields.php b/lib/Model/OrganizationRelationshipWithCalculatedFields.php new file mode 100644 index 00000000..31a17c5f --- /dev/null +++ b/lib/Model/OrganizationRelationshipWithCalculatedFields.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationRelationshipWithCalculatedFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationRelationshipWithCalculatedFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'rel_owner_org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItem', + 'rel_linked_org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItem', + 'add_time' => 'string', + 'update_time' => 'string', + 'active_flag' => 'string', + 'calculated_type' => 'string', + 'calculated_related_org_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'rel_owner_org_id' => null, + 'rel_linked_org_id' => null, + 'add_time' => null, + 'update_time' => null, + 'active_flag' => null, + 'calculated_type' => null, + 'calculated_related_org_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'rel_owner_org_id' => 'rel_owner_org_id', + 'rel_linked_org_id' => 'rel_linked_org_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'active_flag' => 'active_flag', + 'calculated_type' => 'calculated_type', + 'calculated_related_org_id' => 'calculated_related_org_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'rel_owner_org_id' => 'setRelOwnerOrgId', + 'rel_linked_org_id' => 'setRelLinkedOrgId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'active_flag' => 'setActiveFlag', + 'calculated_type' => 'setCalculatedType', + 'calculated_related_org_id' => 'setCalculatedRelatedOrgId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'rel_owner_org_id' => 'getRelOwnerOrgId', + 'rel_linked_org_id' => 'getRelLinkedOrgId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'active_flag' => 'getActiveFlag', + 'calculated_type' => 'getCalculatedType', + 'calculated_related_org_id' => 'getCalculatedRelatedOrgId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['rel_owner_org_id'] = $data['rel_owner_org_id'] ?? null; + $this->container['rel_linked_org_id'] = $data['rel_linked_org_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['calculated_type'] = $data['calculated_type'] ?? null; + $this->container['calculated_related_org_id'] = $data['calculated_related_org_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization relationship + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the relationship + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rel_owner_org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItem|null + */ + public function getRelOwnerOrgId() + { + return $this->container['rel_owner_org_id']; + } + + /** + * Sets rel_owner_org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItem|null $rel_owner_org_id rel_owner_org_id + * + * @return self + */ + public function setRelOwnerOrgId($rel_owner_org_id): self + { + $this->container['rel_owner_org_id'] = $rel_owner_org_id; + + return $this; + } + + /** + * Gets rel_linked_org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItem|null + */ + public function getRelLinkedOrgId() + { + return $this->container['rel_linked_org_id']; + } + + /** + * Sets rel_linked_org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItem|null $rel_linked_org_id rel_linked_org_id + * + * @return self + */ + public function setRelLinkedOrgId($rel_linked_org_id): self + { + $this->container['rel_linked_org_id'] = $rel_linked_org_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the relationship + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the relationship + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets active_flag + * + * @return string|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param string|null $active_flag Whether the relationship is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets calculated_type + * + * @return string|null + */ + public function getCalculatedType() + { + return $this->container['calculated_type']; + } + + /** + * Sets calculated_type + * + * @param string|null $calculated_type The calculated type of the relationship with the linked organization + * + * @return self + */ + public function setCalculatedType($calculated_type): self + { + $this->container['calculated_type'] = $calculated_type; + + return $this; + } + + /** + * Gets calculated_related_org_id + * + * @return int|null + */ + public function getCalculatedRelatedOrgId() + { + return $this->container['calculated_related_org_id']; + } + + /** + * Sets calculated_related_org_id + * + * @param int|null $calculated_related_org_id The ID of the linked organization + * + * @return self + */ + public function setCalculatedRelatedOrgId($calculated_related_org_id): self + { + $this->container['calculated_related_org_id'] = $calculated_related_org_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationSearchItem.php b/lib/Model/OrganizationSearchItem.php new file mode 100644 index 00000000..189171ce --- /dev/null +++ b/lib/Model/OrganizationSearchItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationSearchItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationSearchItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'result_score' => 'float', + 'item' => '\Pipedrive\Model\OrganizationSearchItemItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result_score' => null, + 'item' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result_score' => 'result_score', + 'item' => 'item' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result_score' => 'setResultScore', + 'item' => 'setItem' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result_score' => 'getResultScore', + 'item' => 'getItem' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result_score'] = $data['result_score'] ?? null; + $this->container['item'] = $data['item'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_score + * + * @return float|null + */ + public function getResultScore() + { + return $this->container['result_score']; + } + + /** + * Sets result_score + * + * @param float|null $result_score Search result relevancy + * + * @return self + */ + public function setResultScore($result_score): self + { + $this->container['result_score'] = $result_score; + + return $this; + } + + /** + * Gets item + * + * @return \Pipedrive\Model\OrganizationSearchItemItem|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \Pipedrive\Model\OrganizationSearchItemItem|null $item item + * + * @return self + */ + public function setItem($item): self + { + $this->container['item'] = $item; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationSearchItemItem.php b/lib/Model/OrganizationSearchItemItem.php new file mode 100644 index 00000000..e0e48e31 --- /dev/null +++ b/lib/Model/OrganizationSearchItemItem.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationSearchItem_item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'name' => 'string', + 'address' => 'string', + 'visible_to' => 'int', + 'owner' => '\Pipedrive\Model\DealSearchItemItemOwner', + 'custom_fields' => 'string[]', + 'notes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'name' => null, + 'address' => null, + 'visible_to' => null, + 'owner' => null, + 'custom_fields' => null, + 'notes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'name' => 'name', + 'address' => 'address', + 'visible_to' => 'visible_to', + 'owner' => 'owner', + 'custom_fields' => 'custom_fields', + 'notes' => 'notes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'name' => 'setName', + 'address' => 'setAddress', + 'visible_to' => 'setVisibleTo', + 'owner' => 'setOwner', + 'custom_fields' => 'setCustomFields', + 'notes' => 'setNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'name' => 'getName', + 'address' => 'getAddress', + 'visible_to' => 'getVisibleTo', + 'owner' => 'getOwner', + 'custom_fields' => 'getCustomFields', + 'notes' => 'getNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner'] = $data['owner'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the item + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the organization + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner + * + * @return \Pipedrive\Model\DealSearchItemItemOwner|null + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * + * @param \Pipedrive\Model\DealSearchItemItemOwner|null $owner owner + * + * @return self + */ + public function setOwner($owner): self + { + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets custom_fields + * + * @return string[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param string[]|null $custom_fields Custom fields + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets notes + * + * @return string[]|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string[]|null $notes An array of notes + * + * @return self + */ + public function setNotes($notes): self + { + $this->container['notes'] = $notes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationSearchResponse.php b/lib/Model/OrganizationSearchResponse.php new file mode 100644 index 00000000..8524f500 --- /dev/null +++ b/lib/Model/OrganizationSearchResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationSearchResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationSearchResponseAllOf.php b/lib/Model/OrganizationSearchResponseAllOf.php new file mode 100644 index 00000000..11780cdd --- /dev/null +++ b/lib/Model/OrganizationSearchResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationSearchResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationSearchResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\OrganizationSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationSearchResponseAllOfData.php b/lib/Model/OrganizationSearchResponseAllOfData.php new file mode 100644 index 00000000..e438fea7 --- /dev/null +++ b/lib/Model/OrganizationSearchResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationSearchResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationSearchResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\OrganizationSearchItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\OrganizationSearchItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\OrganizationSearchItem[]|null $items The array of found items + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationUpdateResponse.php b/lib/Model/OrganizationUpdateResponse.php new file mode 100644 index 00000000..7d658c01 --- /dev/null +++ b/lib/Model/OrganizationUpdateResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationUpdateResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationUpdateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseOrganizationItem', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationUpdateResponseAllOf.php b/lib/Model/OrganizationUpdateResponseAllOf.php new file mode 100644 index 00000000..28883ec1 --- /dev/null +++ b/lib/Model/OrganizationUpdateResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationUpdateResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationUpdateResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseOrganizationItem', + 'related_objects' => '\Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AllOrganizationsGetResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationsDeleteResponse.php b/lib/Model/OrganizationsDeleteResponse.php new file mode 100644 index 00000000..5471aec9 --- /dev/null +++ b/lib/Model/OrganizationsDeleteResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationsDeleteResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationsDeleteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationsDeleteResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationsDeleteResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationsDeleteResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationsDeleteResponseData.php b/lib/Model/OrganizationsDeleteResponseData.php new file mode 100644 index 00000000..b2806bb7 --- /dev/null +++ b/lib/Model/OrganizationsDeleteResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationsDeleteResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationsDeleteResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'float[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 float[]|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param float[]|null $id The IDs of the organizations that were deleted + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationsMergeResponse.php b/lib/Model/OrganizationsMergeResponse.php new file mode 100644 index 00000000..66619edb --- /dev/null +++ b/lib/Model/OrganizationsMergeResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationsMergeResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationsMergeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\OrganizationsMergeResponseData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\OrganizationsMergeResponseData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\OrganizationsMergeResponseData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OrganizationsMergeResponseData.php b/lib/Model/OrganizationsMergeResponseData.php new file mode 100644 index 00000000..9c597e7f --- /dev/null +++ b/lib/Model/OrganizationsMergeResponseData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OrganizationsMergeResponseData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'OrganizationsMergeResponse_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the merged organization + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Owner.php b/lib/Model/Owner.php new file mode 100644 index 00000000..04442755 --- /dev/null +++ b/lib/Model/Owner.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Owner implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Owner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'has_pic' => 'int', + 'pic_hash' => 'string', + 'active_flag' => 'bool', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'has_pic' => null, + 'pic_hash' => null, + 'active_flag' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'has_pic' => 'has_pic', + 'pic_hash' => 'pic_hash', + 'active_flag' => 'active_flag', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'has_pic' => 'setHasPic', + 'pic_hash' => 'setPicHash', + 'active_flag' => 'setActiveFlag', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'has_pic' => 'getHasPic', + 'pic_hash' => 'getPicHash', + 'active_flag' => 'getActiveFlag', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['has_pic'] = $data['has_pic'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the user + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the user + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets has_pic + * + * @return int|null + */ + public function getHasPic() + { + return $this->container['has_pic']; + } + + /** + * Sets has_pic + * + * @param int|null $has_pic Whether the user has picture or not. 0 = No picture, 1 = Has picture. + * + * @return self + */ + public function setHasPic($has_pic): self + { + $this->container['has_pic'] = $has_pic; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The user picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the owner + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/OwnerAllOf.php b/lib/Model/OwnerAllOf.php new file mode 100644 index 00000000..fa95d0ed --- /dev/null +++ b/lib/Model/OwnerAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OwnerAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Owner_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the owner + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PaginationDetails.php b/lib/Model/PaginationDetails.php new file mode 100644 index 00000000..b2851bc7 --- /dev/null +++ b/lib/Model/PaginationDetails.php @@ -0,0 +1,433 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaginationDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaginationDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'start' => 'int', + 'limit' => 'int', + 'more_items_in_collection' => 'bool', + 'next_start' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'start' => null, + 'limit' => null, + 'more_items_in_collection' => null, + 'next_start' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'start' => 'start', + 'limit' => 'limit', + 'more_items_in_collection' => 'more_items_in_collection', + 'next_start' => 'next_start' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'limit' => 'setLimit', + 'more_items_in_collection' => 'setMoreItemsInCollection', + 'next_start' => 'setNextStart' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'limit' => 'getLimit', + 'more_items_in_collection' => 'getMoreItemsInCollection', + 'next_start' => 'getNextStart' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start'] = $data['start'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['more_items_in_collection'] = $data['more_items_in_collection'] ?? null; + $this->container['next_start'] = $data['next_start'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets start + * + * @return int|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param int|null $start Pagination start + * + * @return self + */ + public function setStart($start): self + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit Items shown per page + * + * @return self + */ + public function setLimit($limit): self + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets more_items_in_collection + * + * @return bool|null + */ + public function getMoreItemsInCollection() + { + return $this->container['more_items_in_collection']; + } + + /** + * Sets more_items_in_collection + * + * @param bool|null $more_items_in_collection If there are more list items in the collection than displayed or not + * + * @return self + */ + public function setMoreItemsInCollection($more_items_in_collection): self + { + $this->container['more_items_in_collection'] = $more_items_in_collection; + + return $this; + } + + /** + * Gets next_start + * + * @return int|null + */ + public function getNextStart() + { + return $this->container['next_start']; + } + + /** + * Sets next_start + * + * @param int|null $next_start Next pagination start + * + * @return self + */ + public function setNextStart($next_start): self + { + $this->container['next_start'] = $next_start; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PaginationDetailsAllOf.php b/lib/Model/PaginationDetailsAllOf.php new file mode 100644 index 00000000..33a5aff4 --- /dev/null +++ b/lib/Model/PaginationDetailsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaginationDetailsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaginationDetails_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'next_start' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_start' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_start' => 'next_start' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_start' => 'setNextStart' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_start' => 'getNextStart' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['next_start'] = $data['next_start'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_start + * + * @return int|null + */ + public function getNextStart() + { + return $this->container['next_start']; + } + + /** + * Sets next_start + * + * @param int|null $next_start Next pagination start + * + * @return self + */ + public function setNextStart($next_start): self + { + $this->container['next_start'] = $next_start; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Params.php b/lib/Model/Params.php new file mode 100644 index 00000000..354fb00a --- /dev/null +++ b/lib/Model/Params.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Params implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Params'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pipeline_id' => 'int[]', + 'activity_type_id' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pipeline_id' => null, + 'activity_type_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pipeline_id' => 'pipeline_id', + 'activity_type_id' => 'activity_type_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pipeline_id' => 'setPipelineId', + 'activity_type_id' => 'setActivityTypeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pipeline_id' => 'getPipelineId', + 'activity_type_id' => 'getActivityTypeId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['activity_type_id'] = $data['activity_type_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pipeline_id + * + * @return int[]|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int[]|null $pipeline_id The IDs of pipelines of the goal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets activity_type_id + * + * @return int[]|null + */ + public function getActivityTypeId() + { + return $this->container['activity_type_id']; + } + + /** + * Sets activity_type_id + * + * @param int[]|null $activity_type_id The IDs of activity types of the goal + * + * @return self + */ + public function setActivityTypeId($activity_type_id): self + { + $this->container['activity_type_id'] = $activity_type_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PaymentItem.php b/lib/Model/PaymentItem.php new file mode 100644 index 00000000..b3b5841e --- /dev/null +++ b/lib/Model/PaymentItem.php @@ -0,0 +1,784 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaymentItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaymentItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'subscription_id' => 'int', + 'deal_id' => 'int', + 'is_active' => 'bool', + 'amount' => 'double', + 'currency' => 'string', + 'change_amount' => 'double', + 'due_at' => '\DateTime', + 'revenue_movement_type' => 'string', + 'payment_type' => 'string', + 'description' => 'string', + 'add_time' => 'string', + 'update_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'subscription_id' => null, + 'deal_id' => null, + 'is_active' => null, + 'amount' => 'double', + 'currency' => null, + 'change_amount' => 'double', + 'due_at' => 'date', + 'revenue_movement_type' => null, + 'payment_type' => null, + 'description' => null, + 'add_time' => 'datetime', + 'update_time' => 'datetime' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'subscription_id' => 'subscription_id', + 'deal_id' => 'deal_id', + 'is_active' => 'is_active', + 'amount' => 'amount', + 'currency' => 'currency', + 'change_amount' => 'change_amount', + 'due_at' => 'due_at', + 'revenue_movement_type' => 'revenue_movement_type', + 'payment_type' => 'payment_type', + 'description' => 'description', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'subscription_id' => 'setSubscriptionId', + 'deal_id' => 'setDealId', + 'is_active' => 'setIsActive', + 'amount' => 'setAmount', + 'currency' => 'setCurrency', + 'change_amount' => 'setChangeAmount', + 'due_at' => 'setDueAt', + 'revenue_movement_type' => 'setRevenueMovementType', + 'payment_type' => 'setPaymentType', + 'description' => 'setDescription', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'subscription_id' => 'getSubscriptionId', + 'deal_id' => 'getDealId', + 'is_active' => 'getIsActive', + 'amount' => 'getAmount', + 'currency' => 'getCurrency', + 'change_amount' => 'getChangeAmount', + 'due_at' => 'getDueAt', + 'revenue_movement_type' => 'getRevenueMovementType', + 'payment_type' => 'getPaymentType', + 'description' => 'getDescription', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const REVENUE_MOVEMENT_TYPE__NEW = 'new'; + const REVENUE_MOVEMENT_TYPE_RECURRING = 'recurring'; + const REVENUE_MOVEMENT_TYPE_EXPANSION = 'expansion'; + const REVENUE_MOVEMENT_TYPE_CONTRACTION = 'contraction'; + const REVENUE_MOVEMENT_TYPE_NONE = 'none'; + const REVENUE_MOVEMENT_TYPE_CHURN = 'churn'; + const PAYMENT_TYPE_RECURRING = 'recurring'; + const PAYMENT_TYPE_ADDITIONAL = 'additional'; + const PAYMENT_TYPE_INSTALLMENT = 'installment'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getRevenueMovementTypeAllowableValues(): array + { + return [ + self::REVENUE_MOVEMENT_TYPE__NEW, + self::REVENUE_MOVEMENT_TYPE_RECURRING, + self::REVENUE_MOVEMENT_TYPE_EXPANSION, + self::REVENUE_MOVEMENT_TYPE_CONTRACTION, + self::REVENUE_MOVEMENT_TYPE_NONE, + self::REVENUE_MOVEMENT_TYPE_CHURN, + ]; + } + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getPaymentTypeAllowableValues(): array + { + return [ + self::PAYMENT_TYPE_RECURRING, + self::PAYMENT_TYPE_ADDITIONAL, + self::PAYMENT_TYPE_INSTALLMENT, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['subscription_id'] = $data['subscription_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['is_active'] = $data['is_active'] ?? null; + $this->container['amount'] = $data['amount'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['change_amount'] = $data['change_amount'] ?? null; + $this->container['due_at'] = $data['due_at'] ?? null; + $this->container['revenue_movement_type'] = $data['revenue_movement_type'] ?? null; + $this->container['payment_type'] = $data['payment_type'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getRevenueMovementTypeAllowableValues(); + if (!is_null($this->container['revenue_movement_type']) && !in_array($this->container['revenue_movement_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'revenue_movement_type', must be one of '%s'", + $this->container['revenue_movement_type'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPaymentTypeAllowableValues(); + if (!is_null($this->container['payment_type']) && !in_array($this->container['payment_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'payment_type', must be one of '%s'", + $this->container['payment_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the payment + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets subscription_id + * + * @return int|null + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param int|null $subscription_id The ID of the subscription this payment is associated with + * + * @return self + */ + public function setSubscriptionId($subscription_id): self + { + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this payment is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets is_active + * + * @return bool|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool|null $is_active The payment status + * + * @return self + */ + public function setIsActive($is_active): self + { + $this->container['is_active'] = $is_active; + + return $this; + } + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The payment amount + * + * @return self + */ + public function setAmount($amount): self + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the payment + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets change_amount + * + * @return double|null + */ + public function getChangeAmount() + { + return $this->container['change_amount']; + } + + /** + * Sets change_amount + * + * @param double|null $change_amount The difference between the amount of the current payment and the previous payment. The value can be either positive or negative. + * + * @return self + */ + public function setChangeAmount($change_amount): self + { + $this->container['change_amount'] = $change_amount; + + return $this; + } + + /** + * Gets due_at + * + * @return \DateTime|null + */ + public function getDueAt() + { + return $this->container['due_at']; + } + + /** + * Sets due_at + * + * @param \DateTime|null $due_at The date when payment occurs + * + * @return self + */ + public function setDueAt($due_at): self + { + $this->container['due_at'] = $due_at; + + return $this; + } + + /** + * Gets revenue_movement_type + * + * @return string|null + */ + public function getRevenueMovementType() + { + return $this->container['revenue_movement_type']; + } + + /** + * Sets revenue_movement_type + * + * @param string|null $revenue_movement_type Represents the movement of revenue in comparison with the previous payment. Possible values are: `New` - first payment of the subscription. `Recurring` - no movement. `Expansion` - current payment amount > previous payment amount. `Contraction` - current payment amount < previous payment amount. `Churn` - last payment of the subscription. + * + * @return self + */ + public function setRevenueMovementType($revenue_movement_type): self + { + $allowedValues = $this->getRevenueMovementTypeAllowableValues(); + if (!is_null($revenue_movement_type) && !in_array($revenue_movement_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'revenue_movement_type', must be one of '%s'", + $revenue_movement_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['revenue_movement_type'] = $revenue_movement_type; + + return $this; + } + + /** + * Gets payment_type + * + * @return string|null + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param string|null $payment_type The type of the payment. Possible values are: `Recurring` - payments occur over fixed intervals of time, `Additional` - extra payment not the recurring payment of the recurring subscription, `Installment` - payment of the installment subscription. + * + * @return self + */ + public function setPaymentType($payment_type): self + { + $allowedValues = $this->getPaymentTypeAllowableValues(); + if (!is_null($payment_type) && !in_array($payment_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'payment_type', must be one of '%s'", + $payment_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the payment + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation time of the payment + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the payment + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PaymentsResponse.php b/lib/Model/PaymentsResponse.php new file mode 100644 index 00000000..0d98d57d --- /dev/null +++ b/lib/Model/PaymentsResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaymentsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaymentsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PaymentItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PaymentItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PaymentItem[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PaymentsResponseAllOf.php b/lib/Model/PaymentsResponseAllOf.php new file mode 100644 index 00000000..f3be19e3 --- /dev/null +++ b/lib/Model/PaymentsResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PaymentsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PaymentsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PaymentItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PaymentItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PaymentItem[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PermissionSets.php b/lib/Model/PermissionSets.php new file mode 100644 index 00000000..8b798da4 --- /dev/null +++ b/lib/Model/PermissionSets.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PermissionSets implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PermissionSets'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PermissionSetsItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PermissionSetsItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PermissionSetsItem[]|null $data The array of permission set + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PermissionSetsAllOf.php b/lib/Model/PermissionSetsAllOf.php new file mode 100644 index 00000000..88a59e7c --- /dev/null +++ b/lib/Model/PermissionSetsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PermissionSetsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PermissionSets_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PermissionSetsItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PermissionSetsItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PermissionSetsItem[]|null $data The array of permission set + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PermissionSetsItem.php b/lib/Model/PermissionSetsItem.php new file mode 100644 index 00000000..7947fdd4 --- /dev/null +++ b/lib/Model/PermissionSetsItem.php @@ -0,0 +1,574 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PermissionSetsItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PermissionSetsItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'app' => 'string', + 'type' => 'string', + 'assignment_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'description' => null, + 'app' => null, + 'type' => null, + 'assignment_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description', + 'app' => 'app', + 'type' => 'type', + 'assignment_count' => 'assignment_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription', + 'app' => 'setApp', + 'type' => 'setType', + 'assignment_count' => 'setAssignmentCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription', + 'app' => 'getApp', + 'type' => 'getType', + 'assignment_count' => 'getAssignmentCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const APP_SALES = 'sales'; + const APP_PROJECTS = 'projects'; + const APP_CAMPAIGNS = 'campaigns'; + const APP__GLOBAL = 'global'; + const APP_ACCOUNT_SETTINGS = 'account_settings'; + const TYPE_ADMIN = 'admin'; + const TYPE_MANAGER = 'manager'; + const TYPE_REGULAR = 'regular'; + const TYPE_CUSTOM = 'custom'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getAppAllowableValues(): array + { + return [ + self::APP_SALES, + self::APP_PROJECTS, + self::APP_CAMPAIGNS, + self::APP__GLOBAL, + self::APP_ACCOUNT_SETTINGS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getTypeAllowableValues(): array + { + return [ + self::TYPE_ADMIN, + self::TYPE_MANAGER, + self::TYPE_REGULAR, + self::TYPE_CUSTOM, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['app'] = $data['app'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['assignment_count'] = $data['assignment_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getAppAllowableValues(); + if (!is_null($this->container['app']) && !in_array($this->container['app'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'app', must be one of '%s'", + $this->container['app'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of user permission set + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the permission set + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the permission set + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets app + * + * @return string|null + */ + public function getApp() + { + return $this->container['app']; + } + + /** + * Sets app + * + * @param string|null $app The app that permission set belongs to + * + * @return self + */ + public function setApp($app): self + { + $allowedValues = $this->getAppAllowableValues(); + if (!is_null($app) && !in_array($app, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'app', must be one of '%s'", + $app, + implode("', '", $allowedValues) + ) + ); + } + $this->container['app'] = $app; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of permission set + * + * @return self + */ + public function setType($type): self + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets assignment_count + * + * @return int|null + */ + public function getAssignmentCount() + { + return $this->container['assignment_count']; + } + + /** + * Sets assignment_count + * + * @param int|null $assignment_count The number of users assigned to this permission set + * + * @return self + */ + public function setAssignmentCount($assignment_count): self + { + $this->container['assignment_count'] = $assignment_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonCountAndEmailInfo.php b/lib/Model/PersonCountAndEmailInfo.php new file mode 100644 index 00000000..a4fd5700 --- /dev/null +++ b/lib/Model/PersonCountAndEmailInfo.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonCountAndEmailInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonCountAndEmailInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonCountEmailDealAndActivityInfo.php b/lib/Model/PersonCountEmailDealAndActivityInfo.php new file mode 100644 index 00000000..779ab71d --- /dev/null +++ b/lib/Model/PersonCountEmailDealAndActivityInfo.php @@ -0,0 +1,972 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonCountEmailDealAndActivityInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonCountEmailDealAndActivityInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonCountInfo.php b/lib/Model/PersonCountInfo.php new file mode 100644 index 00000000..65449016 --- /dev/null +++ b/lib/Model/PersonCountInfo.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonCountInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonCountInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonData.php b/lib/Model/PersonData.php new file mode 100644 index 00000000..2f8d6d9e --- /dev/null +++ b/lib/Model/PersonData.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => '\Pipedrive\Model\PersonDataEmail[]', + 'phone' => '\Pipedrive\Model\PersonDataPhone[]', + 'owner_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'phone' => null, + 'owner_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'phone' => 'phone', + 'owner_id' => 'owner_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'owner_id' => 'setOwnerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'owner_id' => 'getOwnerId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\PersonDataEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\PersonDataEmail[]|null $email The emails of the person associated with the item + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\PersonDataPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\PersonDataPhone[]|null $phone The phone numbers of the person associated with the item + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the person that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonDataEmail.php b/lib/Model/PersonDataEmail.php new file mode 100644 index 00000000..7cf7c3a3 --- /dev/null +++ b/lib/Model/PersonDataEmail.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonDataEmail implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonData_email'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'label' => 'string', + 'value' => 'string', + 'primary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'label' => null, + 'value' => null, + 'primary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'value' => 'value', + 'primary' => 'primary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'value' => 'setValue', + 'primary' => 'setPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'value' => 'getValue', + 'primary' => 'getPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['label'] = $data['label'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The type of the email + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The email of the associated person + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Whether this is the primary email or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonDataPhone.php b/lib/Model/PersonDataPhone.php new file mode 100644 index 00000000..08cfc822 --- /dev/null +++ b/lib/Model/PersonDataPhone.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonDataPhone implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonData_phone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'label' => 'string', + 'value' => 'string', + 'primary' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'label' => null, + 'value' => null, + 'primary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'value' => 'value', + 'primary' => 'primary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'value' => 'setValue', + 'primary' => 'setPrimary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'value' => 'getValue', + 'primary' => 'getPrimary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['label'] = $data['label'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The type of the phone number + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The phone number of the person associated with the item + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets primary + * + * @return bool|null + */ + public function getPrimary() + { + return $this->container['primary']; + } + + /** + * Sets primary + * + * @param bool|null $primary Whether this is the primary phone number or not + * + * @return self + */ + public function setPrimary($primary): self + { + $this->container['primary'] = $primary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonDataWithActiveFlag.php b/lib/Model/PersonDataWithActiveFlag.php new file mode 100644 index 00000000..14dc52c9 --- /dev/null +++ b/lib/Model/PersonDataWithActiveFlag.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonDataWithActiveFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonDataWithActiveFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool', + 'id' => 'int', + 'name' => 'string', + 'email' => '\Pipedrive\Model\PersonDataEmail[]', + 'phone' => '\Pipedrive\Model\PersonDataPhone[]', + 'owner_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null, + 'id' => null, + 'name' => null, + 'email' => null, + 'phone' => null, + 'owner_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag', + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'phone' => 'phone', + 'owner_id' => 'owner_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag', + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'owner_id' => 'setOwnerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag', + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'owner_id' => 'getOwnerId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\PersonDataEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\PersonDataEmail[]|null $email The emails of the person associated with the item + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\PersonDataPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\PersonDataPhone[]|null $phone The phone numbers of the person associated with the item + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the person that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonDataWithActiveFlagAllOf.php b/lib/Model/PersonDataWithActiveFlagAllOf.php new file mode 100644 index 00000000..b2eff4b8 --- /dev/null +++ b/lib/Model/PersonDataWithActiveFlagAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonDataWithActiveFlagAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonDataWithActiveFlag_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonFlowResponse.php b/lib/Model/PersonFlowResponse.php new file mode 100644 index 00000000..4a667e69 --- /dev/null +++ b/lib/Model/PersonFlowResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonFlowResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonFlowResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonFlowResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonFlowResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonFlowResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonFlowResponseAllOf.php b/lib/Model/PersonFlowResponseAllOf.php new file mode 100644 index 00000000..4fd51b28 --- /dev/null +++ b/lib/Model/PersonFlowResponseAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonFlowResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonFlowResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PersonFlowResponseAllOfData[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\DealFlowResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonFlowResponseAllOfData[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonFlowResponseAllOfData[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\DealFlowResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonFlowResponseAllOfData.php b/lib/Model/PersonFlowResponseAllOfData.php new file mode 100644 index 00000000..64a2fb41 --- /dev/null +++ b/lib/Model/PersonFlowResponseAllOfData.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonFlowResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonFlowResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'object' => 'string', + 'timestamp' => 'string', + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'object' => null, + 'timestamp' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'object' => 'object', + 'timestamp' => 'timestamp', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'object' => 'setObject', + 'timestamp' => 'setTimestamp', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'object' => 'getObject', + 'timestamp' => 'getTimestamp', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['object'] = $data['object'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets object + * + * @return string|null + */ + public function getObject() + { + return $this->container['object']; + } + + /** + * Sets object + * + * @param string|null $object The type of the person update. (Possible object types - personChange, note, activity, file) + * + * @return self + */ + public function setObject($object): self + { + $this->container['object'] = $object; + + return $this; + } + + /** + * Gets timestamp + * + * @return string|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string|null $timestamp The creation date and time of the update + * + * @return self + */ + public function setTimestamp($timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data The data related to the update + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonItem.php b/lib/Model/PersonItem.php new file mode 100644 index 00000000..0894d366 --- /dev/null +++ b/lib/Model/PersonItem.php @@ -0,0 +1,1542 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'active_flag' => 'bool', + 'phone' => '\Pipedrive\Model\BasePersonItemPhone[]', + 'email' => '\Pipedrive\Model\BasePersonItemEmail[]', + 'first_char' => 'string', + 'add_time' => 'string', + 'update_time' => 'string', + 'visible_to' => 'string', + 'picture_id' => '\Pipedrive\Model\PictureDataWithID', + 'label' => 'int', + 'org_name' => 'string', + 'owner_name' => 'string', + 'cc_email' => 'string', + 'owner_id' => '\Pipedrive\Model\Owner', + 'org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag', + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'open_deals_count' => 'int', + 'related_open_deals_count' => 'int', + 'closed_deals_count' => 'int', + 'related_closed_deals_count' => 'int', + 'won_deals_count' => 'int', + 'related_won_deals_count' => 'int', + 'lost_deals_count' => 'int', + 'related_lost_deals_count' => 'int', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'active_flag' => null, + 'phone' => null, + 'email' => null, + 'first_char' => null, + 'add_time' => null, + 'update_time' => null, + 'visible_to' => null, + 'picture_id' => null, + 'label' => null, + 'org_name' => null, + 'owner_name' => null, + 'cc_email' => null, + 'owner_id' => null, + 'org_id' => null, + 'name' => null, + 'first_name' => null, + 'last_name' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'open_deals_count' => null, + 'related_open_deals_count' => null, + 'closed_deals_count' => null, + 'related_closed_deals_count' => null, + 'won_deals_count' => null, + 'related_won_deals_count' => null, + 'lost_deals_count' => null, + 'related_lost_deals_count' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'active_flag' => 'active_flag', + 'phone' => 'phone', + 'email' => 'email', + 'first_char' => 'first_char', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'visible_to' => 'visible_to', + 'picture_id' => 'picture_id', + 'label' => 'label', + 'org_name' => 'org_name', + 'owner_name' => 'owner_name', + 'cc_email' => 'cc_email', + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'open_deals_count' => 'open_deals_count', + 'related_open_deals_count' => 'related_open_deals_count', + 'closed_deals_count' => 'closed_deals_count', + 'related_closed_deals_count' => 'related_closed_deals_count', + 'won_deals_count' => 'won_deals_count', + 'related_won_deals_count' => 'related_won_deals_count', + 'lost_deals_count' => 'lost_deals_count', + 'related_lost_deals_count' => 'related_lost_deals_count', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'active_flag' => 'setActiveFlag', + 'phone' => 'setPhone', + 'email' => 'setEmail', + 'first_char' => 'setFirstChar', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'visible_to' => 'setVisibleTo', + 'picture_id' => 'setPictureId', + 'label' => 'setLabel', + 'org_name' => 'setOrgName', + 'owner_name' => 'setOwnerName', + 'cc_email' => 'setCcEmail', + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'open_deals_count' => 'setOpenDealsCount', + 'related_open_deals_count' => 'setRelatedOpenDealsCount', + 'closed_deals_count' => 'setClosedDealsCount', + 'related_closed_deals_count' => 'setRelatedClosedDealsCount', + 'won_deals_count' => 'setWonDealsCount', + 'related_won_deals_count' => 'setRelatedWonDealsCount', + 'lost_deals_count' => 'setLostDealsCount', + 'related_lost_deals_count' => 'setRelatedLostDealsCount', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'active_flag' => 'getActiveFlag', + 'phone' => 'getPhone', + 'email' => 'getEmail', + 'first_char' => 'getFirstChar', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'visible_to' => 'getVisibleTo', + 'picture_id' => 'getPictureId', + 'label' => 'getLabel', + 'org_name' => 'getOrgName', + 'owner_name' => 'getOwnerName', + 'cc_email' => 'getCcEmail', + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'open_deals_count' => 'getOpenDealsCount', + 'related_open_deals_count' => 'getRelatedOpenDealsCount', + 'closed_deals_count' => 'getClosedDealsCount', + 'related_closed_deals_count' => 'getRelatedClosedDealsCount', + 'won_deals_count' => 'getWonDealsCount', + 'related_won_deals_count' => 'getRelatedWonDealsCount', + 'lost_deals_count' => 'getLostDealsCount', + 'related_lost_deals_count' => 'getRelatedLostDealsCount', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['picture_id'] = $data['picture_id'] ?? null; + $this->container['label'] = $data['label'] ?? null; + $this->container['org_name'] = $data['org_name'] ?? null; + $this->container['owner_name'] = $data['owner_name'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['open_deals_count'] = $data['open_deals_count'] ?? null; + $this->container['related_open_deals_count'] = $data['related_open_deals_count'] ?? null; + $this->container['closed_deals_count'] = $data['closed_deals_count'] ?? null; + $this->container['related_closed_deals_count'] = $data['related_closed_deals_count'] ?? null; + $this->container['won_deals_count'] = $data['won_deals_count'] ?? null; + $this->container['related_won_deals_count'] = $data['related_won_deals_count'] ?? null; + $this->container['lost_deals_count'] = $data['lost_deals_count'] ?? null; + $this->container['related_lost_deals_count'] = $data['related_lost_deals_count'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company related to the person + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the person is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\BasePersonItemEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\BasePersonItemEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" } ]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first letter of the name of the person + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the person was added/created. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the person. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility group ID of who can see the person + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets picture_id + * + * @return \Pipedrive\Model\PictureDataWithID|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param \Pipedrive\Model\PictureDataWithID|null $picture_id picture_id + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + + /** + * Gets label + * + * @return int|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param int|null $label The label assigned to the person + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets org_name + * + * @return string|null + */ + public function getOrgName() + { + return $this->container['org_name']; + } + + /** + * Sets org_name + * + * @param string|null $org_name The name of the organization associated with the person + * + * @return self + */ + public function setOrgName($org_name): self + { + $this->container['org_name'] = $org_name; + + return $this; + } + + /** + * Gets owner_name + * + * @return string|null + */ + public function getOwnerName() + { + return $this->container['owner_name']; + } + + /** + * Sets owner_name + * + * @param string|null $owner_name The name of the owner associated with the person + * + * @return self + */ + public function setOwnerName($owner_name): self + { + $this->container['owner_name'] = $owner_name; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email associated with the person + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets open_deals_count + * + * @return int|null + */ + public function getOpenDealsCount() + { + return $this->container['open_deals_count']; + } + + /** + * Sets open_deals_count + * + * @param int|null $open_deals_count The count of open deals related with the item + * + * @return self + */ + public function setOpenDealsCount($open_deals_count): self + { + $this->container['open_deals_count'] = $open_deals_count; + + return $this; + } + + /** + * Gets related_open_deals_count + * + * @return int|null + */ + public function getRelatedOpenDealsCount() + { + return $this->container['related_open_deals_count']; + } + + /** + * Sets related_open_deals_count + * + * @param int|null $related_open_deals_count The count of related open deals related with the item + * + * @return self + */ + public function setRelatedOpenDealsCount($related_open_deals_count): self + { + $this->container['related_open_deals_count'] = $related_open_deals_count; + + return $this; + } + + /** + * Gets closed_deals_count + * + * @return int|null + */ + public function getClosedDealsCount() + { + return $this->container['closed_deals_count']; + } + + /** + * Sets closed_deals_count + * + * @param int|null $closed_deals_count The count of closed deals related with the item + * + * @return self + */ + public function setClosedDealsCount($closed_deals_count): self + { + $this->container['closed_deals_count'] = $closed_deals_count; + + return $this; + } + + /** + * Gets related_closed_deals_count + * + * @return int|null + */ + public function getRelatedClosedDealsCount() + { + return $this->container['related_closed_deals_count']; + } + + /** + * Sets related_closed_deals_count + * + * @param int|null $related_closed_deals_count The count of related closed deals related with the item + * + * @return self + */ + public function setRelatedClosedDealsCount($related_closed_deals_count): self + { + $this->container['related_closed_deals_count'] = $related_closed_deals_count; + + return $this; + } + + /** + * Gets won_deals_count + * + * @return int|null + */ + public function getWonDealsCount() + { + return $this->container['won_deals_count']; + } + + /** + * Sets won_deals_count + * + * @param int|null $won_deals_count The count of won deals related with the item + * + * @return self + */ + public function setWonDealsCount($won_deals_count): self + { + $this->container['won_deals_count'] = $won_deals_count; + + return $this; + } + + /** + * Gets related_won_deals_count + * + * @return int|null + */ + public function getRelatedWonDealsCount() + { + return $this->container['related_won_deals_count']; + } + + /** + * Sets related_won_deals_count + * + * @param int|null $related_won_deals_count The count of related won deals related with the item + * + * @return self + */ + public function setRelatedWonDealsCount($related_won_deals_count): self + { + $this->container['related_won_deals_count'] = $related_won_deals_count; + + return $this; + } + + /** + * Gets lost_deals_count + * + * @return int|null + */ + public function getLostDealsCount() + { + return $this->container['lost_deals_count']; + } + + /** + * Sets lost_deals_count + * + * @param int|null $lost_deals_count The count of lost deals related with the item + * + * @return self + */ + public function setLostDealsCount($lost_deals_count): self + { + $this->container['lost_deals_count'] = $lost_deals_count; + + return $this; + } + + /** + * Gets related_lost_deals_count + * + * @return int|null + */ + public function getRelatedLostDealsCount() + { + return $this->container['related_lost_deals_count']; + } + + /** + * Sets related_lost_deals_count + * + * @param int|null $related_lost_deals_count The count of related lost deals related with the item + * + * @return self + */ + public function setRelatedLostDealsCount($related_lost_deals_count): self + { + $this->container['related_lost_deals_count'] = $related_lost_deals_count; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonListProduct.php b/lib/Model/PersonListProduct.php new file mode 100644 index 00000000..fda6ed4d --- /dev/null +++ b/lib/Model/PersonListProduct.php @@ -0,0 +1,822 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonListProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonListProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'name' => 'string', + 'code' => 'string', + 'description' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'category' => 'string', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'first_char' => 'string', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'int', + 'files_count' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'deal_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'name' => null, + 'code' => null, + 'description' => null, + 'unit' => null, + 'tax' => null, + 'category' => null, + 'active_flag' => null, + 'selectable' => null, + 'first_char' => null, + 'visible_to' => null, + 'owner_id' => null, + 'files_count' => null, + 'add_time' => null, + 'update_time' => null, + 'deal_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'name' => 'name', + 'code' => 'code', + 'description' => 'description', + 'unit' => 'unit', + 'tax' => 'tax', + 'category' => 'category', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'first_char' => 'first_char', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'files_count' => 'files_count', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'deal_id' => 'deal_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'name' => 'setName', + 'code' => 'setCode', + 'description' => 'setDescription', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'category' => 'setCategory', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'first_char' => 'setFirstChar', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'files_count' => 'setFilesCount', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'deal_id' => 'setDealId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'name' => 'getName', + 'code' => 'getCode', + 'description' => 'getDescription', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'category' => 'getCategory', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'first_char' => 'getFirstChar', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'files_count' => 'getFilesCount', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'deal_id' => 'getDealId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['category'] = $data['category'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the product + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The category of the product + * + * @return self + */ + public function setCategory($category): self + { + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product will be made active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product can be selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first letter of the product name + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user.
ValueDescription
`1`Owner & followers (private)
`3`Entire company (shared)
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the product was added to the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The date and time when the product was updated to the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonNameCountAndEmailInfo.php b/lib/Model/PersonNameCountAndEmailInfo.php new file mode 100644 index 00000000..6c48e8e2 --- /dev/null +++ b/lib/Model/PersonNameCountAndEmailInfo.php @@ -0,0 +1,672 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonNameCountAndEmailInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonNameCountAndEmailInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'first_name' => null, + 'last_name' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonNameCountAndEmailInfoWithIds.php b/lib/Model/PersonNameCountAndEmailInfoWithIds.php new file mode 100644 index 00000000..536132d2 --- /dev/null +++ b/lib/Model/PersonNameCountAndEmailInfoWithIds.php @@ -0,0 +1,762 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonNameCountAndEmailInfoWithIds implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonNameCountAndEmailInfoWithIds'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => 'int', + 'org_id' => 'int', + 'merge_what_id' => 'int', + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null, + 'merge_what_id' => null, + 'name' => null, + 'first_name' => null, + 'last_name' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'merge_what_id' => 'merge_what_id', + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'merge_what_id' => 'setMergeWhatId', + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'merge_what_id' => 'getMergeWhatId', + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['merge_what_id'] = $data['merge_what_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner related to the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization related to the person + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets merge_what_id + * + * @return int|null + */ + public function getMergeWhatId() + { + return $this->container['merge_what_id']; + } + + /** + * Sets merge_what_id + * + * @param int|null $merge_what_id The ID of the person with what the main person was merged + * + * @return self + */ + public function setMergeWhatId($merge_what_id): self + { + $this->container['merge_what_id'] = $merge_what_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The count of email messages related to the person + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The count of activities related to the person + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The count of done activities related to the person + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The count of undone activities related to the person + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files related to the person + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The count of notes related to the person + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The count of followers related to the person + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the person + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the person + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonNameCountAndEmailInfoWithIdsAllOf.php b/lib/Model/PersonNameCountAndEmailInfoWithIdsAllOf.php new file mode 100644 index 00000000..43350c3c --- /dev/null +++ b/lib/Model/PersonNameCountAndEmailInfoWithIdsAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonNameCountAndEmailInfoWithIdsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonNameCountAndEmailInfoWithIds_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => 'int', + 'org_id' => 'int', + 'merge_what_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null, + 'merge_what_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'merge_what_id' => 'merge_what_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'merge_what_id' => 'setMergeWhatId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'merge_what_id' => 'getMergeWhatId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['merge_what_id'] = $data['merge_what_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner related to the person + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization related to the person + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets merge_what_id + * + * @return int|null + */ + public function getMergeWhatId() + { + return $this->container['merge_what_id']; + } + + /** + * Sets merge_what_id + * + * @param int|null $merge_what_id The ID of the person with what the main person was merged + * + * @return self + */ + public function setMergeWhatId($merge_what_id): self + { + $this->container['merge_what_id'] = $merge_what_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonNameInfo.php b/lib/Model/PersonNameInfo.php new file mode 100644 index 00000000..8a02021a --- /dev/null +++ b/lib/Model/PersonNameInfo.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonNameInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonNameInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'first_name' => null, + 'last_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonNameInfoWithOrgAndOwnerId.php b/lib/Model/PersonNameInfoWithOrgAndOwnerId.php new file mode 100644 index 00000000..31fd2431 --- /dev/null +++ b/lib/Model/PersonNameInfoWithOrgAndOwnerId.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonNameInfoWithOrgAndOwnerId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonNameInfoWithOrgAndOwnerId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'owner_id' => '\Pipedrive\Model\Owner', + 'org_id' => '\Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag', + 'name' => 'string', + 'first_name' => 'string', + 'last_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'owner_id' => null, + 'org_id' => null, + 'name' => null, + 'first_name' => null, + 'last_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'name' => 'name', + 'first_name' => 'first_name', + 'last_name' => 'last_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'name' => 'setName', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'name' => 'getName', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['first_name'] = $data['first_name'] ?? null; + $this->container['last_name'] = $data['last_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets owner_id + * + * @return \Pipedrive\Model\Owner|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param \Pipedrive\Model\Owner|null $owner_id owner_id + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param \Pipedrive\Model\RelationshipOrganizationInfoItemWithActiveFlag|null $org_id org_id + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name The first name of the person + * + * @return self + */ + public function setFirstName($first_name): self + { + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name The last name of the person + * + * @return self + */ + public function setLastName($last_name): self + { + $this->container['last_name'] = $last_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchItem.php b/lib/Model/PersonSearchItem.php new file mode 100644 index 00000000..e83a8cbd --- /dev/null +++ b/lib/Model/PersonSearchItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'result_score' => 'float', + 'item' => '\Pipedrive\Model\PersonSearchItemItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result_score' => null, + 'item' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result_score' => 'result_score', + 'item' => 'item' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result_score' => 'setResultScore', + 'item' => 'setItem' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result_score' => 'getResultScore', + 'item' => 'getItem' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result_score'] = $data['result_score'] ?? null; + $this->container['item'] = $data['item'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_score + * + * @return float|null + */ + public function getResultScore() + { + return $this->container['result_score']; + } + + /** + * Sets result_score + * + * @param float|null $result_score Search result relevancy + * + * @return self + */ + public function setResultScore($result_score): self + { + $this->container['result_score'] = $result_score; + + return $this; + } + + /** + * Gets item + * + * @return \Pipedrive\Model\PersonSearchItemItem|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \Pipedrive\Model\PersonSearchItemItem|null $item item + * + * @return self + */ + public function setItem($item): self + { + $this->container['item'] = $item; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchItemItem.php b/lib/Model/PersonSearchItemItem.php new file mode 100644 index 00000000..24f5ae5d --- /dev/null +++ b/lib/Model/PersonSearchItemItem.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchItem_item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'name' => 'string', + 'phones' => 'string[]', + 'emails' => 'string[]', + 'visible_to' => 'int', + 'owner' => '\Pipedrive\Model\PersonSearchItemItemOwner', + 'organization' => '\Pipedrive\Model\PersonSearchItemItemOrganization', + 'custom_fields' => 'string[]', + 'notes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'name' => null, + 'phones' => null, + 'emails' => null, + 'visible_to' => null, + 'owner' => null, + 'organization' => null, + 'custom_fields' => null, + 'notes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'name' => 'name', + 'phones' => 'phones', + 'emails' => 'emails', + 'visible_to' => 'visible_to', + 'owner' => 'owner', + 'organization' => 'organization', + 'custom_fields' => 'custom_fields', + 'notes' => 'notes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'name' => 'setName', + 'phones' => 'setPhones', + 'emails' => 'setEmails', + 'visible_to' => 'setVisibleTo', + 'owner' => 'setOwner', + 'organization' => 'setOrganization', + 'custom_fields' => 'setCustomFields', + 'notes' => 'setNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'name' => 'getName', + 'phones' => 'getPhones', + 'emails' => 'getEmails', + 'visible_to' => 'getVisibleTo', + 'owner' => 'getOwner', + 'organization' => 'getOrganization', + 'custom_fields' => 'getCustomFields', + 'notes' => 'getNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['phones'] = $data['phones'] ?? null; + $this->container['emails'] = $data['emails'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner'] = $data['owner'] ?? null; + $this->container['organization'] = $data['organization'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; + $this->container['notes'] = $data['notes'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the person + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the item + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phones + * + * @return string[]|null + */ + public function getPhones() + { + return $this->container['phones']; + } + + /** + * Sets phones + * + * @param string[]|null $phones An array of phone numbers + * + * @return self + */ + public function setPhones($phones): self + { + $this->container['phones'] = $phones; + + return $this; + } + + /** + * Gets emails + * + * @return string[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[]|null $emails An array of email addresses + * + * @return self + */ + public function setEmails($emails): self + { + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the person + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner + * + * @return \Pipedrive\Model\PersonSearchItemItemOwner|null + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * + * @param \Pipedrive\Model\PersonSearchItemItemOwner|null $owner owner + * + * @return self + */ + public function setOwner($owner): self + { + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets organization + * + * @return \Pipedrive\Model\PersonSearchItemItemOrganization|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Pipedrive\Model\PersonSearchItemItemOrganization|null $organization organization + * + * @return self + */ + public function setOrganization($organization): self + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets custom_fields + * + * @return string[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param string[]|null $custom_fields Custom fields + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + + /** + * Gets notes + * + * @return string[]|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string[]|null $notes An array of notes + * + * @return self + */ + public function setNotes($notes): self + { + $this->container['notes'] = $notes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchItemItemOrganization.php b/lib/Model/PersonSearchItemItemOrganization.php new file mode 100644 index 00000000..ce88f98c --- /dev/null +++ b/lib/Model/PersonSearchItemItemOrganization.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchItemItemOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchItem_item_organization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the organization the person is associated with + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization the person is associated with + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchItemItemOwner.php b/lib/Model/PersonSearchItemItemOwner.php new file mode 100644 index 00000000..5564e746 --- /dev/null +++ b/lib/Model/PersonSearchItemItemOwner.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchItemItemOwner implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchItem_item_owner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the owner of the person + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchResponse.php b/lib/Model/PersonSearchResponse.php new file mode 100644 index 00000000..3f35fe18 --- /dev/null +++ b/lib/Model/PersonSearchResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchResponseAllOf.php b/lib/Model/PersonSearchResponseAllOf.php new file mode 100644 index 00000000..7e48d17e --- /dev/null +++ b/lib/Model/PersonSearchResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PersonSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PersonSearchResponseAllOfData.php b/lib/Model/PersonSearchResponseAllOfData.php new file mode 100644 index 00000000..6937afb1 --- /dev/null +++ b/lib/Model/PersonSearchResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonSearchResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PersonSearchResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\PersonSearchItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\PersonSearchItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\PersonSearchItem[]|null $items The array of found items + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PictureData.php b/lib/Model/PictureData.php new file mode 100644 index 00000000..91c69e56 --- /dev/null +++ b/lib/Model/PictureData.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PictureData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PictureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item_type' => 'string', + 'item_id' => 'int', + 'active_flag' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string', + 'added_by_user_id' => 'int', + 'pictures' => '\Pipedrive\Model\PictureDataPictures' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item_type' => null, + 'item_id' => null, + 'active_flag' => null, + 'add_time' => null, + 'update_time' => null, + 'added_by_user_id' => null, + 'pictures' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item_type' => 'item_type', + 'item_id' => 'item_id', + 'active_flag' => 'active_flag', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'added_by_user_id' => 'added_by_user_id', + 'pictures' => 'pictures' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item_type' => 'setItemType', + 'item_id' => 'setItemId', + 'active_flag' => 'setActiveFlag', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'added_by_user_id' => 'setAddedByUserId', + 'pictures' => 'setPictures' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item_type' => 'getItemType', + 'item_id' => 'getItemId', + 'active_flag' => 'getActiveFlag', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'added_by_user_id' => 'getAddedByUserId', + 'pictures' => 'getPictures' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item_type'] = $data['item_type'] ?? null; + $this->container['item_id'] = $data['item_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['added_by_user_id'] = $data['added_by_user_id'] ?? null; + $this->container['pictures'] = $data['pictures'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item_type + * + * @return string|null + */ + public function getItemType() + { + return $this->container['item_type']; + } + + /** + * Sets item_type + * + * @param string|null $item_type The type of item the picture is related to + * + * @return self + */ + public function setItemType($item_type): self + { + $this->container['item_type'] = $item_type; + + return $this; + } + + /** + * Gets item_id + * + * @return int|null + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param int|null $item_id The ID of related item + * + * @return self + */ + public function setItemId($item_id): self + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated picture is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The add time of the picture + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the picture + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets added_by_user_id + * + * @return int|null + */ + public function getAddedByUserId() + { + return $this->container['added_by_user_id']; + } + + /** + * Sets added_by_user_id + * + * @param int|null $added_by_user_id The ID of the user who added the picture + * + * @return self + */ + public function setAddedByUserId($added_by_user_id): self + { + $this->container['added_by_user_id'] = $added_by_user_id; + + return $this; + } + + /** + * Gets pictures + * + * @return \Pipedrive\Model\PictureDataPictures|null + */ + public function getPictures() + { + return $this->container['pictures']; + } + + /** + * Sets pictures + * + * @param \Pipedrive\Model\PictureDataPictures|null $pictures pictures + * + * @return self + */ + public function setPictures($pictures): self + { + $this->container['pictures'] = $pictures; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PictureDataPictures.php b/lib/Model/PictureDataPictures.php new file mode 100644 index 00000000..ac7d2de4 --- /dev/null +++ b/lib/Model/PictureDataPictures.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PictureDataPictures implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PictureData_pictures'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + '_128' => 'string', + '_512' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '_128' => null, + '_512' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + '_128' => '128', + '_512' => '512' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '_128' => 'set128', + '_512' => 'set512' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '_128' => 'get128', + '_512' => 'get512' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['_128'] = $data['_128'] ?? null; + $this->container['_512'] = $data['_512'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets _128 + * + * @return string|null + */ + public function get128() + { + return $this->container['_128']; + } + + /** + * Sets _128 + * + * @param string|null $_128 The URL of the 128*128 picture + * + * @return self + */ + public function set128($_128): self + { + $this->container['_128'] = $_128; + + return $this; + } + + /** + * Gets _512 + * + * @return string|null + */ + public function get512() + { + return $this->container['_512']; + } + + /** + * Sets _512 + * + * @param string|null $_512 The URL of the 512*512 picture + * + * @return self + */ + public function set512($_512): self + { + $this->container['_512'] = $_512; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PictureDataWithID.php b/lib/Model/PictureDataWithID.php new file mode 100644 index 00000000..9962e650 --- /dev/null +++ b/lib/Model/PictureDataWithID.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PictureDataWithID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PictureDataWithID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'item_type' => 'string', + 'item_id' => 'int', + 'active_flag' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string', + 'added_by_user_id' => 'int', + 'pictures' => '\Pipedrive\Model\PictureDataPictures' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'item_type' => null, + 'item_id' => null, + 'active_flag' => null, + 'add_time' => null, + 'update_time' => null, + 'added_by_user_id' => null, + 'pictures' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'item_type' => 'item_type', + 'item_id' => 'item_id', + 'active_flag' => 'active_flag', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'added_by_user_id' => 'added_by_user_id', + 'pictures' => 'pictures' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'item_type' => 'setItemType', + 'item_id' => 'setItemId', + 'active_flag' => 'setActiveFlag', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'added_by_user_id' => 'setAddedByUserId', + 'pictures' => 'setPictures' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'item_type' => 'getItemType', + 'item_id' => 'getItemId', + 'active_flag' => 'getActiveFlag', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'added_by_user_id' => 'getAddedByUserId', + 'pictures' => 'getPictures' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['item_type'] = $data['item_type'] ?? null; + $this->container['item_id'] = $data['item_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['added_by_user_id'] = $data['added_by_user_id'] ?? null; + $this->container['pictures'] = $data['pictures'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the picture associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets item_type + * + * @return string|null + */ + public function getItemType() + { + return $this->container['item_type']; + } + + /** + * Sets item_type + * + * @param string|null $item_type The type of item the picture is related to + * + * @return self + */ + public function setItemType($item_type): self + { + $this->container['item_type'] = $item_type; + + return $this; + } + + /** + * Gets item_id + * + * @return int|null + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param int|null $item_id The ID of related item + * + * @return self + */ + public function setItemId($item_id): self + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated picture is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The add time of the picture + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the picture + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets added_by_user_id + * + * @return int|null + */ + public function getAddedByUserId() + { + return $this->container['added_by_user_id']; + } + + /** + * Sets added_by_user_id + * + * @param int|null $added_by_user_id The ID of the user who added the picture + * + * @return self + */ + public function setAddedByUserId($added_by_user_id): self + { + $this->container['added_by_user_id'] = $added_by_user_id; + + return $this; + } + + /** + * Gets pictures + * + * @return \Pipedrive\Model\PictureDataPictures|null + */ + public function getPictures() + { + return $this->container['pictures']; + } + + /** + * Sets pictures + * + * @param \Pipedrive\Model\PictureDataPictures|null $pictures pictures + * + * @return self + */ + public function setPictures($pictures): self + { + $this->container['pictures'] = $pictures; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PictureDataWithIDAllOf.php b/lib/Model/PictureDataWithIDAllOf.php new file mode 100644 index 00000000..231a64db --- /dev/null +++ b/lib/Model/PictureDataWithIDAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PictureDataWithIDAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PictureDataWithID_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the picture associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PictureDataWithValue.php b/lib/Model/PictureDataWithValue.php new file mode 100644 index 00000000..194ca49e --- /dev/null +++ b/lib/Model/PictureDataWithValue.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PictureDataWithValue implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PictureDataWithValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int', + 'item_type' => 'string', + 'item_id' => 'int', + 'active_flag' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string', + 'added_by_user_id' => 'int', + 'pictures' => '\Pipedrive\Model\PictureDataPictures' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'item_type' => null, + 'item_id' => null, + 'active_flag' => null, + 'add_time' => null, + 'update_time' => null, + 'added_by_user_id' => null, + 'pictures' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'item_type' => 'item_type', + 'item_id' => 'item_id', + 'active_flag' => 'active_flag', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'added_by_user_id' => 'added_by_user_id', + 'pictures' => 'pictures' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'item_type' => 'setItemType', + 'item_id' => 'setItemId', + 'active_flag' => 'setActiveFlag', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'added_by_user_id' => 'setAddedByUserId', + 'pictures' => 'setPictures' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'item_type' => 'getItemType', + 'item_id' => 'getItemId', + 'active_flag' => 'getActiveFlag', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'added_by_user_id' => 'getAddedByUserId', + 'pictures' => 'getPictures' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['item_type'] = $data['item_type'] ?? null; + $this->container['item_id'] = $data['item_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['added_by_user_id'] = $data['added_by_user_id'] ?? null; + $this->container['pictures'] = $data['pictures'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the picture associated with the item + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets item_type + * + * @return string|null + */ + public function getItemType() + { + return $this->container['item_type']; + } + + /** + * Sets item_type + * + * @param string|null $item_type The type of item the picture is related to + * + * @return self + */ + public function setItemType($item_type): self + { + $this->container['item_type'] = $item_type; + + return $this; + } + + /** + * Gets item_id + * + * @return int|null + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param int|null $item_id The ID of related item + * + * @return self + */ + public function setItemId($item_id): self + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated picture is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The add time of the picture + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the picture + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets added_by_user_id + * + * @return int|null + */ + public function getAddedByUserId() + { + return $this->container['added_by_user_id']; + } + + /** + * Sets added_by_user_id + * + * @param int|null $added_by_user_id The ID of the user who added the picture + * + * @return self + */ + public function setAddedByUserId($added_by_user_id): self + { + $this->container['added_by_user_id'] = $added_by_user_id; + + return $this; + } + + /** + * Gets pictures + * + * @return \Pipedrive\Model\PictureDataPictures|null + */ + public function getPictures() + { + return $this->container['pictures']; + } + + /** + * Sets pictures + * + * @param \Pipedrive\Model\PictureDataPictures|null $pictures pictures + * + * @return self + */ + public function setPictures($pictures): self + { + $this->container['pictures'] = $pictures; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PictureDataWithValueAllOf.php b/lib/Model/PictureDataWithValueAllOf.php new file mode 100644 index 00000000..586336cf --- /dev/null +++ b/lib/Model/PictureDataWithValueAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PictureDataWithValueAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PictureDataWithValue_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the picture associated with the item + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Pipeline.php b/lib/Model/Pipeline.php new file mode 100644 index 00000000..2f7f74d6 --- /dev/null +++ b/lib/Model/Pipeline.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Pipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Pipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'deal_probability' => '\Pipedrive\Model\NumberBoolean', + 'order_nr' => 'int', + 'active' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'deal_probability' => null, + 'order_nr' => null, + 'active' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'deal_probability' => 'deal_probability', + 'order_nr' => 'order_nr', + 'active' => 'active' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'deal_probability' => 'setDealProbability', + 'order_nr' => 'setOrderNr', + 'active' => 'setActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'deal_probability' => 'getDealProbability', + 'order_nr' => 'getOrderNr', + 'active' => 'getActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['active'] = $data['active'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the pipeline + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets deal_probability + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param \Pipedrive\Model\NumberBoolean|null $deal_probability Whether deal probability is disabled or enabled for this pipeline + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets active + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param \Pipedrive\Model\NumberBoolean|null $active Whether this pipeline will be made inactive (hidden) or active + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PipelineDetails.php b/lib/Model/PipelineDetails.php new file mode 100644 index 00000000..5f8dc49d --- /dev/null +++ b/lib/Model/PipelineDetails.php @@ -0,0 +1,613 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PipelineDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PipelineDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'url_title' => 'string', + 'order_nr' => 'int', + 'active' => 'bool', + 'deal_probability' => 'bool', + 'add_time' => 'string', + 'update_time' => 'string', + 'selected' => 'bool', + 'deals_summary' => '\Pipedrive\Model\DealSummary' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'url_title' => null, + 'order_nr' => null, + 'active' => null, + 'deal_probability' => null, + 'add_time' => null, + 'update_time' => null, + 'selected' => null, + 'deals_summary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'url_title' => 'url_title', + 'order_nr' => 'order_nr', + 'active' => 'active', + 'deal_probability' => 'deal_probability', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'selected' => 'selected', + 'deals_summary' => 'deals_summary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'url_title' => 'setUrlTitle', + 'order_nr' => 'setOrderNr', + 'active' => 'setActive', + 'deal_probability' => 'setDealProbability', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'selected' => 'setSelected', + 'deals_summary' => 'setDealsSummary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'url_title' => 'getUrlTitle', + 'order_nr' => 'getOrderNr', + 'active' => 'getActive', + 'deal_probability' => 'getDealProbability', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'selected' => 'getSelected', + 'deals_summary' => 'getDealsSummary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['url_title'] = $data['url_title'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['selected'] = $data['selected'] ?? null; + $this->container['deals_summary'] = $data['deals_summary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the pipeline + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the pipeline + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url_title + * + * @return string|null + */ + public function getUrlTitle() + { + return $this->container['url_title']; + } + + /** + * Sets url_title + * + * @param string|null $url_title The pipeline title displayed in the URL + * + * @return self + */ + public function setUrlTitle($url_title): self + { + $this->container['url_title'] = $url_title; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of pipelines. First order (`order_nr=0`) is the default pipeline. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether this pipeline will be made inactive (hidden) or active + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deal_probability + * + * @return bool|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param bool|null $deal_probability Whether deal probability is disabled or enabled for this pipeline + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The pipeline creation time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The pipeline update time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets selected + * + * @return bool|null + */ + public function getSelected() + { + return $this->container['selected']; + } + + /** + * Sets selected + * + * @param bool|null $selected A boolean that shows if the pipeline is selected from a filter or not + * + * @return self + */ + public function setSelected($selected): self + { + $this->container['selected'] = $selected; + + return $this; + } + + /** + * Gets deals_summary + * + * @return \Pipedrive\Model\DealSummary|null + */ + public function getDealsSummary() + { + return $this->container['deals_summary']; + } + + /** + * Sets deals_summary + * + * @param \Pipedrive\Model\DealSummary|null $deals_summary deals_summary + * + * @return self + */ + public function setDealsSummary($deals_summary): self + { + $this->container['deals_summary'] = $deals_summary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PipelineDetailsAllOf.php b/lib/Model/PipelineDetailsAllOf.php new file mode 100644 index 00000000..8180dc9f --- /dev/null +++ b/lib/Model/PipelineDetailsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PipelineDetailsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PipelineDetails_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deals_summary' => '\Pipedrive\Model\DealSummary' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deals_summary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deals_summary' => 'deals_summary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deals_summary' => 'setDealsSummary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deals_summary' => 'getDealsSummary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deals_summary'] = $data['deals_summary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deals_summary + * + * @return \Pipedrive\Model\DealSummary|null + */ + public function getDealsSummary() + { + return $this->container['deals_summary']; + } + + /** + * Sets deals_summary + * + * @param \Pipedrive\Model\DealSummary|null $deals_summary deals_summary + * + * @return self + */ + public function setDealsSummary($deals_summary): self + { + $this->container['deals_summary'] = $deals_summary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostComment.php b/lib/Model/PostComment.php new file mode 100644 index 00000000..c48cb744 --- /dev/null +++ b/lib/Model/PostComment.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostComment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostComment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseComment' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseComment|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseComment|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostDealParticipants.php b/lib/Model/PostDealParticipants.php new file mode 100644 index 00000000..97ee3eff --- /dev/null +++ b/lib/Model/PostDealParticipants.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostDealParticipants implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostDealParticipants'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'PersonItem', + 'related_objects' => '\Pipedrive\Model\GetDealsRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return PersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param PersonItem|null $data The object of participant + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetDealsRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetDealsRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostGoalResponse.php b/lib/Model/PostGoalResponse.php new file mode 100644 index 00000000..ce8a4d6b --- /dev/null +++ b/lib/Model/PostGoalResponse.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostGoalResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostGoalResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'goal' => '\Pipedrive\Model\GoalsResponseComponent' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'goal' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'goal' => 'goal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'goal' => 'setGoal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'goal' => 'getGoal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['goal'] = $data['goal'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets goal + * + * @return \Pipedrive\Model\GoalsResponseComponent|null + */ + public function getGoal() + { + return $this->container['goal']; + } + + /** + * Sets goal + * + * @param \Pipedrive\Model\GoalsResponseComponent|null $goal goal + * + * @return self + */ + public function setGoal($goal): self + { + $this->container['goal'] = $goal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostNote.php b/lib/Model/PostNote.php new file mode 100644 index 00000000..d6581cc6 --- /dev/null +++ b/lib/Model/PostNote.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostNote implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostNote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseNote' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseNote|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseNote|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoleAssignment.php b/lib/Model/PostRoleAssignment.php new file mode 100644 index 00000000..0a2cd6ee --- /dev/null +++ b/lib/Model/PostRoleAssignment.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoleAssignment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoleAssignment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PostRoleAssignmentAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PostRoleAssignmentAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostRoleAssignmentAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoleAssignmentAllOf.php b/lib/Model/PostRoleAssignmentAllOf.php new file mode 100644 index 00000000..ed0f5737 --- /dev/null +++ b/lib/Model/PostRoleAssignmentAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoleAssignmentAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoleAssignment_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PostRoleAssignmentAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PostRoleAssignmentAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostRoleAssignmentAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoleAssignmentAllOfData.php b/lib/Model/PostRoleAssignmentAllOfData.php new file mode 100644 index 00000000..4977f77c --- /dev/null +++ b/lib/Model/PostRoleAssignmentAllOfData.php @@ -0,0 +1,373 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoleAssignmentAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoleAssignment_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'role_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'role_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'role_id' => 'role_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'role_id' => 'setRoleId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'role_id' => 'getRoleId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['role_id'] = $data['role_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user that was added to the role + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets role_id + * + * @return int|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param int|null $role_id The ID of the role the user was added to + * + * @return self + */ + public function setRoleId($role_id): self + { + $this->container['role_id'] = $role_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoleSettings.php b/lib/Model/PostRoleSettings.php new file mode 100644 index 00000000..615292b2 --- /dev/null +++ b/lib/Model/PostRoleSettings.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoleSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoleSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PostRoleSettingsAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PostRoleSettingsAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostRoleSettingsAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoleSettingsAllOf.php b/lib/Model/PostRoleSettingsAllOf.php new file mode 100644 index 00000000..29f871c3 --- /dev/null +++ b/lib/Model/PostRoleSettingsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoleSettingsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoleSettings_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PostRoleSettingsAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PostRoleSettingsAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostRoleSettingsAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoleSettingsAllOfData.php b/lib/Model/PostRoleSettingsAllOfData.php new file mode 100644 index 00000000..1acf8770 --- /dev/null +++ b/lib/Model/PostRoleSettingsAllOfData.php @@ -0,0 +1,413 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoleSettingsAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoleSettings_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'deal_default_visibility' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'deal_default_visibility' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'deal_default_visibility' => 'deal_default_visibility' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'deal_default_visibility' => 'setDealDefaultVisibility' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'deal_default_visibility' => 'getDealDefaultVisibility' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const DEAL_DEFAULT_VISIBILITY_1 = 1; + const DEAL_DEFAULT_VISIBILITY_3 = 3; + const DEAL_DEFAULT_VISIBILITY_5 = 5; + const DEAL_DEFAULT_VISIBILITY_7 = 7; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getDealDefaultVisibilityAllowableValues(): array + { + return [ + self::DEAL_DEFAULT_VISIBILITY_1, + self::DEAL_DEFAULT_VISIBILITY_3, + self::DEAL_DEFAULT_VISIBILITY_5, + self::DEAL_DEFAULT_VISIBILITY_7, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['deal_default_visibility'] = $data['deal_default_visibility'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getDealDefaultVisibilityAllowableValues(); + if (!is_null($this->container['deal_default_visibility']) && !in_array($this->container['deal_default_visibility'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'deal_default_visibility', must be one of '%s'", + $this->container['deal_default_visibility'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets deal_default_visibility + * + * @return float|null + */ + public function getDealDefaultVisibility() + { + return $this->container['deal_default_visibility']; + } + + /** + * Sets deal_default_visibility + * + * @param float|null $deal_default_visibility The setting + * + * @return self + */ + public function setDealDefaultVisibility($deal_default_visibility): self + { + $allowedValues = $this->getDealDefaultVisibilityAllowableValues(); + if (!is_null($deal_default_visibility) && !in_array($deal_default_visibility, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'deal_default_visibility', must be one of '%s'", + $deal_default_visibility, + implode("', '", $allowedValues) + ) + ); + } + $this->container['deal_default_visibility'] = $deal_default_visibility; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRoles.php b/lib/Model/PostRoles.php new file mode 100644 index 00000000..feb2de3c --- /dev/null +++ b/lib/Model/PostRoles.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRoles implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoles'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PostRolesAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PostRolesAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostRolesAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRolesAllOf.php b/lib/Model/PostRolesAllOf.php new file mode 100644 index 00000000..291854be --- /dev/null +++ b/lib/Model/PostRolesAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRolesAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoles_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PostRolesAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PostRolesAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PostRolesAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PostRolesAllOfData.php b/lib/Model/PostRolesAllOfData.php new file mode 100644 index 00000000..76d115d2 --- /dev/null +++ b/lib/Model/PostRolesAllOfData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PostRolesAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PostRoles_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the created role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductAttachementFields.php b/lib/Model/ProductAttachementFields.php new file mode 100644 index 00000000..c88ad591 --- /dev/null +++ b/lib/Model/ProductAttachementFields.php @@ -0,0 +1,702 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductAttachementFields implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductAttachementFields'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'deal_id' => 'int', + 'product_id' => 'int', + 'duration_unit' => 'string', + 'sum_no_discount' => 'float', + 'sum' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'last_edit' => 'string', + 'active_flag' => 'bool', + 'tax' => 'float', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'deal_id' => null, + 'product_id' => null, + 'duration_unit' => null, + 'sum_no_discount' => null, + 'sum' => null, + 'currency' => null, + 'add_time' => null, + 'last_edit' => null, + 'active_flag' => null, + 'tax' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'deal_id' => 'deal_id', + 'product_id' => 'product_id', + 'duration_unit' => 'duration_unit', + 'sum_no_discount' => 'sum_no_discount', + 'sum' => 'sum', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'last_edit' => 'last_edit', + 'active_flag' => 'active_flag', + 'tax' => 'tax', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'deal_id' => 'setDealId', + 'product_id' => 'setProductId', + 'duration_unit' => 'setDurationUnit', + 'sum_no_discount' => 'setSumNoDiscount', + 'sum' => 'setSum', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'last_edit' => 'setLastEdit', + 'active_flag' => 'setActiveFlag', + 'tax' => 'setTax', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'deal_id' => 'getDealId', + 'product_id' => 'getProductId', + 'duration_unit' => 'getDurationUnit', + 'sum_no_discount' => 'getSumNoDiscount', + 'sum' => 'getSum', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'last_edit' => 'getLastEdit', + 'active_flag' => 'getActiveFlag', + 'tax' => 'getTax', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['sum_no_discount'] = $data['sum_no_discount'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['last_edit'] = $data['last_edit'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['tax'] = $data['tax'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal-product (the ID of the product attached to the deal) + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets duration_unit + * + * @return string|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param string|null $duration_unit The type of the duration. (For example hourly, daily, etc.) + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets sum_no_discount + * + * @return float|null + */ + public function getSumNoDiscount() + { + return $this->container['sum_no_discount']; + } + + /** + * Sets sum_no_discount + * + * @param float|null $sum_no_discount The product sum without the discount + * + * @return self + */ + public function setSumNoDiscount($sum_no_discount): self + { + $this->container['sum_no_discount'] = $sum_no_discount; + + return $this; + } + + /** + * Gets sum + * + * @return float|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param float|null $sum The sum of all the products attached to the deal + * + * @return self + */ + public function setSum($sum): self + { + $this->container['sum'] = $sum; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal product + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the product was added to the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets last_edit + * + * @return string|null + */ + public function getLastEdit() + { + return $this->container['last_edit']; + } + + /** + * Sets last_edit + * + * @param string|null $last_edit The date and time when the deal product was last edited + * + * @return self + */ + public function setLastEdit($last_edit): self + { + $this->container['last_edit'] = $last_edit; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The product tax + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The product name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductAttachmentDetails.php b/lib/Model/ProductAttachmentDetails.php new file mode 100644 index 00000000..b9ce3511 --- /dev/null +++ b/lib/Model/ProductAttachmentDetails.php @@ -0,0 +1,921 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductAttachmentDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductAttachmentDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'product_id' => 'int', + 'item_price' => 'float', + 'quantity' => 'int', + 'discount_percentage' => 'float', + 'duration' => 'float', + 'duration_unit' => 'string', + 'product_variation_id' => 'int', + 'comments' => 'string', + 'tax' => 'float', + 'enabled_flag' => 'bool', + 'id' => 'int', + 'company_id' => 'int', + 'deal_id' => 'int', + 'sum_no_discount' => 'float', + 'sum' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'last_edit' => 'string', + 'active_flag' => 'bool', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'item_price' => null, + 'quantity' => null, + 'discount_percentage' => null, + 'duration' => null, + 'duration_unit' => null, + 'product_variation_id' => null, + 'comments' => null, + 'tax' => null, + 'enabled_flag' => null, + 'id' => null, + 'company_id' => null, + 'deal_id' => null, + 'sum_no_discount' => null, + 'sum' => null, + 'currency' => null, + 'add_time' => null, + 'last_edit' => null, + 'active_flag' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'item_price' => 'item_price', + 'quantity' => 'quantity', + 'discount_percentage' => 'discount_percentage', + 'duration' => 'duration', + 'duration_unit' => 'duration_unit', + 'product_variation_id' => 'product_variation_id', + 'comments' => 'comments', + 'tax' => 'tax', + 'enabled_flag' => 'enabled_flag', + 'id' => 'id', + 'company_id' => 'company_id', + 'deal_id' => 'deal_id', + 'sum_no_discount' => 'sum_no_discount', + 'sum' => 'sum', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'last_edit' => 'last_edit', + 'active_flag' => 'active_flag', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'item_price' => 'setItemPrice', + 'quantity' => 'setQuantity', + 'discount_percentage' => 'setDiscountPercentage', + 'duration' => 'setDuration', + 'duration_unit' => 'setDurationUnit', + 'product_variation_id' => 'setProductVariationId', + 'comments' => 'setComments', + 'tax' => 'setTax', + 'enabled_flag' => 'setEnabledFlag', + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'deal_id' => 'setDealId', + 'sum_no_discount' => 'setSumNoDiscount', + 'sum' => 'setSum', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'last_edit' => 'setLastEdit', + 'active_flag' => 'setActiveFlag', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'item_price' => 'getItemPrice', + 'quantity' => 'getQuantity', + 'discount_percentage' => 'getDiscountPercentage', + 'duration' => 'getDuration', + 'duration_unit' => 'getDurationUnit', + 'product_variation_id' => 'getProductVariationId', + 'comments' => 'getComments', + 'tax' => 'getTax', + 'enabled_flag' => 'getEnabledFlag', + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'deal_id' => 'getDealId', + 'sum_no_discount' => 'getSumNoDiscount', + 'sum' => 'getSum', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'last_edit' => 'getLastEdit', + 'active_flag' => 'getActiveFlag', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['item_price'] = $data['item_price'] ?? null; + $this->container['quantity'] = $data['quantity'] ?? null; + $this->container['discount_percentage'] = $data['discount_percentage'] ?? 0; + $this->container['duration'] = $data['duration'] ?? 1; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['product_variation_id'] = $data['product_variation_id'] ?? null; + $this->container['comments'] = $data['comments'] ?? null; + $this->container['tax'] = $data['tax'] ?? null; + $this->container['enabled_flag'] = $data['enabled_flag'] ?? true; + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['sum_no_discount'] = $data['sum_no_discount'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['last_edit'] = $data['last_edit'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['item_price'] === null) { + $invalidProperties[] = "'item_price' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' 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 product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id The ID of the product + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets item_price + * + * @return float + */ + public function getItemPrice() + { + return $this->container['item_price']; + } + + /** + * Sets item_price + * + * @param float $item_price The price at which this product will be added to the deal + * + * @return self + */ + public function setItemPrice($item_price): self + { + $this->container['item_price'] = $item_price; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity Quantity – e.g. how many items of this product will be added to the deal + * + * @return self + */ + public function setQuantity($quantity): self + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets discount_percentage + * + * @return float|null + */ + public function getDiscountPercentage() + { + return $this->container['discount_percentage']; + } + + /** + * Sets discount_percentage + * + * @param float|null $discount_percentage The discount %. If omitted, will be set to 0. + * + * @return self + */ + public function setDiscountPercentage($discount_percentage): self + { + $this->container['discount_percentage'] = $discount_percentage; + + return $this; + } + + /** + * Gets duration + * + * @return float|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param float|null $duration The duration of the product. If omitted, will be set to 1. + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets duration_unit + * + * @return string|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param string|null $duration_unit The type of the duration. (For example hourly, daily, etc.) + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets product_variation_id + * + * @return int|null + */ + public function getProductVariationId() + { + return $this->container['product_variation_id']; + } + + /** + * Sets product_variation_id + * + * @param int|null $product_variation_id The ID of the product variation to use. When omitted, no variation will be used. + * + * @return self + */ + public function setProductVariationId($product_variation_id): self + { + $this->container['product_variation_id'] = $product_variation_id; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments A textual comment associated with this product-deal attachment + * + * @return self + */ + public function setComments($comments): self + { + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The product tax + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets enabled_flag + * + * @return bool|null + */ + public function getEnabledFlag() + { + return $this->container['enabled_flag']; + } + + /** + * Sets enabled_flag + * + * @param bool|null $enabled_flag Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. + * + * @return self + */ + public function setEnabledFlag($enabled_flag): self + { + $this->container['enabled_flag'] = $enabled_flag; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal-product (the ID of the product attached to the deal) + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets sum_no_discount + * + * @return float|null + */ + public function getSumNoDiscount() + { + return $this->container['sum_no_discount']; + } + + /** + * Sets sum_no_discount + * + * @param float|null $sum_no_discount The product sum without the discount + * + * @return self + */ + public function setSumNoDiscount($sum_no_discount): self + { + $this->container['sum_no_discount'] = $sum_no_discount; + + return $this; + } + + /** + * Gets sum + * + * @return float|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param float|null $sum The sum of all the products attached to the deal + * + * @return self + */ + public function setSum($sum): self + { + $this->container['sum'] = $sum; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal product + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the product was added to the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets last_edit + * + * @return string|null + */ + public function getLastEdit() + { + return $this->container['last_edit']; + } + + /** + * Sets last_edit + * + * @param string|null $last_edit The date and time when the deal product was last edited + * + * @return self + */ + public function setLastEdit($last_edit): self + { + $this->container['last_edit'] = $last_edit; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The product name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductBaseDeal.php b/lib/Model/ProductBaseDeal.php new file mode 100644 index 00000000..0cd4537d --- /dev/null +++ b/lib/Model/ProductBaseDeal.php @@ -0,0 +1,1602 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductBaseDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductBaseDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'company_id' => 'int', + 'creator_user_id' => 'int', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'stage_id' => 'int', + 'title' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'add_time' => 'string', + 'first_add_time' => 'string', + 'update_time' => 'string', + 'stage_change_time' => 'string', + 'active' => 'bool', + 'deleted' => 'bool', + 'status' => 'string', + 'probability' => 'float', + 'next_activity_date' => 'string', + 'next_activity_time' => 'string', + 'next_activity_id' => 'int', + 'last_activity_id' => 'int', + 'last_activity_date' => 'string', + 'lost_reason' => 'string', + 'visible_to' => 'string', + 'close_time' => 'string', + 'pipeline_id' => 'int', + 'won_time' => 'string', + 'first_won_time' => 'string', + 'lost_time' => 'string', + 'products_count' => 'int', + 'files_count' => 'int', + 'notes_count' => 'int', + 'followers_count' => 'int', + 'email_messages_count' => 'int', + 'activities_count' => 'int', + 'done_activities_count' => 'int', + 'undone_activities_count' => 'int', + 'participants_count' => 'int', + 'expected_close_date' => '\DateTime', + 'last_incoming_mail_time' => 'string', + 'last_outgoing_mail_time' => 'string', + 'label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'company_id' => null, + 'creator_user_id' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'stage_id' => null, + 'title' => null, + 'value' => null, + 'currency' => null, + 'add_time' => null, + 'first_add_time' => null, + 'update_time' => null, + 'stage_change_time' => null, + 'active' => null, + 'deleted' => null, + 'status' => null, + 'probability' => null, + 'next_activity_date' => null, + 'next_activity_time' => null, + 'next_activity_id' => null, + 'last_activity_id' => null, + 'last_activity_date' => null, + 'lost_reason' => null, + 'visible_to' => null, + 'close_time' => null, + 'pipeline_id' => null, + 'won_time' => null, + 'first_won_time' => null, + 'lost_time' => null, + 'products_count' => null, + 'files_count' => null, + 'notes_count' => null, + 'followers_count' => null, + 'email_messages_count' => null, + 'activities_count' => null, + 'done_activities_count' => null, + 'undone_activities_count' => null, + 'participants_count' => null, + 'expected_close_date' => 'date', + 'last_incoming_mail_time' => null, + 'last_outgoing_mail_time' => null, + 'label' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'company_id' => 'company_id', + 'creator_user_id' => 'creator_user_id', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'stage_id' => 'stage_id', + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'add_time' => 'add_time', + 'first_add_time' => 'first_add_time', + 'update_time' => 'update_time', + 'stage_change_time' => 'stage_change_time', + 'active' => 'active', + 'deleted' => 'deleted', + 'status' => 'status', + 'probability' => 'probability', + 'next_activity_date' => 'next_activity_date', + 'next_activity_time' => 'next_activity_time', + 'next_activity_id' => 'next_activity_id', + 'last_activity_id' => 'last_activity_id', + 'last_activity_date' => 'last_activity_date', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to', + 'close_time' => 'close_time', + 'pipeline_id' => 'pipeline_id', + 'won_time' => 'won_time', + 'first_won_time' => 'first_won_time', + 'lost_time' => 'lost_time', + 'products_count' => 'products_count', + 'files_count' => 'files_count', + 'notes_count' => 'notes_count', + 'followers_count' => 'followers_count', + 'email_messages_count' => 'email_messages_count', + 'activities_count' => 'activities_count', + 'done_activities_count' => 'done_activities_count', + 'undone_activities_count' => 'undone_activities_count', + 'participants_count' => 'participants_count', + 'expected_close_date' => 'expected_close_date', + 'last_incoming_mail_time' => 'last_incoming_mail_time', + 'last_outgoing_mail_time' => 'last_outgoing_mail_time', + 'label' => 'label' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'company_id' => 'setCompanyId', + 'creator_user_id' => 'setCreatorUserId', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'stage_id' => 'setStageId', + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'add_time' => 'setAddTime', + 'first_add_time' => 'setFirstAddTime', + 'update_time' => 'setUpdateTime', + 'stage_change_time' => 'setStageChangeTime', + 'active' => 'setActive', + 'deleted' => 'setDeleted', + 'status' => 'setStatus', + 'probability' => 'setProbability', + 'next_activity_date' => 'setNextActivityDate', + 'next_activity_time' => 'setNextActivityTime', + 'next_activity_id' => 'setNextActivityId', + 'last_activity_id' => 'setLastActivityId', + 'last_activity_date' => 'setLastActivityDate', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo', + 'close_time' => 'setCloseTime', + 'pipeline_id' => 'setPipelineId', + 'won_time' => 'setWonTime', + 'first_won_time' => 'setFirstWonTime', + 'lost_time' => 'setLostTime', + 'products_count' => 'setProductsCount', + 'files_count' => 'setFilesCount', + 'notes_count' => 'setNotesCount', + 'followers_count' => 'setFollowersCount', + 'email_messages_count' => 'setEmailMessagesCount', + 'activities_count' => 'setActivitiesCount', + 'done_activities_count' => 'setDoneActivitiesCount', + 'undone_activities_count' => 'setUndoneActivitiesCount', + 'participants_count' => 'setParticipantsCount', + 'expected_close_date' => 'setExpectedCloseDate', + 'last_incoming_mail_time' => 'setLastIncomingMailTime', + 'last_outgoing_mail_time' => 'setLastOutgoingMailTime', + 'label' => 'setLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'company_id' => 'getCompanyId', + 'creator_user_id' => 'getCreatorUserId', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'stage_id' => 'getStageId', + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'add_time' => 'getAddTime', + 'first_add_time' => 'getFirstAddTime', + 'update_time' => 'getUpdateTime', + 'stage_change_time' => 'getStageChangeTime', + 'active' => 'getActive', + 'deleted' => 'getDeleted', + 'status' => 'getStatus', + 'probability' => 'getProbability', + 'next_activity_date' => 'getNextActivityDate', + 'next_activity_time' => 'getNextActivityTime', + 'next_activity_id' => 'getNextActivityId', + 'last_activity_id' => 'getLastActivityId', + 'last_activity_date' => 'getLastActivityDate', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo', + 'close_time' => 'getCloseTime', + 'pipeline_id' => 'getPipelineId', + 'won_time' => 'getWonTime', + 'first_won_time' => 'getFirstWonTime', + 'lost_time' => 'getLostTime', + 'products_count' => 'getProductsCount', + 'files_count' => 'getFilesCount', + 'notes_count' => 'getNotesCount', + 'followers_count' => 'getFollowersCount', + 'email_messages_count' => 'getEmailMessagesCount', + 'activities_count' => 'getActivitiesCount', + 'done_activities_count' => 'getDoneActivitiesCount', + 'undone_activities_count' => 'getUndoneActivitiesCount', + 'participants_count' => 'getParticipantsCount', + 'expected_close_date' => 'getExpectedCloseDate', + 'last_incoming_mail_time' => 'getLastIncomingMailTime', + 'last_outgoing_mail_time' => 'getLastOutgoingMailTime', + 'label' => 'getLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + $this->container['creator_user_id'] = $data['creator_user_id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['first_add_time'] = $data['first_add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['stage_change_time'] = $data['stage_change_time'] ?? null; + $this->container['active'] = $data['active'] ?? null; + $this->container['deleted'] = $data['deleted'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['next_activity_date'] = $data['next_activity_date'] ?? null; + $this->container['next_activity_time'] = $data['next_activity_time'] ?? null; + $this->container['next_activity_id'] = $data['next_activity_id'] ?? null; + $this->container['last_activity_id'] = $data['last_activity_id'] ?? null; + $this->container['last_activity_date'] = $data['last_activity_date'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['close_time'] = $data['close_time'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['won_time'] = $data['won_time'] ?? null; + $this->container['first_won_time'] = $data['first_won_time'] ?? null; + $this->container['lost_time'] = $data['lost_time'] ?? null; + $this->container['products_count'] = $data['products_count'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['notes_count'] = $data['notes_count'] ?? null; + $this->container['followers_count'] = $data['followers_count'] ?? null; + $this->container['email_messages_count'] = $data['email_messages_count'] ?? null; + $this->container['activities_count'] = $data['activities_count'] ?? null; + $this->container['done_activities_count'] = $data['done_activities_count'] ?? null; + $this->container['undone_activities_count'] = $data['undone_activities_count'] ?? null; + $this->container['participants_count'] = $data['participants_count'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['last_incoming_mail_time'] = $data['last_incoming_mail_time'] ?? null; + $this->container['last_outgoing_mail_time'] = $data['last_outgoing_mail_time'] ?? null; + $this->container['label'] = $data['label'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The ID of the company + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + + /** + * Gets creator_user_id + * + * @return int|null + */ + public function getCreatorUserId() + { + return $this->container['creator_user_id']; + } + + /** + * Sets creator_user_id + * + * @param int|null $creator_user_id The ID of the deal creator + * + * @return self + */ + public function setCreatorUserId($creator_user_id): self + { + $this->container['creator_user_id'] = $creator_user_id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person associated with the deal + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization associated with the deal + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the deal stage + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation date and time of the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets first_add_time + * + * @return string|null + */ + public function getFirstAddTime() + { + return $this->container['first_add_time']; + } + + /** + * Sets first_add_time + * + * @param string|null $first_add_time The first creation date and time of the deal + * + * @return self + */ + public function setFirstAddTime($first_add_time): self + { + $this->container['first_add_time'] = $first_add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The last updated date and time of the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets stage_change_time + * + * @return string|null + */ + public function getStageChangeTime() + { + return $this->container['stage_change_time']; + } + + /** + * Sets stage_change_time + * + * @param string|null $stage_change_time The last updated date and time of the deal stage + * + * @return self + */ + public function setStageChangeTime($stage_change_time): self + { + $this->container['stage_change_time'] = $stage_change_time; + + return $this; + } + + /** + * Gets active + * + * @return bool|null + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool|null $active Whether the deal is active or not + * + * @return self + */ + public function setActive($active): self + { + $this->container['active'] = $active; + + return $this; + } + + /** + * Gets deleted + * + * @return bool|null + */ + public function getDeleted() + { + return $this->container['deleted']; + } + + /** + * Sets deleted + * + * @param bool|null $deleted Whether the deal is deleted or not + * + * @return self + */ + public function setDeleted($deleted): self + { + $this->container['deleted'] = $deleted; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets next_activity_date + * + * @return string|null + */ + public function getNextActivityDate() + { + return $this->container['next_activity_date']; + } + + /** + * Sets next_activity_date + * + * @param string|null $next_activity_date The date of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityDate($next_activity_date): self + { + $this->container['next_activity_date'] = $next_activity_date; + + return $this; + } + + /** + * Gets next_activity_time + * + * @return string|null + */ + public function getNextActivityTime() + { + return $this->container['next_activity_time']; + } + + /** + * Sets next_activity_time + * + * @param string|null $next_activity_time The time of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityTime($next_activity_time): self + { + $this->container['next_activity_time'] = $next_activity_time; + + return $this; + } + + /** + * Gets next_activity_id + * + * @return int|null + */ + public function getNextActivityId() + { + return $this->container['next_activity_id']; + } + + /** + * Sets next_activity_id + * + * @param int|null $next_activity_id The ID of the next activity associated with the deal + * + * @return self + */ + public function setNextActivityId($next_activity_id): self + { + $this->container['next_activity_id'] = $next_activity_id; + + return $this; + } + + /** + * Gets last_activity_id + * + * @return int|null + */ + public function getLastActivityId() + { + return $this->container['last_activity_id']; + } + + /** + * Sets last_activity_id + * + * @param int|null $last_activity_id The ID of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityId($last_activity_id): self + { + $this->container['last_activity_id'] = $last_activity_id; + + return $this; + } + + /** + * Gets last_activity_date + * + * @return string|null + */ + public function getLastActivityDate() + { + return $this->container['last_activity_date']; + } + + /** + * Sets last_activity_date + * + * @param string|null $last_activity_date The date of the last activity associated with the deal + * + * @return self + */ + public function setLastActivityDate($last_activity_date): self + { + $this->container['last_activity_date'] = $last_activity_date; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The reason for losing the deal + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return string|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param string|null $visible_to The visibility of the deal + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets close_time + * + * @return string|null + */ + public function getCloseTime() + { + return $this->container['close_time']; + } + + /** + * Sets close_time + * + * @param string|null $close_time The date and time of closing the deal + * + * @return self + */ + public function setCloseTime($close_time): self + { + $this->container['close_time'] = $close_time; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline associated with the deal + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets won_time + * + * @return string|null + */ + public function getWonTime() + { + return $this->container['won_time']; + } + + /** + * Sets won_time + * + * @param string|null $won_time The date and time of changing the deal status as won + * + * @return self + */ + public function setWonTime($won_time): self + { + $this->container['won_time'] = $won_time; + + return $this; + } + + /** + * Gets first_won_time + * + * @return string|null + */ + public function getFirstWonTime() + { + return $this->container['first_won_time']; + } + + /** + * Sets first_won_time + * + * @param string|null $first_won_time The date and time of the first time changing the deal status as won + * + * @return self + */ + public function setFirstWonTime($first_won_time): self + { + $this->container['first_won_time'] = $first_won_time; + + return $this; + } + + /** + * Gets lost_time + * + * @return string|null + */ + public function getLostTime() + { + return $this->container['lost_time']; + } + + /** + * Sets lost_time + * + * @param string|null $lost_time The date and time of changing the deal status as lost + * + * @return self + */ + public function setLostTime($lost_time): self + { + $this->container['lost_time'] = $lost_time; + + return $this; + } + + /** + * Gets products_count + * + * @return int|null + */ + public function getProductsCount() + { + return $this->container['products_count']; + } + + /** + * Sets products_count + * + * @param int|null $products_count The number of products associated with the deal + * + * @return self + */ + public function setProductsCount($products_count): self + { + $this->container['products_count'] = $products_count; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The number of files associated with the deal + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets notes_count + * + * @return int|null + */ + public function getNotesCount() + { + return $this->container['notes_count']; + } + + /** + * Sets notes_count + * + * @param int|null $notes_count The number of notes associated with the deal + * + * @return self + */ + public function setNotesCount($notes_count): self + { + $this->container['notes_count'] = $notes_count; + + return $this; + } + + /** + * Gets followers_count + * + * @return int|null + */ + public function getFollowersCount() + { + return $this->container['followers_count']; + } + + /** + * Sets followers_count + * + * @param int|null $followers_count The number of followers associated with the deal + * + * @return self + */ + public function setFollowersCount($followers_count): self + { + $this->container['followers_count'] = $followers_count; + + return $this; + } + + /** + * Gets email_messages_count + * + * @return int|null + */ + public function getEmailMessagesCount() + { + return $this->container['email_messages_count']; + } + + /** + * Sets email_messages_count + * + * @param int|null $email_messages_count The number of emails associated with the deal + * + * @return self + */ + public function setEmailMessagesCount($email_messages_count): self + { + $this->container['email_messages_count'] = $email_messages_count; + + return $this; + } + + /** + * Gets activities_count + * + * @return int|null + */ + public function getActivitiesCount() + { + return $this->container['activities_count']; + } + + /** + * Sets activities_count + * + * @param int|null $activities_count The number of activities associated with the deal + * + * @return self + */ + public function setActivitiesCount($activities_count): self + { + $this->container['activities_count'] = $activities_count; + + return $this; + } + + /** + * Gets done_activities_count + * + * @return int|null + */ + public function getDoneActivitiesCount() + { + return $this->container['done_activities_count']; + } + + /** + * Sets done_activities_count + * + * @param int|null $done_activities_count The number of completed activities associated with the deal + * + * @return self + */ + public function setDoneActivitiesCount($done_activities_count): self + { + $this->container['done_activities_count'] = $done_activities_count; + + return $this; + } + + /** + * Gets undone_activities_count + * + * @return int|null + */ + public function getUndoneActivitiesCount() + { + return $this->container['undone_activities_count']; + } + + /** + * Sets undone_activities_count + * + * @param int|null $undone_activities_count The number of incomplete activities associated with the deal + * + * @return self + */ + public function setUndoneActivitiesCount($undone_activities_count): self + { + $this->container['undone_activities_count'] = $undone_activities_count; + + return $this; + } + + /** + * Gets participants_count + * + * @return int|null + */ + public function getParticipantsCount() + { + return $this->container['participants_count']; + } + + /** + * Sets participants_count + * + * @param int|null $participants_count The number of participants associated with the deal + * + * @return self + */ + public function setParticipantsCount($participants_count): self + { + $this->container['participants_count'] = $participants_count; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets last_incoming_mail_time + * + * @return string|null + */ + public function getLastIncomingMailTime() + { + return $this->container['last_incoming_mail_time']; + } + + /** + * Sets last_incoming_mail_time + * + * @param string|null $last_incoming_mail_time The date and time of the last incoming email associated with the deal + * + * @return self + */ + public function setLastIncomingMailTime($last_incoming_mail_time): self + { + $this->container['last_incoming_mail_time'] = $last_incoming_mail_time; + + return $this; + } + + /** + * Gets last_outgoing_mail_time + * + * @return string|null + */ + public function getLastOutgoingMailTime() + { + return $this->container['last_outgoing_mail_time']; + } + + /** + * Sets last_outgoing_mail_time + * + * @param string|null $last_outgoing_mail_time The date and time of the last outgoing email associated with the deal + * + * @return self + */ + public function setLastOutgoingMailTime($last_outgoing_mail_time): self + { + $this->container['last_outgoing_mail_time'] = $last_outgoing_mail_time; + + return $this; + } + + /** + * Gets label + * + * @return string|null + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string|null $label The label or multiple labels assigned to the deal + * + * @return self + */ + public function setLabel($label): self + { + $this->container['label'] = $label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductField.php b/lib/Model/ProductField.php new file mode 100644 index 00000000..f6db41a5 --- /dev/null +++ b/lib/Model/ProductField.php @@ -0,0 +1,922 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductField implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'options' => 'object[]', + 'field_type' => 'string', + 'id' => 'int', + 'key' => 'string', + 'order_nr' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'last_updated_by_user_id' => 'int', + 'active_flag' => 'bool', + 'edit_flag' => 'bool', + 'add_visible_flag' => 'bool', + 'important_flag' => 'bool', + 'bulk_edit_allowed' => 'bool', + 'searchable_flag' => 'bool', + 'filtering_allowed' => 'bool', + 'sortable_flag' => 'bool', + 'mandatory_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'options' => null, + 'field_type' => null, + 'id' => null, + 'key' => null, + 'order_nr' => null, + 'add_time' => null, + 'update_time' => null, + 'last_updated_by_user_id' => null, + 'active_flag' => null, + 'edit_flag' => null, + 'add_visible_flag' => null, + 'important_flag' => null, + 'bulk_edit_allowed' => null, + 'searchable_flag' => null, + 'filtering_allowed' => null, + 'sortable_flag' => null, + 'mandatory_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'options' => 'options', + 'field_type' => 'field_type', + 'id' => 'id', + 'key' => 'key', + 'order_nr' => 'order_nr', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'last_updated_by_user_id' => 'last_updated_by_user_id', + 'active_flag' => 'active_flag', + 'edit_flag' => 'edit_flag', + 'add_visible_flag' => 'add_visible_flag', + 'important_flag' => 'important_flag', + 'bulk_edit_allowed' => 'bulk_edit_allowed', + 'searchable_flag' => 'searchable_flag', + 'filtering_allowed' => 'filtering_allowed', + 'sortable_flag' => 'sortable_flag', + 'mandatory_flag' => 'mandatory_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'options' => 'setOptions', + 'field_type' => 'setFieldType', + 'id' => 'setId', + 'key' => 'setKey', + 'order_nr' => 'setOrderNr', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'last_updated_by_user_id' => 'setLastUpdatedByUserId', + 'active_flag' => 'setActiveFlag', + 'edit_flag' => 'setEditFlag', + 'add_visible_flag' => 'setAddVisibleFlag', + 'important_flag' => 'setImportantFlag', + 'bulk_edit_allowed' => 'setBulkEditAllowed', + 'searchable_flag' => 'setSearchableFlag', + 'filtering_allowed' => 'setFilteringAllowed', + 'sortable_flag' => 'setSortableFlag', + 'mandatory_flag' => 'setMandatoryFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'options' => 'getOptions', + 'field_type' => 'getFieldType', + 'id' => 'getId', + 'key' => 'getKey', + 'order_nr' => 'getOrderNr', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'last_updated_by_user_id' => 'getLastUpdatedByUserId', + 'active_flag' => 'getActiveFlag', + 'edit_flag' => 'getEditFlag', + 'add_visible_flag' => 'getAddVisibleFlag', + 'important_flag' => 'getImportantFlag', + 'bulk_edit_allowed' => 'getBulkEditAllowed', + 'searchable_flag' => 'getSearchableFlag', + 'filtering_allowed' => 'getFilteringAllowed', + 'sortable_flag' => 'getSortableFlag', + 'mandatory_flag' => 'getMandatoryFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const FIELD_TYPE_VARCHAR = 'varchar'; + const FIELD_TYPE_VARCHAR_AUTO = 'varchar_auto'; + const FIELD_TYPE_TEXT = 'text'; + const FIELD_TYPE_DOUBLE = 'double'; + const FIELD_TYPE_MONETARY = 'monetary'; + const FIELD_TYPE_DATE = 'date'; + const FIELD_TYPE_SET = 'set'; + const FIELD_TYPE_ENUM = 'enum'; + const FIELD_TYPE_USER = 'user'; + const FIELD_TYPE_ORG = 'org'; + const FIELD_TYPE_PEOPLE = 'people'; + const FIELD_TYPE_PHONE = 'phone'; + const FIELD_TYPE_TIME = 'time'; + const FIELD_TYPE_TIMERANGE = 'timerange'; + const FIELD_TYPE_DATERANGE = 'daterange'; + const FIELD_TYPE_ADDRESS = 'address'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getFieldTypeAllowableValues(): array + { + return [ + self::FIELD_TYPE_VARCHAR, + self::FIELD_TYPE_VARCHAR_AUTO, + self::FIELD_TYPE_TEXT, + self::FIELD_TYPE_DOUBLE, + self::FIELD_TYPE_MONETARY, + self::FIELD_TYPE_DATE, + self::FIELD_TYPE_SET, + self::FIELD_TYPE_ENUM, + self::FIELD_TYPE_USER, + self::FIELD_TYPE_ORG, + self::FIELD_TYPE_PEOPLE, + self::FIELD_TYPE_PHONE, + self::FIELD_TYPE_TIME, + self::FIELD_TYPE_TIMERANGE, + self::FIELD_TYPE_DATERANGE, + self::FIELD_TYPE_ADDRESS, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['options'] = $data['options'] ?? null; + $this->container['field_type'] = $data['field_type'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['key'] = $data['key'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['last_updated_by_user_id'] = $data['last_updated_by_user_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['edit_flag'] = $data['edit_flag'] ?? null; + $this->container['add_visible_flag'] = $data['add_visible_flag'] ?? null; + $this->container['important_flag'] = $data['important_flag'] ?? null; + $this->container['bulk_edit_allowed'] = $data['bulk_edit_allowed'] ?? null; + $this->container['searchable_flag'] = $data['searchable_flag'] ?? null; + $this->container['filtering_allowed'] = $data['filtering_allowed'] ?? null; + $this->container['sortable_flag'] = $data['sortable_flag'] ?? null; + $this->container['mandatory_flag'] = $data['mandatory_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['field_type'] === null) { + $invalidProperties[] = "'field_type' can't be null"; + } + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!is_null($this->container['field_type']) && !in_array($this->container['field_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'field_type', must be one of '%s'", + $this->container['field_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return object[]|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param object[]|null $options When `field_type` is either `set` or `enum`, possible options must be supplied as a JSON-encoded sequential array, for example:
`[{\"label\":\"red\"}, {\"label\":\"blue\"}, {\"label\":\"lilac\"}]` + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets field_type + * + * @return string + */ + public function getFieldType() + { + return $this->container['field_type']; + } + + /** + * Sets field_type + * + * @param string $field_type The type of the field
ValueDescription
`varchar`Text (up to 255 characters)
`varchar_auto`Autocomplete text (up to 255 characters)
`text`Long text (up to 65k characters)
`double`Numeric value
`monetary`Monetary field (has a numeric value and a currency value)
`date`Date (format YYYY-MM-DD)
`set`Options field with a possibility of having multiple chosen options
`enum`Options field with a single possible chosen option
`user`User field (contains a user ID of another Pipedrive user)
`org`Organization field (contains an organization ID which is stored on the same account)
`people`Person field (contains a product ID which is stored on the same account)
`phone`Phone field (up to 255 numbers and/or characters)
`time`Time field (format HH:MM:SS)
`timerange`Time-range field (has a start time and end time value, both HH:MM:SS)
`daterange`Date-range field (has a start date and end date value, both YYYY-MM-DD)
`address`Address field (autocompleted by Google Maps)
+ * + * @return self + */ + public function setFieldType($field_type): self + { + $allowedValues = $this->getFieldTypeAllowableValues(); + if (!in_array($field_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'field_type', must be one of '%s'", + $field_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['field_type'] = $field_type; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the product field + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key of the product field + * + * @return self + */ + public function setKey($key): self + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr The position (index) of the product field in the detail view + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The product field creation time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The product field last update time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets last_updated_by_user_id + * + * @return int|null + */ + public function getLastUpdatedByUserId() + { + return $this->container['last_updated_by_user_id']; + } + + /** + * Sets last_updated_by_user_id + * + * @param int|null $last_updated_by_user_id The ID of the last user to update the product field + * + * @return self + */ + public function setLastUpdatedByUserId($last_updated_by_user_id): self + { + $this->container['last_updated_by_user_id'] = $last_updated_by_user_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether or not the product field is currently active + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets edit_flag + * + * @return bool|null + */ + public function getEditFlag() + { + return $this->container['edit_flag']; + } + + /** + * Sets edit_flag + * + * @param bool|null $edit_flag Whether or not the product field name and metadata is editable + * + * @return self + */ + public function setEditFlag($edit_flag): self + { + $this->container['edit_flag'] = $edit_flag; + + return $this; + } + + /** + * Gets add_visible_flag + * + * @return bool|null + */ + public function getAddVisibleFlag() + { + return $this->container['add_visible_flag']; + } + + /** + * Sets add_visible_flag + * + * @param bool|null $add_visible_flag Whether or not the product field is visible in the Add Product Modal + * + * @return self + */ + public function setAddVisibleFlag($add_visible_flag): self + { + $this->container['add_visible_flag'] = $add_visible_flag; + + return $this; + } + + /** + * Gets important_flag + * + * @return bool|null + */ + public function getImportantFlag() + { + return $this->container['important_flag']; + } + + /** + * Sets important_flag + * + * @param bool|null $important_flag Whether or not the product field is marked as important + * + * @return self + */ + public function setImportantFlag($important_flag): self + { + $this->container['important_flag'] = $important_flag; + + return $this; + } + + /** + * Gets bulk_edit_allowed + * + * @return bool|null + */ + public function getBulkEditAllowed() + { + return $this->container['bulk_edit_allowed']; + } + + /** + * Sets bulk_edit_allowed + * + * @param bool|null $bulk_edit_allowed Whether or not the product field data can be edited + * + * @return self + */ + public function setBulkEditAllowed($bulk_edit_allowed): self + { + $this->container['bulk_edit_allowed'] = $bulk_edit_allowed; + + return $this; + } + + /** + * Gets searchable_flag + * + * @return bool|null + */ + public function getSearchableFlag() + { + return $this->container['searchable_flag']; + } + + /** + * Sets searchable_flag + * + * @param bool|null $searchable_flag Whether or not the product field is searchable + * + * @return self + */ + public function setSearchableFlag($searchable_flag): self + { + $this->container['searchable_flag'] = $searchable_flag; + + return $this; + } + + /** + * Gets filtering_allowed + * + * @return bool|null + */ + public function getFilteringAllowed() + { + return $this->container['filtering_allowed']; + } + + /** + * Sets filtering_allowed + * + * @param bool|null $filtering_allowed Whether or not the product field value can be used when filtering searches + * + * @return self + */ + public function setFilteringAllowed($filtering_allowed): self + { + $this->container['filtering_allowed'] = $filtering_allowed; + + return $this; + } + + /** + * Gets sortable_flag + * + * @return bool|null + */ + public function getSortableFlag() + { + return $this->container['sortable_flag']; + } + + /** + * Sets sortable_flag + * + * @param bool|null $sortable_flag Whether or not the product field is sortable + * + * @return self + */ + public function setSortableFlag($sortable_flag): self + { + $this->container['sortable_flag'] = $sortable_flag; + + return $this; + } + + /** + * Gets mandatory_flag + * + * @return bool|null + */ + public function getMandatoryFlag() + { + return $this->container['mandatory_flag']; + } + + /** + * Sets mandatory_flag + * + * @param bool|null $mandatory_flag Whether or not the product field is mandatory when creating products + * + * @return self + */ + public function setMandatoryFlag($mandatory_flag): self + { + $this->container['mandatory_flag'] = $mandatory_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductFieldAllOf.php b/lib/Model/ProductFieldAllOf.php new file mode 100644 index 00000000..79d11d2e --- /dev/null +++ b/lib/Model/ProductFieldAllOf.php @@ -0,0 +1,762 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductFieldAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductField_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'key' => 'string', + 'order_nr' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'last_updated_by_user_id' => 'int', + 'active_flag' => 'bool', + 'edit_flag' => 'bool', + 'add_visible_flag' => 'bool', + 'important_flag' => 'bool', + 'bulk_edit_allowed' => 'bool', + 'searchable_flag' => 'bool', + 'filtering_allowed' => 'bool', + 'sortable_flag' => 'bool', + 'mandatory_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'key' => null, + 'order_nr' => null, + 'add_time' => null, + 'update_time' => null, + 'last_updated_by_user_id' => null, + 'active_flag' => null, + 'edit_flag' => null, + 'add_visible_flag' => null, + 'important_flag' => null, + 'bulk_edit_allowed' => null, + 'searchable_flag' => null, + 'filtering_allowed' => null, + 'sortable_flag' => null, + 'mandatory_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'order_nr' => 'order_nr', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'last_updated_by_user_id' => 'last_updated_by_user_id', + 'active_flag' => 'active_flag', + 'edit_flag' => 'edit_flag', + 'add_visible_flag' => 'add_visible_flag', + 'important_flag' => 'important_flag', + 'bulk_edit_allowed' => 'bulk_edit_allowed', + 'searchable_flag' => 'searchable_flag', + 'filtering_allowed' => 'filtering_allowed', + 'sortable_flag' => 'sortable_flag', + 'mandatory_flag' => 'mandatory_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'order_nr' => 'setOrderNr', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'last_updated_by_user_id' => 'setLastUpdatedByUserId', + 'active_flag' => 'setActiveFlag', + 'edit_flag' => 'setEditFlag', + 'add_visible_flag' => 'setAddVisibleFlag', + 'important_flag' => 'setImportantFlag', + 'bulk_edit_allowed' => 'setBulkEditAllowed', + 'searchable_flag' => 'setSearchableFlag', + 'filtering_allowed' => 'setFilteringAllowed', + 'sortable_flag' => 'setSortableFlag', + 'mandatory_flag' => 'setMandatoryFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'order_nr' => 'getOrderNr', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'last_updated_by_user_id' => 'getLastUpdatedByUserId', + 'active_flag' => 'getActiveFlag', + 'edit_flag' => 'getEditFlag', + 'add_visible_flag' => 'getAddVisibleFlag', + 'important_flag' => 'getImportantFlag', + 'bulk_edit_allowed' => 'getBulkEditAllowed', + 'searchable_flag' => 'getSearchableFlag', + 'filtering_allowed' => 'getFilteringAllowed', + 'sortable_flag' => 'getSortableFlag', + 'mandatory_flag' => 'getMandatoryFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['key'] = $data['key'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['last_updated_by_user_id'] = $data['last_updated_by_user_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['edit_flag'] = $data['edit_flag'] ?? null; + $this->container['add_visible_flag'] = $data['add_visible_flag'] ?? null; + $this->container['important_flag'] = $data['important_flag'] ?? null; + $this->container['bulk_edit_allowed'] = $data['bulk_edit_allowed'] ?? null; + $this->container['searchable_flag'] = $data['searchable_flag'] ?? null; + $this->container['filtering_allowed'] = $data['filtering_allowed'] ?? null; + $this->container['sortable_flag'] = $data['sortable_flag'] ?? null; + $this->container['mandatory_flag'] = $data['mandatory_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the product field + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key of the product field + * + * @return self + */ + public function setKey($key): self + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr The position (index) of the product field in the detail view + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The product field creation time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The product field last update time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets last_updated_by_user_id + * + * @return int|null + */ + public function getLastUpdatedByUserId() + { + return $this->container['last_updated_by_user_id']; + } + + /** + * Sets last_updated_by_user_id + * + * @param int|null $last_updated_by_user_id The ID of the last user to update the product field + * + * @return self + */ + public function setLastUpdatedByUserId($last_updated_by_user_id): self + { + $this->container['last_updated_by_user_id'] = $last_updated_by_user_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether or not the product field is currently active + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets edit_flag + * + * @return bool|null + */ + public function getEditFlag() + { + return $this->container['edit_flag']; + } + + /** + * Sets edit_flag + * + * @param bool|null $edit_flag Whether or not the product field name and metadata is editable + * + * @return self + */ + public function setEditFlag($edit_flag): self + { + $this->container['edit_flag'] = $edit_flag; + + return $this; + } + + /** + * Gets add_visible_flag + * + * @return bool|null + */ + public function getAddVisibleFlag() + { + return $this->container['add_visible_flag']; + } + + /** + * Sets add_visible_flag + * + * @param bool|null $add_visible_flag Whether or not the product field is visible in the Add Product Modal + * + * @return self + */ + public function setAddVisibleFlag($add_visible_flag): self + { + $this->container['add_visible_flag'] = $add_visible_flag; + + return $this; + } + + /** + * Gets important_flag + * + * @return bool|null + */ + public function getImportantFlag() + { + return $this->container['important_flag']; + } + + /** + * Sets important_flag + * + * @param bool|null $important_flag Whether or not the product field is marked as important + * + * @return self + */ + public function setImportantFlag($important_flag): self + { + $this->container['important_flag'] = $important_flag; + + return $this; + } + + /** + * Gets bulk_edit_allowed + * + * @return bool|null + */ + public function getBulkEditAllowed() + { + return $this->container['bulk_edit_allowed']; + } + + /** + * Sets bulk_edit_allowed + * + * @param bool|null $bulk_edit_allowed Whether or not the product field data can be edited + * + * @return self + */ + public function setBulkEditAllowed($bulk_edit_allowed): self + { + $this->container['bulk_edit_allowed'] = $bulk_edit_allowed; + + return $this; + } + + /** + * Gets searchable_flag + * + * @return bool|null + */ + public function getSearchableFlag() + { + return $this->container['searchable_flag']; + } + + /** + * Sets searchable_flag + * + * @param bool|null $searchable_flag Whether or not the product field is searchable + * + * @return self + */ + public function setSearchableFlag($searchable_flag): self + { + $this->container['searchable_flag'] = $searchable_flag; + + return $this; + } + + /** + * Gets filtering_allowed + * + * @return bool|null + */ + public function getFilteringAllowed() + { + return $this->container['filtering_allowed']; + } + + /** + * Sets filtering_allowed + * + * @param bool|null $filtering_allowed Whether or not the product field value can be used when filtering searches + * + * @return self + */ + public function setFilteringAllowed($filtering_allowed): self + { + $this->container['filtering_allowed'] = $filtering_allowed; + + return $this; + } + + /** + * Gets sortable_flag + * + * @return bool|null + */ + public function getSortableFlag() + { + return $this->container['sortable_flag']; + } + + /** + * Sets sortable_flag + * + * @param bool|null $sortable_flag Whether or not the product field is sortable + * + * @return self + */ + public function setSortableFlag($sortable_flag): self + { + $this->container['sortable_flag'] = $sortable_flag; + + return $this; + } + + /** + * Gets mandatory_flag + * + * @return bool|null + */ + public function getMandatoryFlag() + { + return $this->container['mandatory_flag']; + } + + /** + * Sets mandatory_flag + * + * @param bool|null $mandatory_flag Whether or not the product field is mandatory when creating products + * + * @return self + */ + public function setMandatoryFlag($mandatory_flag): self + { + $this->container['mandatory_flag'] = $mandatory_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductFileItem.php b/lib/Model/ProductFileItem.php new file mode 100644 index 00000000..70f33736 --- /dev/null +++ b/lib/Model/ProductFileItem.php @@ -0,0 +1,763 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductFileItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductFileItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'product_id' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'file_name' => 'string', + 'file_size' => 'int', + 'active_flag' => 'bool', + 'inline_flag' => 'bool', + 'remote_location' => 'string', + 'remote_id' => 'string', + 's3_bucket' => 'string', + 'product_name' => 'string', + 'url' => 'string', + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'product_id' => null, + 'add_time' => null, + 'update_time' => null, + 'file_name' => null, + 'file_size' => null, + 'active_flag' => null, + 'inline_flag' => null, + 'remote_location' => null, + 'remote_id' => null, + 's3_bucket' => null, + 'product_name' => null, + 'url' => null, + 'name' => null, + 'description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'product_id' => 'product_id', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'file_name' => 'file_name', + 'file_size' => 'file_size', + 'active_flag' => 'active_flag', + 'inline_flag' => 'inline_flag', + 'remote_location' => 'remote_location', + 'remote_id' => 'remote_id', + 's3_bucket' => 's3_bucket', + 'product_name' => 'product_name', + 'url' => 'url', + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'product_id' => 'setProductId', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'file_name' => 'setFileName', + 'file_size' => 'setFileSize', + 'active_flag' => 'setActiveFlag', + 'inline_flag' => 'setInlineFlag', + 'remote_location' => 'setRemoteLocation', + 'remote_id' => 'setRemoteId', + 's3_bucket' => 'setS3Bucket', + 'product_name' => 'setProductName', + 'url' => 'setUrl', + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'product_id' => 'getProductId', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'file_name' => 'getFileName', + 'file_size' => 'getFileSize', + 'active_flag' => 'getActiveFlag', + 'inline_flag' => 'getInlineFlag', + 'remote_location' => 'getRemoteLocation', + 'remote_id' => 'getRemoteId', + 's3_bucket' => 'getS3Bucket', + 'product_name' => 'getProductName', + 'url' => 'getUrl', + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['file_name'] = $data['file_name'] ?? null; + $this->container['file_size'] = $data['file_size'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['inline_flag'] = $data['inline_flag'] ?? null; + $this->container['remote_location'] = $data['remote_location'] ?? null; + $this->container['remote_id'] = $data['remote_id'] ?? null; + $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; + $this->container['product_name'] = $data['product_name'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the file + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product associated with the file + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The UTC date time when the file was uploaded. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The UTC date time when the file was last updated. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets file_name + * + * @return string|null + */ + public function getFileName() + { + return $this->container['file_name']; + } + + /** + * Sets file_name + * + * @param string|null $file_name The original name of the file + * + * @return self + */ + public function setFileName($file_name): self + { + $this->container['file_name'] = $file_name; + + return $this; + } + + /** + * Gets file_size + * + * @return int|null + */ + public function getFileSize() + { + return $this->container['file_size']; + } + + /** + * Sets file_size + * + * @param int|null $file_size The size of the file in bytes + * + * @return self + */ + public function setFileSize($file_size): self + { + $this->container['file_size'] = $file_size; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not. + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets inline_flag + * + * @return bool|null + */ + public function getInlineFlag() + { + return $this->container['inline_flag']; + } + + /** + * Sets inline_flag + * + * @param bool|null $inline_flag Whether the file was uploaded as inline or not + * + * @return self + */ + public function setInlineFlag($inline_flag): self + { + $this->container['inline_flag'] = $inline_flag; + + return $this; + } + + /** + * Gets remote_location + * + * @return string|null + */ + public function getRemoteLocation() + { + return $this->container['remote_location']; + } + + /** + * Sets remote_location + * + * @param string|null $remote_location The location type to send the file to. Only googledrive is supported at the moment. + * + * @return self + */ + public function setRemoteLocation($remote_location): self + { + $this->container['remote_location'] = $remote_location; + + return $this; + } + + /** + * Gets remote_id + * + * @return string|null + */ + public function getRemoteId() + { + return $this->container['remote_id']; + } + + /** + * Sets remote_id + * + * @param string|null $remote_id The ID of the remote item + * + * @return self + */ + public function setRemoteId($remote_id): self + { + $this->container['remote_id'] = $remote_id; + + return $this; + } + + /** + * Gets s3_bucket + * + * @return string|null + */ + public function getS3Bucket() + { + return $this->container['s3_bucket']; + } + + /** + * Sets s3_bucket + * + * @param string|null $s3_bucket The location of the cloud storage + * + * @return self + */ + public function setS3Bucket($s3_bucket): self + { + $this->container['s3_bucket'] = $s3_bucket; + + return $this; + } + + /** + * Gets product_name + * + * @return string|null + */ + public function getProductName() + { + return $this->container['product_name']; + } + + /** + * Sets product_name + * + * @param string|null $product_name The name of the product associated with the file + * + * @return self + */ + public function setProductName($product_name): self + { + $this->container['product_name'] = $product_name; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The URL to download the file + * + * @return self + */ + public function setUrl($url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The visible name of the file + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the file + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductListItem.php b/lib/Model/ProductListItem.php new file mode 100644 index 00000000..791f4531 --- /dev/null +++ b/lib/Model/ProductListItem.php @@ -0,0 +1,1002 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductListItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductListItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'deal_id' => 'int', + 'order_nr' => 'int', + 'product_id' => 'int', + 'product_variation_id' => 'int', + 'item_price' => 'int', + 'discount_percentage' => 'int', + 'duration' => 'int', + 'duration_unit' => 'string', + 'sum_no_discount' => 'float', + 'sum' => 'float', + 'currency' => 'string', + 'enabled_flag' => 'bool', + 'add_time' => 'string', + 'last_edit' => 'string', + 'comments' => 'string', + 'active_flag' => 'bool', + 'tax' => 'float', + 'name' => 'string', + 'sum_formatted' => 'string', + 'quantity_formatted' => 'string', + 'quantity' => 'int', + 'product' => '\Pipedrive\Model\ProductWithObjectPrices' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'deal_id' => null, + 'order_nr' => null, + 'product_id' => null, + 'product_variation_id' => null, + 'item_price' => null, + 'discount_percentage' => null, + 'duration' => null, + 'duration_unit' => null, + 'sum_no_discount' => null, + 'sum' => null, + 'currency' => null, + 'enabled_flag' => null, + 'add_time' => null, + 'last_edit' => null, + 'comments' => null, + 'active_flag' => null, + 'tax' => null, + 'name' => null, + 'sum_formatted' => null, + 'quantity_formatted' => null, + 'quantity' => null, + 'product' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'deal_id' => 'deal_id', + 'order_nr' => 'order_nr', + 'product_id' => 'product_id', + 'product_variation_id' => 'product_variation_id', + 'item_price' => 'item_price', + 'discount_percentage' => 'discount_percentage', + 'duration' => 'duration', + 'duration_unit' => 'duration_unit', + 'sum_no_discount' => 'sum_no_discount', + 'sum' => 'sum', + 'currency' => 'currency', + 'enabled_flag' => 'enabled_flag', + 'add_time' => 'add_time', + 'last_edit' => 'last_edit', + 'comments' => 'comments', + 'active_flag' => 'active_flag', + 'tax' => 'tax', + 'name' => 'name', + 'sum_formatted' => 'sum_formatted', + 'quantity_formatted' => 'quantity_formatted', + 'quantity' => 'quantity', + 'product' => 'product' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'deal_id' => 'setDealId', + 'order_nr' => 'setOrderNr', + 'product_id' => 'setProductId', + 'product_variation_id' => 'setProductVariationId', + 'item_price' => 'setItemPrice', + 'discount_percentage' => 'setDiscountPercentage', + 'duration' => 'setDuration', + 'duration_unit' => 'setDurationUnit', + 'sum_no_discount' => 'setSumNoDiscount', + 'sum' => 'setSum', + 'currency' => 'setCurrency', + 'enabled_flag' => 'setEnabledFlag', + 'add_time' => 'setAddTime', + 'last_edit' => 'setLastEdit', + 'comments' => 'setComments', + 'active_flag' => 'setActiveFlag', + 'tax' => 'setTax', + 'name' => 'setName', + 'sum_formatted' => 'setSumFormatted', + 'quantity_formatted' => 'setQuantityFormatted', + 'quantity' => 'setQuantity', + 'product' => 'setProduct' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'deal_id' => 'getDealId', + 'order_nr' => 'getOrderNr', + 'product_id' => 'getProductId', + 'product_variation_id' => 'getProductVariationId', + 'item_price' => 'getItemPrice', + 'discount_percentage' => 'getDiscountPercentage', + 'duration' => 'getDuration', + 'duration_unit' => 'getDurationUnit', + 'sum_no_discount' => 'getSumNoDiscount', + 'sum' => 'getSum', + 'currency' => 'getCurrency', + 'enabled_flag' => 'getEnabledFlag', + 'add_time' => 'getAddTime', + 'last_edit' => 'getLastEdit', + 'comments' => 'getComments', + 'active_flag' => 'getActiveFlag', + 'tax' => 'getTax', + 'name' => 'getName', + 'sum_formatted' => 'getSumFormatted', + 'quantity_formatted' => 'getQuantityFormatted', + 'quantity' => 'getQuantity', + 'product' => 'getProduct' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['product_variation_id'] = $data['product_variation_id'] ?? null; + $this->container['item_price'] = $data['item_price'] ?? null; + $this->container['discount_percentage'] = $data['discount_percentage'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['sum_no_discount'] = $data['sum_no_discount'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['enabled_flag'] = $data['enabled_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['last_edit'] = $data['last_edit'] ?? null; + $this->container['comments'] = $data['comments'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['tax'] = $data['tax'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['sum_formatted'] = $data['sum_formatted'] ?? null; + $this->container['quantity_formatted'] = $data['quantity_formatted'] ?? null; + $this->container['quantity'] = $data['quantity'] ?? null; + $this->container['product'] = $data['product'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal-product (the ID of the product attached to the deal) + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr The order number of the product + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id The ID of the product + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets product_variation_id + * + * @return int|null + */ + public function getProductVariationId() + { + return $this->container['product_variation_id']; + } + + /** + * Sets product_variation_id + * + * @param int|null $product_variation_id The ID of the product variation + * + * @return self + */ + public function setProductVariationId($product_variation_id): self + { + $this->container['product_variation_id'] = $product_variation_id; + + return $this; + } + + /** + * Gets item_price + * + * @return int|null + */ + public function getItemPrice() + { + return $this->container['item_price']; + } + + /** + * Sets item_price + * + * @param int|null $item_price The price value of the product + * + * @return self + */ + public function setItemPrice($item_price): self + { + $this->container['item_price'] = $item_price; + + return $this; + } + + /** + * Gets discount_percentage + * + * @return int|null + */ + public function getDiscountPercentage() + { + return $this->container['discount_percentage']; + } + + /** + * Sets discount_percentage + * + * @param int|null $discount_percentage The discount percentage of the product + * + * @return self + */ + public function setDiscountPercentage($discount_percentage): self + { + $this->container['discount_percentage'] = $discount_percentage; + + return $this; + } + + /** + * Gets duration + * + * @return int|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param int|null $duration The duration of the product + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets duration_unit + * + * @return string|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param string|null $duration_unit The type of the duration. (For example hourly, daily, etc.) + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets sum_no_discount + * + * @return float|null + */ + public function getSumNoDiscount() + { + return $this->container['sum_no_discount']; + } + + /** + * Sets sum_no_discount + * + * @param float|null $sum_no_discount The product sum without the discount + * + * @return self + */ + public function setSumNoDiscount($sum_no_discount): self + { + $this->container['sum_no_discount'] = $sum_no_discount; + + return $this; + } + + /** + * Gets sum + * + * @return float|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param float|null $sum The sum of all the products attached to the deal + * + * @return self + */ + public function setSum($sum): self + { + $this->container['sum'] = $sum; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency associated with the deal product + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets enabled_flag + * + * @return bool|null + */ + public function getEnabledFlag() + { + return $this->container['enabled_flag']; + } + + /** + * Sets enabled_flag + * + * @param bool|null $enabled_flag Whether the product is enabled or not + * + * @return self + */ + public function setEnabledFlag($enabled_flag): self + { + $this->container['enabled_flag'] = $enabled_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the product was added to the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets last_edit + * + * @return string|null + */ + public function getLastEdit() + { + return $this->container['last_edit']; + } + + /** + * Sets last_edit + * + * @param string|null $last_edit The date and time when the deal product was last edited + * + * @return self + */ + public function setLastEdit($last_edit): self + { + $this->container['last_edit'] = $last_edit; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments The comments of the product + * + * @return self + */ + public function setComments($comments): self + { + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The product tax + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The product name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sum_formatted + * + * @return string|null + */ + public function getSumFormatted() + { + return $this->container['sum_formatted']; + } + + /** + * Sets sum_formatted + * + * @param string|null $sum_formatted The formatted sum of the product + * + * @return self + */ + public function setSumFormatted($sum_formatted): self + { + $this->container['sum_formatted'] = $sum_formatted; + + return $this; + } + + /** + * Gets quantity_formatted + * + * @return string|null + */ + public function getQuantityFormatted() + { + return $this->container['quantity_formatted']; + } + + /** + * Sets quantity_formatted + * + * @param string|null $quantity_formatted The formatted quantity of the product + * + * @return self + */ + public function setQuantityFormatted($quantity_formatted): self + { + $this->container['quantity_formatted'] = $quantity_formatted; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity The quantity of the product + * + * @return self + */ + public function setQuantity($quantity): self + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets product + * + * @return \Pipedrive\Model\ProductWithObjectPrices|null + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \Pipedrive\Model\ProductWithObjectPrices|null $product product + * + * @return self + */ + public function setProduct($product): self + { + $this->container['product'] = $product; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductRequest.php b/lib/Model/ProductRequest.php new file mode 100644 index 00000000..70c6dec7 --- /dev/null +++ b/lib/Model/ProductRequest.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'code' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'int', + 'prices' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'unit' => null, + 'tax' => null, + 'active_flag' => null, + 'selectable' => null, + 'visible_to' => null, + 'owner_id' => null, + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'unit' => 'unit', + 'tax' => 'tax', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = $data['code'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product will be made active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product can be selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets prices + * + * @return object[]|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object[]|null $prices An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductResponse.php b/lib/Model/ProductResponse.php new file mode 100644 index 00000000..dc48955f --- /dev/null +++ b/lib/Model/ProductResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ProductWithArrayPrices', + 'related_objects' => '\Pipedrive\Model\GetActivitiesResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductWithArrayPrices|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductWithArrayPrices|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductSearchItem.php b/lib/Model/ProductSearchItem.php new file mode 100644 index 00000000..2cd5fe32 --- /dev/null +++ b/lib/Model/ProductSearchItem.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductSearchItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductSearchItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'result_score' => 'float', + 'item' => '\Pipedrive\Model\ProductSearchItemItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'result_score' => null, + 'item' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'result_score' => 'result_score', + 'item' => 'item' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'result_score' => 'setResultScore', + 'item' => 'setItem' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'result_score' => 'getResultScore', + 'item' => 'getItem' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['result_score'] = $data['result_score'] ?? null; + $this->container['item'] = $data['item'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_score + * + * @return float|null + */ + public function getResultScore() + { + return $this->container['result_score']; + } + + /** + * Sets result_score + * + * @param float|null $result_score Search result relevancy + * + * @return self + */ + public function setResultScore($result_score): self + { + $this->container['result_score'] = $result_score; + + return $this; + } + + /** + * Gets item + * + * @return \Pipedrive\Model\ProductSearchItemItem|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param \Pipedrive\Model\ProductSearchItemItem|null $item item + * + * @return self + */ + public function setItem($item): self + { + $this->container['item'] = $item; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductSearchItemItem.php b/lib/Model/ProductSearchItemItem.php new file mode 100644 index 00000000..bf86c9bf --- /dev/null +++ b/lib/Model/ProductSearchItemItem.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductSearchItemItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductSearchItem_item'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'name' => 'string', + 'code' => 'int', + 'visible_to' => 'int', + 'owner' => '\Pipedrive\Model\ProductSearchItemItemOwner', + 'custom_fields' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'name' => null, + 'code' => null, + 'visible_to' => null, + 'owner' => null, + 'custom_fields' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'name' => 'name', + 'code' => 'code', + 'visible_to' => 'visible_to', + 'owner' => 'owner', + 'custom_fields' => 'custom_fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'name' => 'setName', + 'code' => 'setCode', + 'visible_to' => 'setVisibleTo', + 'owner' => 'setOwner', + 'custom_fields' => 'setCustomFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'name' => 'getName', + 'code' => 'getCode', + 'visible_to' => 'getVisibleTo', + 'owner' => 'getOwner', + 'custom_fields' => 'getCustomFields' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner'] = $data['owner'] ?? null; + $this->container['custom_fields'] = $data['custom_fields'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the item + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return int|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int|null $code The code of the product + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the product + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner + * + * @return \Pipedrive\Model\ProductSearchItemItemOwner|null + */ + public function getOwner() + { + return $this->container['owner']; + } + + /** + * Sets owner + * + * @param \Pipedrive\Model\ProductSearchItemItemOwner|null $owner owner + * + * @return self + */ + public function setOwner($owner): self + { + $this->container['owner'] = $owner; + + return $this; + } + + /** + * Gets custom_fields + * + * @return string[]|null + */ + public function getCustomFields() + { + return $this->container['custom_fields']; + } + + /** + * Sets custom_fields + * + * @param string[]|null $custom_fields The custom fields + * + * @return self + */ + public function setCustomFields($custom_fields): self + { + $this->container['custom_fields'] = $custom_fields; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductSearchItemItemOwner.php b/lib/Model/ProductSearchItemItemOwner.php new file mode 100644 index 00000000..646f6338 --- /dev/null +++ b/lib/Model/ProductSearchItemItemOwner.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductSearchItemItemOwner implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductSearchItem_item_owner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the owner of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductSearchResponse.php b/lib/Model/ProductSearchResponse.php new file mode 100644 index 00000000..1564679e --- /dev/null +++ b/lib/Model/ProductSearchResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductSearchResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ProductSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductSearchResponseAllOf.php b/lib/Model/ProductSearchResponseAllOf.php new file mode 100644 index 00000000..1c75ac2a --- /dev/null +++ b/lib/Model/ProductSearchResponseAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductSearchResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductSearchResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\ProductSearchResponseAllOfData', + 'additional_data' => '\Pipedrive\Model\ItemSearchAdditionalData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'additional_data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'additional_data' => 'additional_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'additional_data' => 'setAdditionalData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'additional_data' => 'getAdditionalData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductSearchResponseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductSearchResponseAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\ItemSearchAdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\ItemSearchAdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductSearchResponseAllOfData.php b/lib/Model/ProductSearchResponseAllOfData.php new file mode 100644 index 00000000..2e2fc92b --- /dev/null +++ b/lib/Model/ProductSearchResponseAllOfData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductSearchResponseAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductSearchResponse_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'items' => '\Pipedrive\Model\ProductSearchItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \Pipedrive\Model\ProductSearchItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Pipedrive\Model\ProductSearchItem[]|null $items The array of found items + * + * @return self + */ + public function setItems($items): self + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductWithArrayPrices.php b/lib/Model/ProductWithArrayPrices.php new file mode 100644 index 00000000..09ff2961 --- /dev/null +++ b/lib/Model/ProductWithArrayPrices.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductWithArrayPrices implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductWithArrayPrices'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'float', + 'name' => 'string', + 'code' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'object', + 'prices' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'code' => null, + 'unit' => null, + 'tax' => null, + 'active_flag' => null, + 'selectable' => null, + 'visible_to' => null, + 'owner_id' => null, + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'code' => 'code', + 'unit' => 'unit', + 'tax' => 'tax', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'code' => 'setCode', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'code' => 'getCode', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 float|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param float|null $id The ID of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The ax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product is selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to Visibility of the product + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return object|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param object|null $owner_id Information about the Pipedrive user who owns the product + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets prices + * + * @return object[]|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object[]|null $prices Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductWithObjectPrices.php b/lib/Model/ProductWithObjectPrices.php new file mode 100644 index 00000000..ba238ca0 --- /dev/null +++ b/lib/Model/ProductWithObjectPrices.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductWithObjectPrices implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductWithObjectPrices'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'float', + 'name' => 'string', + 'code' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'object', + 'prices' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'code' => null, + 'unit' => null, + 'tax' => null, + 'active_flag' => null, + 'selectable' => null, + 'visible_to' => null, + 'owner_id' => null, + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'code' => 'code', + 'unit' => 'unit', + 'tax' => 'tax', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'code' => 'setCode', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'code' => 'getCode', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 float|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param float|null $id The ID of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The ax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product is selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to Visibility of the product + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return object|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param object|null $owner_id Information about the Pipedrive user who owns the product + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets prices + * + * @return object|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object|null $prices Object of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional) + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ProductsResponse.php b/lib/Model/ProductsResponse.php new file mode 100644 index 00000000..9ed93ece --- /dev/null +++ b/lib/Model/ProductsResponse.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ProductsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ProductsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ProductResponse[]', + 'additional_data' => '\Pipedrive\Model\AdditionalData', + 'related_objects' => '\Pipedrive\Model\GetActivitiesResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'additional_data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'additional_data' => 'additional_data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'additional_data' => 'setAdditionalData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'additional_data' => 'getAdditionalData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['additional_data'] = $data['additional_data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductResponse[]|null $data Array containing data for all products + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets additional_data + * + * @return \Pipedrive\Model\AdditionalData|null + */ + public function getAdditionalData() + { + return $this->container['additional_data']; + } + + /** + * Sets additional_data + * + * @param \Pipedrive\Model\AdditionalData|null $additional_data additional_data + * + * @return self + */ + public function setAdditionalData($additional_data): self + { + $this->container['additional_data'] = $additional_data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PutRole.php b/lib/Model/PutRole.php new file mode 100644 index 00000000..00b35767 --- /dev/null +++ b/lib/Model/PutRole.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PutRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PutRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PutRoleAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PutRoleAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PutRoleAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PutRoleAllOf.php b/lib/Model/PutRoleAllOf.php new file mode 100644 index 00000000..35a5082a --- /dev/null +++ b/lib/Model/PutRoleAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PutRoleAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PutRole_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\PutRoleAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\PutRoleAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PutRoleAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PutRoleAllOfData.php b/lib/Model/PutRoleAllOfData.php new file mode 100644 index 00000000..575db33c --- /dev/null +++ b/lib/Model/PutRoleAllOfData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PutRoleAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PutRole_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the updated role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/PutRolePipelinesBody.php b/lib/Model/PutRolePipelinesBody.php new file mode 100644 index 00000000..dd2287cb --- /dev/null +++ b/lib/Model/PutRolePipelinesBody.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PutRolePipelinesBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'PutRolePipelinesBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'visible_pipeline_ids' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'visible_pipeline_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'visible_pipeline_ids' => 'visible_pipeline_ids' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'visible_pipeline_ids' => 'setVisiblePipelineIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'visible_pipeline_ids' => 'getVisiblePipelineIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['visible_pipeline_ids'] = $data['visible_pipeline_ids'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['visible_pipeline_ids'] === null) { + $invalidProperties[] = "'visible_pipeline_ids' 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 visible_pipeline_ids + * + * @return object + */ + public function getVisiblePipelineIds() + { + return $this->container['visible_pipeline_ids']; + } + + /** + * Sets visible_pipeline_ids + * + * @param object $visible_pipeline_ids The pipeline IDs to make the pipelines visible (add) and/or hidden (remove) for the specified role. It requires the following JSON structure: `{ \"add\": \"[1]\", \"remove\": \"[3, 4]\" }`. + * + * @return self + */ + public function setVisiblePipelineIds($visible_pipeline_ids): self + { + $this->container['visible_pipeline_ids'] = $visible_pipeline_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentDataProduct.php b/lib/Model/RecentDataProduct.php new file mode 100644 index 00000000..27d222e9 --- /dev/null +++ b/lib/Model/RecentDataProduct.php @@ -0,0 +1,792 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentDataProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentDataProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'code' => 'string', + 'description' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'category' => 'string', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'first_char' => 'string', + 'visible_to' => 'int', + 'owner_id' => 'int', + 'files_count' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'prices' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'code' => null, + 'description' => null, + 'unit' => null, + 'tax' => null, + 'category' => null, + 'active_flag' => null, + 'selectable' => null, + 'first_char' => null, + 'visible_to' => null, + 'owner_id' => null, + 'files_count' => null, + 'add_time' => null, + 'update_time' => null, + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'code' => 'code', + 'description' => 'description', + 'unit' => 'unit', + 'tax' => 'tax', + 'category' => 'category', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'first_char' => 'first_char', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'files_count' => 'files_count', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'code' => 'setCode', + 'description' => 'setDescription', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'category' => 'setCategory', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'first_char' => 'setFirstChar', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'files_count' => 'setFilesCount', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'code' => 'getCode', + 'description' => 'getDescription', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'category' => 'getCategory', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'first_char' => 'getFirstChar', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'files_count' => 'getFilesCount', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['category'] = $data['category'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['selectable'] = $data['selectable'] ?? null; + $this->container['first_char'] = $data['first_char'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['files_count'] = $data['files_count'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the product + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the product + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The category of the product + * + * @return self + */ + public function setCategory($category): self + { + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product will be made active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product can be selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets first_char + * + * @return string|null + */ + public function getFirstChar() + { + return $this->container['first_char']; + } + + /** + * Sets first_char + * + * @param string|null $first_char The first letter of the product name + * + * @return self + */ + public function setFirstChar($first_char): self + { + $this->container['first_char'] = $first_char; + + return $this; + } + + /** + * Gets visible_to + * + * @return int|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param int|null $visible_to The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. + * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this product. When omitted, authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets files_count + * + * @return int|null + */ + public function getFilesCount() + { + return $this->container['files_count']; + } + + /** + * Sets files_count + * + * @param int|null $files_count The count of files + * + * @return self + */ + public function setFilesCount($files_count): self + { + $this->container['files_count'] = $files_count; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The date and time when the product was added to the deal + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The date and time when the product was updated to the deal + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets prices + * + * @return object[]|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object[]|null $prices Array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsActivity.php b/lib/Model/RecentsActivity.php new file mode 100644 index 00000000..cc411ec1 --- /dev/null +++ b/lib/Model/RecentsActivity.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsActivity implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsActivity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\ActivityResponseObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_ACTIVITY = 'activity'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_ACTIVITY, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsActivityType.php b/lib/Model/RecentsActivityType.php new file mode 100644 index 00000000..95bef392 --- /dev/null +++ b/lib/Model/RecentsActivityType.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsActivityType implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsActivityType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\ActivityTypeObjectResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_ACTIVITY_TYPE = 'activityType'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_ACTIVITY_TYPE, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityTypeObjectResponse|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityTypeObjectResponse|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsDeal.php b/lib/Model/RecentsDeal.php new file mode 100644 index 00000000..f8a20070 --- /dev/null +++ b/lib/Model/RecentsDeal.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsDeal implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsDeal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\DealStrict' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_DEAL = 'deal'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_DEAL, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\DealStrict|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\DealStrict|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsFile.php b/lib/Model/RecentsFile.php new file mode 100644 index 00000000..3f04d986 --- /dev/null +++ b/lib/Model/RecentsFile.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsFile implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\FileItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_FILE = 'file'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_FILE, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsFilter.php b/lib/Model/RecentsFilter.php new file mode 100644 index 00000000..6cf565f0 --- /dev/null +++ b/lib/Model/RecentsFilter.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsFilter implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsFilter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\FilterGetItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_FILTER = 'filter'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_FILTER, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FilterGetItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FilterGetItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsNote.php b/lib/Model/RecentsNote.php new file mode 100644 index 00000000..de6bba49 --- /dev/null +++ b/lib/Model/RecentsNote.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsNote implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsNote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\BaseNote' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_NOTE = 'note'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_NOTE, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseNote|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseNote|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsOrganization.php b/lib/Model/RecentsOrganization.php new file mode 100644 index 00000000..78956089 --- /dev/null +++ b/lib/Model/RecentsOrganization.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsOrganization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\BaseOrganizationItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_ORGANIZATION = 'organization'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_ORGANIZATION, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseOrganizationItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseOrganizationItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsPerson.php b/lib/Model/RecentsPerson.php new file mode 100644 index 00000000..21fe2165 --- /dev/null +++ b/lib/Model/RecentsPerson.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsPerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsPerson'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\MergePersonItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_PERSON = 'person'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_PERSON, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\MergePersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\MergePersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsPipeline.php b/lib/Model/RecentsPipeline.php new file mode 100644 index 00000000..bf152c72 --- /dev/null +++ b/lib/Model/RecentsPipeline.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsPipeline implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsPipeline'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\BasePipeline' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_PIPELINE = 'pipeline'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_PIPELINE, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BasePipeline|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BasePipeline|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsProduct.php b/lib/Model/RecentsProduct.php new file mode 100644 index 00000000..d89e1e16 --- /dev/null +++ b/lib/Model/RecentsProduct.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\RecentDataProduct' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_PRODUCT = 'product'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_PRODUCT, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\RecentDataProduct|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\RecentDataProduct|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsStage.php b/lib/Model/RecentsStage.php new file mode 100644 index 00000000..d1922272 --- /dev/null +++ b/lib/Model/RecentsStage.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsStage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsStage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\BaseStage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_STAGE = 'stage'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_STAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseStage|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseStage|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RecentsUser.php b/lib/Model/RecentsUser.php new file mode 100644 index 00000000..9a9b74ae --- /dev/null +++ b/lib/Model/RecentsUser.php @@ -0,0 +1,436 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecentsUser implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RecentsUser'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'item' => 'string', + 'id' => 'int', + 'data' => '\Pipedrive\Model\BaseUser' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'item' => null, + 'id' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item' => 'item', + 'id' => 'id', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item' => 'setItem', + 'id' => 'setId', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item' => 'getItem', + 'id' => 'getId', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const ITEM_USER = 'user'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getItemAllowableValues(): array + { + return [ + self::ITEM_USER, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item'] = $data['item'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($this->container['item']) && !in_array($this->container['item'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'item', must be one of '%s'", + $this->container['item'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item + * + * @return string|null + */ + public function getItem() + { + return $this->container['item']; + } + + /** + * Sets item + * + * @param string|null $item item + * + * @return self + */ + public function setItem($item): self + { + $allowedValues = $this->getItemAllowableValues(); + if (!is_null($item) && !in_array($item, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'item', must be one of '%s'", + $item, + implode("', '", $allowedValues) + ) + ); + } + $this->container['item'] = $item; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUser|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUser|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedDealData.php b/lib/Model/RelatedDealData.php new file mode 100644 index 00000000..692bdd45 --- /dev/null +++ b/lib/Model/RelatedDealData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedDealData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedDealData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal_id' => '\Pipedrive\Model\RelatedDealDataDEALID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal_id' => 'DEAL_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal_id' => 'setDealId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal_id' => 'getDealId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal_id'] = $data['deal_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deal_id + * + * @return \Pipedrive\Model\RelatedDealDataDEALID|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param \Pipedrive\Model\RelatedDealDataDEALID|null $deal_id deal_id + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedDealDataDEALID.php b/lib/Model/RelatedDealDataDEALID.php new file mode 100644 index 00000000..cf94d49c --- /dev/null +++ b/lib/Model/RelatedDealDataDEALID.php @@ -0,0 +1,523 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedDealDataDEALID implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedDealData_DEAL_ID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'title' => 'string', + 'status' => 'string', + 'value' => 'float', + 'currency' => 'string', + 'stage_id' => 'int', + 'pipeline_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'title' => null, + 'status' => null, + 'value' => null, + 'currency' => null, + 'stage_id' => null, + 'pipeline_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'title' => 'title', + 'status' => 'status', + 'value' => 'value', + 'currency' => 'currency', + 'stage_id' => 'stage_id', + 'pipeline_id' => 'pipeline_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'title' => 'setTitle', + 'status' => 'setStatus', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'stage_id' => 'setStageId', + 'pipeline_id' => 'setPipelineId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'title' => 'getTitle', + 'status' => 'getStatus', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'stage_id' => 'getStageId', + 'pipeline_id' => 'getPipelineId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the deal associated with the item + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal associated with the item + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the deal associated with the item + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value of the deal that is associated with the item + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the deal value + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the stage the deal is currently at + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline the deal is in + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedFollowerData.php b/lib/Model/RelatedFollowerData.php new file mode 100644 index 00000000..679b40c6 --- /dev/null +++ b/lib/Model/RelatedFollowerData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedFollowerData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedFollowerData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'follower_user_id' => 'FollowerDataWithID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'follower_user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'follower_user_id' => 'FOLLOWER_USER_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'follower_user_id' => 'setFollowerUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'follower_user_id' => 'getFollowerUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['follower_user_id'] = $data['follower_user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets follower_user_id + * + * @return FollowerDataWithID|null + */ + public function getFollowerUserId() + { + return $this->container['follower_user_id']; + } + + /** + * Sets follower_user_id + * + * @param FollowerDataWithID|null $follower_user_id The user ID of the follower + * + * @return self + */ + public function setFollowerUserId($follower_user_id): self + { + $this->container['follower_user_id'] = $follower_user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedOrganizationData.php b/lib/Model/RelatedOrganizationData.php new file mode 100644 index 00000000..4b385058 --- /dev/null +++ b/lib/Model/RelatedOrganizationData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedOrganizationData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedOrganizationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization_id' => '\Pipedrive\Model\OrganizationDataWithId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization_id' => 'ORGANIZATION_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization_id' => 'setOrganizationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization_id' => 'getOrganizationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization_id'] = $data['organization_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization_id + * + * @return \Pipedrive\Model\OrganizationDataWithId|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param \Pipedrive\Model\OrganizationDataWithId|null $organization_id organization_id + * + * @return self + */ + public function setOrganizationId($organization_id): self + { + $this->container['organization_id'] = $organization_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedOrganizationDataWithActiveFlag.php b/lib/Model/RelatedOrganizationDataWithActiveFlag.php new file mode 100644 index 00000000..e3957f62 --- /dev/null +++ b/lib/Model/RelatedOrganizationDataWithActiveFlag.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedOrganizationDataWithActiveFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedOrganizationDataWithActiveFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'organization_id' => '\Pipedrive\Model\OrganizationDataWithIdAndActiveFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'organization_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'organization_id' => 'ORGANIZATION_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'organization_id' => 'setOrganizationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'organization_id' => 'getOrganizationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['organization_id'] = $data['organization_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets organization_id + * + * @return \Pipedrive\Model\OrganizationDataWithIdAndActiveFlag|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param \Pipedrive\Model\OrganizationDataWithIdAndActiveFlag|null $organization_id organization_id + * + * @return self + */ + public function setOrganizationId($organization_id): self + { + $this->container['organization_id'] = $organization_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedOrganizationName.php b/lib/Model/RelatedOrganizationName.php new file mode 100644 index 00000000..10240605 --- /dev/null +++ b/lib/Model/RelatedOrganizationName.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedOrganizationName implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedOrganizationName'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'related_organization_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'related_organization_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'related_organization_name' => 'related_organization_name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'related_organization_name' => 'setRelatedOrganizationName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'related_organization_name' => 'getRelatedOrganizationName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['related_organization_name'] = $data['related_organization_name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets related_organization_name + * + * @return string|null + */ + public function getRelatedOrganizationName() + { + return $this->container['related_organization_name']; + } + + /** + * Sets related_organization_name + * + * @param string|null $related_organization_name The name of the linked organization + * + * @return self + */ + public function setRelatedOrganizationName($related_organization_name): self + { + $this->container['related_organization_name'] = $related_organization_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedPersonData.php b/lib/Model/RelatedPersonData.php new file mode 100644 index 00000000..40c99a3d --- /dev/null +++ b/lib/Model/RelatedPersonData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedPersonData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedPersonData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'person_id' => 'PersonData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'person_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'person_id' => 'PERSON_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'person_id' => 'setPersonId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'person_id' => 'getPersonId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['person_id'] = $data['person_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets person_id + * + * @return PersonData|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param PersonData|null $person_id The ID of the person associated with the item + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedPersonDataWithActiveFlag.php b/lib/Model/RelatedPersonDataWithActiveFlag.php new file mode 100644 index 00000000..a610eab7 --- /dev/null +++ b/lib/Model/RelatedPersonDataWithActiveFlag.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedPersonDataWithActiveFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedPersonDataWithActiveFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'person_id' => '\Pipedrive\Model\PersonDataWithActiveFlag' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'person_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'person_id' => 'PERSON_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'person_id' => 'setPersonId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'person_id' => 'getPersonId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['person_id'] = $data['person_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets person_id + * + * @return \Pipedrive\Model\PersonDataWithActiveFlag|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param \Pipedrive\Model\PersonDataWithActiveFlag|null $person_id person_id + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedPictureData.php b/lib/Model/RelatedPictureData.php new file mode 100644 index 00000000..07b48d51 --- /dev/null +++ b/lib/Model/RelatedPictureData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedPictureData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedPictureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'picture_id' => 'PictureDataWithID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'picture_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'picture_id' => 'PICTURE_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'picture_id' => 'setPictureId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'picture_id' => 'getPictureId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['picture_id'] = $data['picture_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets picture_id + * + * @return PictureDataWithID|null + */ + public function getPictureId() + { + return $this->container['picture_id']; + } + + /** + * Sets picture_id + * + * @param PictureDataWithID|null $picture_id The ID of the picture + * + * @return self + */ + public function setPictureId($picture_id): self + { + $this->container['picture_id'] = $picture_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelatedUserData.php b/lib/Model/RelatedUserData.php new file mode 100644 index 00000000..0b317758 --- /dev/null +++ b/lib/Model/RelatedUserData.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelatedUserData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelatedUserData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => '\Pipedrive\Model\UserDataWithId' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'USER_ID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return \Pipedrive\Model\UserDataWithId|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param \Pipedrive\Model\UserDataWithId|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelationshipOrganizationInfoItem.php b/lib/Model/RelationshipOrganizationInfoItem.php new file mode 100644 index 00000000..4babd450 --- /dev/null +++ b/lib/Model/RelationshipOrganizationInfoItem.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipOrganizationInfoItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelationshipOrganizationInfoItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'cc_email' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'cc_email' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'cc_email' => 'cc_email', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'cc_email' => 'setCcEmail', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'cc_email' => 'getCcEmail', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the item + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the item + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the organization + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelationshipOrganizationInfoItemAllOf.php b/lib/Model/RelationshipOrganizationInfoItemAllOf.php new file mode 100644 index 00000000..5f5302d9 --- /dev/null +++ b/lib/Model/RelationshipOrganizationInfoItemAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipOrganizationInfoItemAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelationshipOrganizationInfoItem_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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 int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the organization + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RelationshipOrganizationInfoItemWithActiveFlag.php b/lib/Model/RelationshipOrganizationInfoItemWithActiveFlag.php new file mode 100644 index 00000000..37c652c4 --- /dev/null +++ b/lib/Model/RelationshipOrganizationInfoItemWithActiveFlag.php @@ -0,0 +1,522 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RelationshipOrganizationInfoItemWithActiveFlag implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RelationshipOrganizationInfoItemWithActiveFlag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'people_count' => 'int', + 'owner_id' => 'int', + 'address' => 'string', + 'cc_email' => 'string', + 'value' => 'int', + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'people_count' => null, + 'owner_id' => null, + 'address' => null, + 'cc_email' => null, + 'value' => null, + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'people_count' => 'people_count', + 'owner_id' => 'owner_id', + 'address' => 'address', + 'cc_email' => 'cc_email', + 'value' => 'value', + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'people_count' => 'setPeopleCount', + 'owner_id' => 'setOwnerId', + 'address' => 'setAddress', + 'cc_email' => 'setCcEmail', + 'value' => 'setValue', + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'people_count' => 'getPeopleCount', + 'owner_id' => 'getOwnerId', + 'address' => 'getAddress', + 'cc_email' => 'getCcEmail', + 'value' => 'getValue', + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['people_count'] = $data['people_count'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['address'] = $data['address'] ?? null; + $this->container['cc_email'] = $data['cc_email'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization associated with the item + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets people_count + * + * @return int|null + */ + public function getPeopleCount() + { + return $this->container['people_count']; + } + + /** + * Sets people_count + * + * @param int|null $people_count The number of people connected with the organization that is associated with the item + * + * @return self + */ + public function setPeopleCount($people_count): self + { + $this->container['people_count'] = $people_count; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the owner of the organization that is associated with the item + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets address + * + * @return string|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string|null $address The address of the organization + * + * @return self + */ + public function setAddress($address): self + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets cc_email + * + * @return string|null + */ + public function getCcEmail() + { + return $this->container['cc_email']; + } + + /** + * Sets cc_email + * + * @param string|null $cc_email The BCC email of the organization associated with the item + * + * @return self + */ + public function setCcEmail($cc_email): self + { + $this->container['cc_email'] = $cc_email; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The ID of the organization + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the associated organization is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RequiredNameObject.php b/lib/Model/RequiredNameObject.php new file mode 100644 index 00000000..8d312c8e --- /dev/null +++ b/lib/Model/RequiredNameObject.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RequiredNameObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RequiredNameObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RequredTitleParameter.php b/lib/Model/RequredTitleParameter.php new file mode 100644 index 00000000..39722c18 --- /dev/null +++ b/lib/Model/RequredTitleParameter.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RequredTitleParameter implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RequredTitleParameter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' 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 title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ResponseCallLogObject.php b/lib/Model/ResponseCallLogObject.php new file mode 100644 index 00000000..b9ab66a9 --- /dev/null +++ b/lib/Model/ResponseCallLogObject.php @@ -0,0 +1,848 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ResponseCallLogObject implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ResponseCallLogObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'activity_id' => 'int', + 'subject' => 'string', + 'duration' => 'string', + 'outcome' => 'string', + 'from_phone_number' => 'string', + 'to_phone_number' => 'string', + 'start_time' => '\DateTime', + 'end_time' => '\DateTime', + 'person_id' => 'int', + 'org_id' => 'int', + 'deal_id' => 'int', + 'note' => 'string', + 'id' => 'string', + 'has_recording' => 'bool', + 'company_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'activity_id' => null, + 'subject' => null, + 'duration' => null, + 'outcome' => null, + 'from_phone_number' => null, + 'to_phone_number' => null, + 'start_time' => 'date-time', + 'end_time' => 'date-time', + 'person_id' => null, + 'org_id' => null, + 'deal_id' => null, + 'note' => null, + 'id' => null, + 'has_recording' => null, + 'company_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'activity_id' => 'activity_id', + 'subject' => 'subject', + 'duration' => 'duration', + 'outcome' => 'outcome', + 'from_phone_number' => 'from_phone_number', + 'to_phone_number' => 'to_phone_number', + 'start_time' => 'start_time', + 'end_time' => 'end_time', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'deal_id' => 'deal_id', + 'note' => 'note', + 'id' => 'id', + 'has_recording' => 'has_recording', + 'company_id' => 'company_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'activity_id' => 'setActivityId', + 'subject' => 'setSubject', + 'duration' => 'setDuration', + 'outcome' => 'setOutcome', + 'from_phone_number' => 'setFromPhoneNumber', + 'to_phone_number' => 'setToPhoneNumber', + 'start_time' => 'setStartTime', + 'end_time' => 'setEndTime', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'deal_id' => 'setDealId', + 'note' => 'setNote', + 'id' => 'setId', + 'has_recording' => 'setHasRecording', + 'company_id' => 'setCompanyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'activity_id' => 'getActivityId', + 'subject' => 'getSubject', + 'duration' => 'getDuration', + 'outcome' => 'getOutcome', + 'from_phone_number' => 'getFromPhoneNumber', + 'to_phone_number' => 'getToPhoneNumber', + 'start_time' => 'getStartTime', + 'end_time' => 'getEndTime', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'deal_id' => 'getDealId', + 'note' => 'getNote', + 'id' => 'getId', + 'has_recording' => 'getHasRecording', + 'company_id' => 'getCompanyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const OUTCOME_CONNECTED = 'connected'; + const OUTCOME_NO_ANSWER = 'no_answer'; + const OUTCOME_LEFT_MESSAGE = 'left_message'; + const OUTCOME_LEFT_VOICEMAIL = 'left_voicemail'; + const OUTCOME_WRONG_NUMBER = 'wrong_number'; + const OUTCOME_BUSY = 'busy'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getOutcomeAllowableValues(): array + { + return [ + self::OUTCOME_CONNECTED, + self::OUTCOME_NO_ANSWER, + self::OUTCOME_LEFT_MESSAGE, + self::OUTCOME_LEFT_VOICEMAIL, + self::OUTCOME_WRONG_NUMBER, + self::OUTCOME_BUSY, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['activity_id'] = $data['activity_id'] ?? null; + $this->container['subject'] = $data['subject'] ?? null; + $this->container['duration'] = $data['duration'] ?? null; + $this->container['outcome'] = $data['outcome'] ?? null; + $this->container['from_phone_number'] = $data['from_phone_number'] ?? null; + $this->container['to_phone_number'] = $data['to_phone_number'] ?? null; + $this->container['start_time'] = $data['start_time'] ?? null; + $this->container['end_time'] = $data['end_time'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['note'] = $data['note'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['has_recording'] = $data['has_recording'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['outcome'] === null) { + $invalidProperties[] = "'outcome' can't be null"; + } + $allowedValues = $this->getOutcomeAllowableValues(); + if (!is_null($this->container['outcome']) && !in_array($this->container['outcome'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'outcome', must be one of '%s'", + $this->container['outcome'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['to_phone_number'] === null) { + $invalidProperties[] = "'to_phone_number' can't be null"; + } + if ($this->container['start_time'] === null) { + $invalidProperties[] = "'start_time' can't be null"; + } + if ($this->container['end_time'] === null) { + $invalidProperties[] = "'end_time' 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 user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the owner of the call log. Please note that a user without account settings access cannot create call logs for other users. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets activity_id + * + * @return int|null + */ + public function getActivityId() + { + return $this->container['activity_id']; + } + + /** + * Sets activity_id + * + * @param int|null $activity_id If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify `deal_id`, `person_id` or `org_id`, as they will be ignored in favor of the values already available in the activity. The `activity_id` must refer to a `call` type activity. + * + * @return self + */ + public function setActivityId($activity_id): self + { + $this->container['activity_id'] = $activity_id; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject The name of the activity this call is attached to + * + * @return self + */ + public function setSubject($subject): self + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets duration + * + * @return string|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param string|null $duration The duration of the call in seconds + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets outcome + * + * @return string + */ + public function getOutcome() + { + return $this->container['outcome']; + } + + /** + * Sets outcome + * + * @param string $outcome Describes the outcome of the call + * + * @return self + */ + public function setOutcome($outcome): self + { + $allowedValues = $this->getOutcomeAllowableValues(); + if (!in_array($outcome, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'outcome', must be one of '%s'", + $outcome, + implode("', '", $allowedValues) + ) + ); + } + $this->container['outcome'] = $outcome; + + return $this; + } + + /** + * Gets from_phone_number + * + * @return string|null + */ + public function getFromPhoneNumber() + { + return $this->container['from_phone_number']; + } + + /** + * Sets from_phone_number + * + * @param string|null $from_phone_number The number that made the call + * + * @return self + */ + public function setFromPhoneNumber($from_phone_number): self + { + $this->container['from_phone_number'] = $from_phone_number; + + return $this; + } + + /** + * Gets to_phone_number + * + * @return string + */ + public function getToPhoneNumber() + { + return $this->container['to_phone_number']; + } + + /** + * Sets to_phone_number + * + * @param string $to_phone_number The number called + * + * @return self + */ + public function setToPhoneNumber($to_phone_number): self + { + $this->container['to_phone_number'] = $to_phone_number; + + return $this; + } + + /** + * Gets start_time + * + * @return \DateTime + */ + public function getStartTime() + { + return $this->container['start_time']; + } + + /** + * Sets start_time + * + * @param \DateTime $start_time The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setStartTime($start_time): self + { + $this->container['start_time'] = $start_time; + + return $this; + } + + /** + * Gets end_time + * + * @return \DateTime + */ + public function getEndTime() + { + return $this->container['end_time']; + } + + /** + * Sets end_time + * + * @param \DateTime $end_time The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setEndTime($end_time): self + { + $this->container['end_time'] = $end_time; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of the person this call is associated with + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this call is associated with + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this call is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets note + * + * @return string|null + */ + public function getNote() + { + return $this->container['note']; + } + + /** + * Sets note + * + * @param string|null $note The note for the call log in HTML format + * + * @return self + */ + public function setNote($note): self + { + $this->container['note'] = $note; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The call log ID, generated when the call log was created + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets has_recording + * + * @return bool|null + */ + public function getHasRecording() + { + return $this->container['has_recording']; + } + + /** + * Sets has_recording + * + * @param bool|null $has_recording If the call log has an audio recording attached, the value should be true + * + * @return self + */ + public function setHasRecording($has_recording): self + { + $this->container['has_recording'] = $has_recording; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The company ID of the owner of the call log + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/ResponseCallLogObjectAllOf.php b/lib/Model/ResponseCallLogObjectAllOf.php new file mode 100644 index 00000000..bea3c23b --- /dev/null +++ b/lib/Model/ResponseCallLogObjectAllOf.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ResponseCallLogObjectAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'ResponseCallLogObject_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'has_recording' => 'bool', + 'company_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'has_recording' => null, + 'company_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'has_recording' => 'has_recording', + 'company_id' => 'company_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'has_recording' => 'setHasRecording', + 'company_id' => 'setCompanyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'has_recording' => 'getHasRecording', + 'company_id' => 'getCompanyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['has_recording'] = $data['has_recording'] ?? null; + $this->container['company_id'] = $data['company_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The call log ID, generated when the call log was created + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets has_recording + * + * @return bool|null + */ + public function getHasRecording() + { + return $this->container['has_recording']; + } + + /** + * Sets has_recording + * + * @param bool|null $has_recording If the call log has an audio recording attached, the value should be true + * + * @return self + */ + public function setHasRecording($has_recording): self + { + $this->container['has_recording'] = $has_recording; + + return $this; + } + + /** + * Gets company_id + * + * @return int|null + */ + public function getCompanyId() + { + return $this->container['company_id']; + } + + /** + * Sets company_id + * + * @param int|null $company_id The company ID of the owner of the call log + * + * @return self + */ + public function setCompanyId($company_id): self + { + $this->container['company_id'] = $company_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RoleAssignment.php b/lib/Model/RoleAssignment.php new file mode 100644 index 00000000..2d119704 --- /dev/null +++ b/lib/Model/RoleAssignment.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RoleAssignment implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RoleAssignment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'parent_role_id' => 'int', + 'name' => 'string', + 'user_id' => 'int', + 'role_id' => 'int', + 'active_flag' => 'bool', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'parent_role_id' => null, + 'name' => null, + 'user_id' => null, + 'role_id' => null, + 'active_flag' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'parent_role_id' => 'parent_role_id', + 'name' => 'name', + 'user_id' => 'user_id', + 'role_id' => 'role_id', + 'active_flag' => 'active_flag', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'parent_role_id' => 'setParentRoleId', + 'name' => 'setName', + 'user_id' => 'setUserId', + 'role_id' => 'setRoleId', + 'active_flag' => 'setActiveFlag', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'parent_role_id' => 'getParentRoleId', + 'name' => 'getName', + 'user_id' => 'getUserId', + 'role_id' => 'getRoleId', + 'active_flag' => 'getActiveFlag', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['parent_role_id'] = $data['parent_role_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['role_id'] = $data['role_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['type'] = $data['type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets parent_role_id + * + * @return int|null + */ + public function getParentRoleId() + { + return $this->container['parent_role_id']; + } + + /** + * Sets parent_role_id + * + * @param int|null $parent_role_id The ID of the parent role + * + * @return self + */ + public function setParentRoleId($parent_role_id): self + { + $this->container['parent_role_id'] = $parent_role_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the role + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets role_id + * + * @return int|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param int|null $role_id The role ID + * + * @return self + */ + public function setRoleId($role_id): self + { + $this->container['role_id'] = $role_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the role is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The assignment type + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RoleAssignmentAllOf.php b/lib/Model/RoleAssignmentAllOf.php new file mode 100644 index 00000000..58670989 --- /dev/null +++ b/lib/Model/RoleAssignmentAllOf.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RoleAssignmentAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RoleAssignment_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'role_id' => 'int', + 'active_flag' => 'bool', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'role_id' => null, + 'active_flag' => null, + 'type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'role_id' => 'role_id', + 'active_flag' => 'active_flag', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'role_id' => 'setRoleId', + 'active_flag' => 'setActiveFlag', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'role_id' => 'getRoleId', + 'active_flag' => 'getActiveFlag', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['role_id'] = $data['role_id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['type'] = $data['type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The user ID + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets role_id + * + * @return int|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param int|null $role_id The role ID + * + * @return self + */ + public function setRoleId($role_id): self + { + $this->container['role_id'] = $role_id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the role is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The assignment type + * + * @return self + */ + public function setType($type): self + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RoleSettings.php b/lib/Model/RoleSettings.php new file mode 100644 index 00000000..a29d7025 --- /dev/null +++ b/lib/Model/RoleSettings.php @@ -0,0 +1,583 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RoleSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RoleSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal_default_visibility' => 'float', + 'lead_default_visibility' => 'float', + 'org_default_visibility' => 'float', + 'person_default_visibility' => 'float', + 'product_default_visibility' => 'float', + 'deal_access_level' => 'float', + 'org_access_level' => 'float', + 'person_access_level' => 'float', + 'product_access_level' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal_default_visibility' => null, + 'lead_default_visibility' => null, + 'org_default_visibility' => null, + 'person_default_visibility' => null, + 'product_default_visibility' => null, + 'deal_access_level' => null, + 'org_access_level' => null, + 'person_access_level' => null, + 'product_access_level' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal_default_visibility' => 'deal_default_visibility', + 'lead_default_visibility' => 'lead_default_visibility', + 'org_default_visibility' => 'org_default_visibility', + 'person_default_visibility' => 'person_default_visibility', + 'product_default_visibility' => 'product_default_visibility', + 'deal_access_level' => 'deal_access_level', + 'org_access_level' => 'org_access_level', + 'person_access_level' => 'person_access_level', + 'product_access_level' => 'product_access_level' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal_default_visibility' => 'setDealDefaultVisibility', + 'lead_default_visibility' => 'setLeadDefaultVisibility', + 'org_default_visibility' => 'setOrgDefaultVisibility', + 'person_default_visibility' => 'setPersonDefaultVisibility', + 'product_default_visibility' => 'setProductDefaultVisibility', + 'deal_access_level' => 'setDealAccessLevel', + 'org_access_level' => 'setOrgAccessLevel', + 'person_access_level' => 'setPersonAccessLevel', + 'product_access_level' => 'setProductAccessLevel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal_default_visibility' => 'getDealDefaultVisibility', + 'lead_default_visibility' => 'getLeadDefaultVisibility', + 'org_default_visibility' => 'getOrgDefaultVisibility', + 'person_default_visibility' => 'getPersonDefaultVisibility', + 'product_default_visibility' => 'getProductDefaultVisibility', + 'deal_access_level' => 'getDealAccessLevel', + 'org_access_level' => 'getOrgAccessLevel', + 'person_access_level' => 'getPersonAccessLevel', + 'product_access_level' => 'getProductAccessLevel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal_default_visibility'] = $data['deal_default_visibility'] ?? null; + $this->container['lead_default_visibility'] = $data['lead_default_visibility'] ?? null; + $this->container['org_default_visibility'] = $data['org_default_visibility'] ?? null; + $this->container['person_default_visibility'] = $data['person_default_visibility'] ?? null; + $this->container['product_default_visibility'] = $data['product_default_visibility'] ?? null; + $this->container['deal_access_level'] = $data['deal_access_level'] ?? null; + $this->container['org_access_level'] = $data['org_access_level'] ?? null; + $this->container['person_access_level'] = $data['person_access_level'] ?? null; + $this->container['product_access_level'] = $data['product_access_level'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets deal_default_visibility + * + * @return float|null + */ + public function getDealDefaultVisibility() + { + return $this->container['deal_default_visibility']; + } + + /** + * Sets deal_default_visibility + * + * @param float|null $deal_default_visibility The default visibility level of the deals for the role + * + * @return self + */ + public function setDealDefaultVisibility($deal_default_visibility): self + { + $this->container['deal_default_visibility'] = $deal_default_visibility; + + return $this; + } + + /** + * Gets lead_default_visibility + * + * @return float|null + */ + public function getLeadDefaultVisibility() + { + return $this->container['lead_default_visibility']; + } + + /** + * Sets lead_default_visibility + * + * @param float|null $lead_default_visibility The default visibility level of the leads for the role + * + * @return self + */ + public function setLeadDefaultVisibility($lead_default_visibility): self + { + $this->container['lead_default_visibility'] = $lead_default_visibility; + + return $this; + } + + /** + * Gets org_default_visibility + * + * @return float|null + */ + public function getOrgDefaultVisibility() + { + return $this->container['org_default_visibility']; + } + + /** + * Sets org_default_visibility + * + * @param float|null $org_default_visibility The default visibility level of the organizations for the role + * + * @return self + */ + public function setOrgDefaultVisibility($org_default_visibility): self + { + $this->container['org_default_visibility'] = $org_default_visibility; + + return $this; + } + + /** + * Gets person_default_visibility + * + * @return float|null + */ + public function getPersonDefaultVisibility() + { + return $this->container['person_default_visibility']; + } + + /** + * Sets person_default_visibility + * + * @param float|null $person_default_visibility The default visibility level of the people for the role + * + * @return self + */ + public function setPersonDefaultVisibility($person_default_visibility): self + { + $this->container['person_default_visibility'] = $person_default_visibility; + + return $this; + } + + /** + * Gets product_default_visibility + * + * @return float|null + */ + public function getProductDefaultVisibility() + { + return $this->container['product_default_visibility']; + } + + /** + * Sets product_default_visibility + * + * @param float|null $product_default_visibility The default visibility level of the products for the role + * + * @return self + */ + public function setProductDefaultVisibility($product_default_visibility): self + { + $this->container['product_default_visibility'] = $product_default_visibility; + + return $this; + } + + /** + * Gets deal_access_level + * + * @return float|null + */ + public function getDealAccessLevel() + { + return $this->container['deal_access_level']; + } + + /** + * Sets deal_access_level + * + * @param float|null $deal_access_level The access level of the deals for the role (only for default role) + * + * @return self + */ + public function setDealAccessLevel($deal_access_level): self + { + $this->container['deal_access_level'] = $deal_access_level; + + return $this; + } + + /** + * Gets org_access_level + * + * @return float|null + */ + public function getOrgAccessLevel() + { + return $this->container['org_access_level']; + } + + /** + * Sets org_access_level + * + * @param float|null $org_access_level The access level of the organizations for the role (only for default role) + * + * @return self + */ + public function setOrgAccessLevel($org_access_level): self + { + $this->container['org_access_level'] = $org_access_level; + + return $this; + } + + /** + * Gets person_access_level + * + * @return float|null + */ + public function getPersonAccessLevel() + { + return $this->container['person_access_level']; + } + + /** + * Sets person_access_level + * + * @param float|null $person_access_level The access level of the people for the role (only for default role) + * + * @return self + */ + public function setPersonAccessLevel($person_access_level): self + { + $this->container['person_access_level'] = $person_access_level; + + return $this; + } + + /** + * Gets product_access_level + * + * @return float|null + */ + public function getProductAccessLevel() + { + return $this->container['product_access_level']; + } + + /** + * Sets product_access_level + * + * @param float|null $product_access_level The access level of the products for the role (only for default role) + * + * @return self + */ + public function setProductAccessLevel($product_access_level): self + { + $this->container['product_access_level'] = $product_access_level; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RolesAdditionalData.php b/lib/Model/RolesAdditionalData.php new file mode 100644 index 00000000..17b9a4c5 --- /dev/null +++ b/lib/Model/RolesAdditionalData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RolesAdditionalData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RolesAdditionalData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pagination' => '\Pipedrive\Model\RolesAdditionalDataPagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pagination' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = $data['pagination'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \Pipedrive\Model\RolesAdditionalDataPagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Pipedrive\Model\RolesAdditionalDataPagination|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination): self + { + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/RolesAdditionalDataPagination.php b/lib/Model/RolesAdditionalDataPagination.php new file mode 100644 index 00000000..5cc8c2f4 --- /dev/null +++ b/lib/Model/RolesAdditionalDataPagination.php @@ -0,0 +1,403 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RolesAdditionalDataPagination implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'RolesAdditionalData_pagination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'start' => 'int', + 'limit' => 'int', + 'more_items_in_collection' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'start' => null, + 'limit' => null, + 'more_items_in_collection' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'start' => 'start', + 'limit' => 'limit', + 'more_items_in_collection' => 'more_items_in_collection' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'start' => 'setStart', + 'limit' => 'setLimit', + 'more_items_in_collection' => 'setMoreItemsInCollection' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'start' => 'getStart', + 'limit' => 'getLimit', + 'more_items_in_collection' => 'getMoreItemsInCollection' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['start'] = $data['start'] ?? null; + $this->container['limit'] = $data['limit'] ?? null; + $this->container['more_items_in_collection'] = $data['more_items_in_collection'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets start + * + * @return int|null + */ + public function getStart() + { + return $this->container['start']; + } + + /** + * Sets start + * + * @param int|null $start Pagination start + * + * @return self + */ + public function setStart($start): self + { + $this->container['start'] = $start; + + return $this; + } + + /** + * Gets limit + * + * @return int|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param int|null $limit Items shown per page + * + * @return self + */ + public function setLimit($limit): self + { + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets more_items_in_collection + * + * @return bool|null + */ + public function getMoreItemsInCollection() + { + return $this->container['more_items_in_collection']; + } + + /** + * Sets more_items_in_collection + * + * @param bool|null $more_items_in_collection Whether there are more list items in the collection than displayed + * + * @return self + */ + public function setMoreItemsInCollection($more_items_in_collection): self + { + $this->container['more_items_in_collection'] = $more_items_in_collection; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SinglePermissionSetsItem.php b/lib/Model/SinglePermissionSetsItem.php new file mode 100644 index 00000000..fe1d5b9d --- /dev/null +++ b/lib/Model/SinglePermissionSetsItem.php @@ -0,0 +1,604 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SinglePermissionSetsItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SinglePermissionSetsItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'app' => 'string', + 'type' => 'string', + 'assignment_count' => 'int', + 'contents' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'description' => null, + 'app' => null, + 'type' => null, + 'assignment_count' => null, + 'contents' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description', + 'app' => 'app', + 'type' => 'type', + 'assignment_count' => 'assignment_count', + 'contents' => 'contents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription', + 'app' => 'setApp', + 'type' => 'setType', + 'assignment_count' => 'setAssignmentCount', + 'contents' => 'setContents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription', + 'app' => 'getApp', + 'type' => 'getType', + 'assignment_count' => 'getAssignmentCount', + 'contents' => 'getContents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const APP_SALES = 'sales'; + const APP_PROJECTS = 'projects'; + const APP_CAMPAIGNS = 'campaigns'; + const APP__GLOBAL = 'global'; + const APP_ACCOUNT_SETTINGS = 'account_settings'; + const TYPE_ADMIN = 'admin'; + const TYPE_MANAGER = 'manager'; + const TYPE_REGULAR = 'regular'; + const TYPE_CUSTOM = 'custom'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getAppAllowableValues(): array + { + return [ + self::APP_SALES, + self::APP_PROJECTS, + self::APP_CAMPAIGNS, + self::APP__GLOBAL, + self::APP_ACCOUNT_SETTINGS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getTypeAllowableValues(): array + { + return [ + self::TYPE_ADMIN, + self::TYPE_MANAGER, + self::TYPE_REGULAR, + self::TYPE_CUSTOM, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['app'] = $data['app'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['assignment_count'] = $data['assignment_count'] ?? null; + $this->container['contents'] = $data['contents'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getAppAllowableValues(); + if (!is_null($this->container['app']) && !in_array($this->container['app'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'app', must be one of '%s'", + $this->container['app'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of user permission set + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the permission set + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the permission set + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets app + * + * @return string|null + */ + public function getApp() + { + return $this->container['app']; + } + + /** + * Sets app + * + * @param string|null $app The app that permission set belongs to + * + * @return self + */ + public function setApp($app): self + { + $allowedValues = $this->getAppAllowableValues(); + if (!is_null($app) && !in_array($app, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'app', must be one of '%s'", + $app, + implode("', '", $allowedValues) + ) + ); + } + $this->container['app'] = $app; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of permission set + * + * @return self + */ + public function setType($type): self + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets assignment_count + * + * @return int|null + */ + public function getAssignmentCount() + { + return $this->container['assignment_count']; + } + + /** + * Sets assignment_count + * + * @param int|null $assignment_count The number of users assigned to this permission set + * + * @return self + */ + public function setAssignmentCount($assignment_count): self + { + $this->container['assignment_count'] = $assignment_count; + + return $this; + } + + /** + * Gets contents + * + * @return string[]|null + */ + public function getContents() + { + return $this->container['contents']; + } + + /** + * Sets contents + * + * @param string[]|null $contents A permission assigned to this permission set + * + * @return self + */ + public function setContents($contents): self + { + $this->container['contents'] = $contents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SinglePermissionSetsItemAllOf.php b/lib/Model/SinglePermissionSetsItemAllOf.php new file mode 100644 index 00000000..10fc19f9 --- /dev/null +++ b/lib/Model/SinglePermissionSetsItemAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SinglePermissionSetsItemAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SinglePermissionSetsItem_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'contents' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contents' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contents' => 'contents' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contents' => 'setContents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contents' => 'getContents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['contents'] = $data['contents'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets contents + * + * @return string[]|null + */ + public function getContents() + { + return $this->container['contents']; + } + + /** + * Sets contents + * + * @param string[]|null $contents A permission assigned to this permission set + * + * @return self + */ + public function setContents($contents): self + { + $this->container['contents'] = $contents; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Stage.php b/lib/Model/Stage.php new file mode 100644 index 00000000..942519dd --- /dev/null +++ b/lib/Model/Stage.php @@ -0,0 +1,462 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Stage implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Stage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'pipeline_id' => 'int', + 'deal_probability' => 'int', + 'rotten_flag' => 'bool', + 'rotten_days' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'pipeline_id' => null, + 'deal_probability' => null, + 'rotten_flag' => null, + 'rotten_days' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'pipeline_id' => 'pipeline_id', + 'deal_probability' => 'deal_probability', + 'rotten_flag' => 'rotten_flag', + 'rotten_days' => 'rotten_days' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'pipeline_id' => 'setPipelineId', + 'deal_probability' => 'setDealProbability', + 'rotten_flag' => 'setRottenFlag', + 'rotten_days' => 'setRottenDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'pipeline_id' => 'getPipelineId', + 'deal_probability' => 'getDealProbability', + 'rotten_flag' => 'getRottenFlag', + 'rotten_days' => 'getRottenDays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['rotten_flag'] = $data['rotten_flag'] ?? null; + $this->container['rotten_days'] = $data['rotten_days'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the stage + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline to add stage to + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets deal_probability + * + * @return int|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param int|null $deal_probability The success probability percentage of the deal. Used/shown when deal weighted values are used. + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets rotten_flag + * + * @return bool|null + */ + public function getRottenFlag() + { + return $this->container['rotten_flag']; + } + + /** + * Sets rotten_flag + * + * @param bool|null $rotten_flag Whether deals in this stage can become rotten + * + * @return self + */ + public function setRottenFlag($rotten_flag): self + { + $this->container['rotten_flag'] = $rotten_flag; + + return $this; + } + + /** + * Gets rotten_days + * + * @return int|null + */ + public function getRottenDays() + { + return $this->container['rotten_days']; + } + + /** + * Sets rotten_days + * + * @param int|null $rotten_days The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. + * + * @return self + */ + public function setRottenDays($rotten_days): self + { + $this->container['rotten_days'] = $rotten_days; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/StageConversions.php b/lib/Model/StageConversions.php new file mode 100644 index 00000000..7a82456d --- /dev/null +++ b/lib/Model/StageConversions.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class StageConversions implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StageConversions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'from_stage_id' => 'int', + 'to_stage_id' => 'int', + 'conversion_rate' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from_stage_id' => null, + 'to_stage_id' => null, + 'conversion_rate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from_stage_id' => 'from_stage_id', + 'to_stage_id' => 'to_stage_id', + 'conversion_rate' => 'conversion_rate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from_stage_id' => 'setFromStageId', + 'to_stage_id' => 'setToStageId', + 'conversion_rate' => 'setConversionRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from_stage_id' => 'getFromStageId', + 'to_stage_id' => 'getToStageId', + 'conversion_rate' => 'getConversionRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['from_stage_id'] = $data['from_stage_id'] ?? null; + $this->container['to_stage_id'] = $data['to_stage_id'] ?? null; + $this->container['conversion_rate'] = $data['conversion_rate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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_stage_id + * + * @return int|null + */ + public function getFromStageId() + { + return $this->container['from_stage_id']; + } + + /** + * Sets from_stage_id + * + * @param int|null $from_stage_id The stage ID from where conversion starts + * + * @return self + */ + public function setFromStageId($from_stage_id): self + { + $this->container['from_stage_id'] = $from_stage_id; + + return $this; + } + + /** + * Gets to_stage_id + * + * @return int|null + */ + public function getToStageId() + { + return $this->container['to_stage_id']; + } + + /** + * Sets to_stage_id + * + * @param int|null $to_stage_id The stage ID to where conversion ends + * + * @return self + */ + public function setToStageId($to_stage_id): self + { + $this->container['to_stage_id'] = $to_stage_id; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return int|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param int|null $conversion_rate The conversion rate + * + * @return self + */ + public function setConversionRate($conversion_rate): self + { + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/StageDetails.php b/lib/Model/StageDetails.php new file mode 100644 index 00000000..002829d8 --- /dev/null +++ b/lib/Model/StageDetails.php @@ -0,0 +1,643 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class StageDetails implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StageDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'order_nr' => 'int', + 'name' => 'string', + 'active_flag' => 'bool', + 'deal_probability' => 'int', + 'pipeline_id' => 'int', + 'rotten_flag' => 'bool', + 'rotten_days' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'deals_summary' => '\Pipedrive\Model\DealSummary' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'order_nr' => null, + 'name' => null, + 'active_flag' => null, + 'deal_probability' => null, + 'pipeline_id' => null, + 'rotten_flag' => null, + 'rotten_days' => null, + 'add_time' => null, + 'update_time' => null, + 'deals_summary' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'order_nr' => 'order_nr', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'deal_probability' => 'deal_probability', + 'pipeline_id' => 'pipeline_id', + 'rotten_flag' => 'rotten_flag', + 'rotten_days' => 'rotten_days', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'deals_summary' => 'deals_summary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'order_nr' => 'setOrderNr', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'deal_probability' => 'setDealProbability', + 'pipeline_id' => 'setPipelineId', + 'rotten_flag' => 'setRottenFlag', + 'rotten_days' => 'setRottenDays', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'deals_summary' => 'setDealsSummary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'order_nr' => 'getOrderNr', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'deal_probability' => 'getDealProbability', + 'pipeline_id' => 'getPipelineId', + 'rotten_flag' => 'getRottenFlag', + 'rotten_days' => 'getRottenDays', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'deals_summary' => 'getDealsSummary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['rotten_flag'] = $data['rotten_flag'] ?? null; + $this->container['rotten_days'] = $data['rotten_days'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['deals_summary'] = $data['deals_summary'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the stage + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of the stage + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the stage + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the stage is active or deleted + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deal_probability + * + * @return int|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param int|null $deal_probability The success probability percentage of the deal. Used/shown when the deal weighted values are used. + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline to add the stage to + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets rotten_flag + * + * @return bool|null + */ + public function getRottenFlag() + { + return $this->container['rotten_flag']; + } + + /** + * Sets rotten_flag + * + * @param bool|null $rotten_flag Whether deals in this stage can become rotten + * + * @return self + */ + public function setRottenFlag($rotten_flag): self + { + $this->container['rotten_flag'] = $rotten_flag; + + return $this; + } + + /** + * Gets rotten_days + * + * @return int|null + */ + public function getRottenDays() + { + return $this->container['rotten_days']; + } + + /** + * Sets rotten_days + * + * @param int|null $rotten_days The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. + * + * @return self + */ + public function setRottenDays($rotten_days): self + { + $this->container['rotten_days'] = $rotten_days; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The stage creation time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The stage update time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets deals_summary + * + * @return \Pipedrive\Model\DealSummary|null + */ + public function getDealsSummary() + { + return $this->container['deals_summary']; + } + + /** + * Sets deals_summary + * + * @param \Pipedrive\Model\DealSummary|null $deals_summary deals_summary + * + * @return self + */ + public function setDealsSummary($deals_summary): self + { + $this->container['deals_summary'] = $deals_summary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/StageWithPipelineInfo.php b/lib/Model/StageWithPipelineInfo.php new file mode 100644 index 00000000..50f94162 --- /dev/null +++ b/lib/Model/StageWithPipelineInfo.php @@ -0,0 +1,672 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class StageWithPipelineInfo implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StageWithPipelineInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'order_nr' => 'int', + 'name' => 'string', + 'active_flag' => 'bool', + 'deal_probability' => 'int', + 'pipeline_id' => 'int', + 'rotten_flag' => 'bool', + 'rotten_days' => 'int', + 'add_time' => 'string', + 'update_time' => 'string', + 'pipeline_name' => 'string', + 'pipeline_deal_probability' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'order_nr' => null, + 'name' => null, + 'active_flag' => null, + 'deal_probability' => null, + 'pipeline_id' => null, + 'rotten_flag' => null, + 'rotten_days' => null, + 'add_time' => null, + 'update_time' => null, + 'pipeline_name' => null, + 'pipeline_deal_probability' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'order_nr' => 'order_nr', + 'name' => 'name', + 'active_flag' => 'active_flag', + 'deal_probability' => 'deal_probability', + 'pipeline_id' => 'pipeline_id', + 'rotten_flag' => 'rotten_flag', + 'rotten_days' => 'rotten_days', + 'add_time' => 'add_time', + 'update_time' => 'update_time', + 'pipeline_name' => 'pipeline_name', + 'pipeline_deal_probability' => 'pipeline_deal_probability' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'order_nr' => 'setOrderNr', + 'name' => 'setName', + 'active_flag' => 'setActiveFlag', + 'deal_probability' => 'setDealProbability', + 'pipeline_id' => 'setPipelineId', + 'rotten_flag' => 'setRottenFlag', + 'rotten_days' => 'setRottenDays', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime', + 'pipeline_name' => 'setPipelineName', + 'pipeline_deal_probability' => 'setPipelineDealProbability' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'order_nr' => 'getOrderNr', + 'name' => 'getName', + 'active_flag' => 'getActiveFlag', + 'deal_probability' => 'getDealProbability', + 'pipeline_id' => 'getPipelineId', + 'rotten_flag' => 'getRottenFlag', + 'rotten_days' => 'getRottenDays', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime', + 'pipeline_name' => 'getPipelineName', + 'pipeline_deal_probability' => 'getPipelineDealProbability' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['rotten_flag'] = $data['rotten_flag'] ?? null; + $this->container['rotten_days'] = $data['rotten_days'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + $this->container['pipeline_name'] = $data['pipeline_name'] ?? null; + $this->container['pipeline_deal_probability'] = $data['pipeline_deal_probability'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the stage + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr Defines the order of the stage + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the stage + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the stage is active or deleted + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deal_probability + * + * @return int|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param int|null $deal_probability The success probability percentage of the deal. Used/shown when the deal weighted values are used. + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline to add the stage to + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets rotten_flag + * + * @return bool|null + */ + public function getRottenFlag() + { + return $this->container['rotten_flag']; + } + + /** + * Sets rotten_flag + * + * @param bool|null $rotten_flag Whether deals in this stage can become rotten + * + * @return self + */ + public function setRottenFlag($rotten_flag): self + { + $this->container['rotten_flag'] = $rotten_flag; + + return $this; + } + + /** + * Gets rotten_days + * + * @return int|null + */ + public function getRottenDays() + { + return $this->container['rotten_days']; + } + + /** + * Sets rotten_days + * + * @param int|null $rotten_days The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. + * + * @return self + */ + public function setRottenDays($rotten_days): self + { + $this->container['rotten_days'] = $rotten_days; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The stage creation time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The stage update time. Format: YYYY-MM-DD HH:MM:SS. + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + + /** + * Gets pipeline_name + * + * @return string|null + */ + public function getPipelineName() + { + return $this->container['pipeline_name']; + } + + /** + * Sets pipeline_name + * + * @param string|null $pipeline_name The name of the pipeline + * + * @return self + */ + public function setPipelineName($pipeline_name): self + { + $this->container['pipeline_name'] = $pipeline_name; + + return $this; + } + + /** + * Gets pipeline_deal_probability + * + * @return bool|null + */ + public function getPipelineDealProbability() + { + return $this->container['pipeline_deal_probability']; + } + + /** + * Sets pipeline_deal_probability + * + * @param bool|null $pipeline_deal_probability The pipeline deal probability. When `true`, overrides the stage probability. + * + * @return self + */ + public function setPipelineDealProbability($pipeline_deal_probability): self + { + $this->container['pipeline_deal_probability'] = $pipeline_deal_probability; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/StageWithPipelineInfoAllOf.php b/lib/Model/StageWithPipelineInfoAllOf.php new file mode 100644 index 00000000..ce61d2dd --- /dev/null +++ b/lib/Model/StageWithPipelineInfoAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class StageWithPipelineInfoAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'StageWithPipelineInfo_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'pipeline_name' => 'string', + 'pipeline_deal_probability' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pipeline_name' => null, + 'pipeline_deal_probability' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pipeline_name' => 'pipeline_name', + 'pipeline_deal_probability' => 'pipeline_deal_probability' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pipeline_name' => 'setPipelineName', + 'pipeline_deal_probability' => 'setPipelineDealProbability' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pipeline_name' => 'getPipelineName', + 'pipeline_deal_probability' => 'getPipelineDealProbability' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pipeline_name'] = $data['pipeline_name'] ?? null; + $this->container['pipeline_deal_probability'] = $data['pipeline_deal_probability'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pipeline_name + * + * @return string|null + */ + public function getPipelineName() + { + return $this->container['pipeline_name']; + } + + /** + * Sets pipeline_name + * + * @param string|null $pipeline_name The name of the pipeline + * + * @return self + */ + public function setPipelineName($pipeline_name): self + { + $this->container['pipeline_name'] = $pipeline_name; + + return $this; + } + + /** + * Gets pipeline_deal_probability + * + * @return bool|null + */ + public function getPipelineDealProbability() + { + return $this->container['pipeline_deal_probability']; + } + + /** + * Sets pipeline_deal_probability + * + * @param bool|null $pipeline_deal_probability The pipeline deal probability. When `true`, overrides the stage probability. + * + * @return self + */ + public function setPipelineDealProbability($pipeline_deal_probability): self + { + $this->container['pipeline_deal_probability'] = $pipeline_deal_probability; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubRole.php b/lib/Model/SubRole.php new file mode 100644 index 00000000..975462f3 --- /dev/null +++ b/lib/Model/SubRole.php @@ -0,0 +1,493 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubRole implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubRole'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'parent_role_id' => 'int', + 'name' => 'string', + 'id' => 'int', + 'active_flag' => 'bool', + 'assignment_count' => 'string', + 'sub_role_count' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'parent_role_id' => null, + 'name' => null, + 'id' => null, + 'active_flag' => null, + 'assignment_count' => null, + 'sub_role_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'parent_role_id' => 'parent_role_id', + 'name' => 'name', + 'id' => 'id', + 'active_flag' => 'active_flag', + 'assignment_count' => 'assignment_count', + 'sub_role_count' => 'sub_role_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'parent_role_id' => 'setParentRoleId', + 'name' => 'setName', + 'id' => 'setId', + 'active_flag' => 'setActiveFlag', + 'assignment_count' => 'setAssignmentCount', + 'sub_role_count' => 'setSubRoleCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'parent_role_id' => 'getParentRoleId', + 'name' => 'getName', + 'id' => 'getId', + 'active_flag' => 'getActiveFlag', + 'assignment_count' => 'getAssignmentCount', + 'sub_role_count' => 'getSubRoleCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['parent_role_id'] = $data['parent_role_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['assignment_count'] = $data['assignment_count'] ?? null; + $this->container['sub_role_count'] = $data['sub_role_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets parent_role_id + * + * @return int|null + */ + public function getParentRoleId() + { + return $this->container['parent_role_id']; + } + + /** + * Sets parent_role_id + * + * @param int|null $parent_role_id The ID of the parent role + * + * @return self + */ + public function setParentRoleId($parent_role_id): self + { + $this->container['parent_role_id'] = $parent_role_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the role + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the role is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets assignment_count + * + * @return string|null + */ + public function getAssignmentCount() + { + return $this->container['assignment_count']; + } + + /** + * Sets assignment_count + * + * @param string|null $assignment_count The number of users assigned to this role + * + * @return self + */ + public function setAssignmentCount($assignment_count): self + { + $this->container['assignment_count'] = $assignment_count; + + return $this; + } + + /** + * Gets sub_role_count + * + * @return string|null + */ + public function getSubRoleCount() + { + return $this->container['sub_role_count']; + } + + /** + * Sets sub_role_count + * + * @param string|null $sub_role_count The number of sub-roles + * + * @return self + */ + public function setSubRoleCount($sub_role_count): self + { + $this->container['sub_role_count'] = $sub_role_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubRoleAllOf.php b/lib/Model/SubRoleAllOf.php new file mode 100644 index 00000000..4fe05724 --- /dev/null +++ b/lib/Model/SubRoleAllOf.php @@ -0,0 +1,432 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubRoleAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubRole_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'active_flag' => 'bool', + 'assignment_count' => 'string', + 'sub_role_count' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'active_flag' => null, + 'assignment_count' => null, + 'sub_role_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'active_flag' => 'active_flag', + 'assignment_count' => 'assignment_count', + 'sub_role_count' => 'sub_role_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'active_flag' => 'setActiveFlag', + 'assignment_count' => 'setAssignmentCount', + 'sub_role_count' => 'setSubRoleCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'active_flag' => 'getActiveFlag', + 'assignment_count' => 'getAssignmentCount', + 'sub_role_count' => 'getSubRoleCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['assignment_count'] = $data['assignment_count'] ?? null; + $this->container['sub_role_count'] = $data['sub_role_count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the role + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the role is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets assignment_count + * + * @return string|null + */ + public function getAssignmentCount() + { + return $this->container['assignment_count']; + } + + /** + * Sets assignment_count + * + * @param string|null $assignment_count The number of users assigned to this role + * + * @return self + */ + public function setAssignmentCount($assignment_count): self + { + $this->container['assignment_count'] = $assignment_count; + + return $this; + } + + /** + * Gets sub_role_count + * + * @return string|null + */ + public function getSubRoleCount() + { + return $this->container['sub_role_count']; + } + + /** + * Sets sub_role_count + * + * @param string|null $sub_role_count The number of sub-roles + * + * @return self + */ + public function setSubRoleCount($sub_role_count): self + { + $this->container['sub_role_count'] = $sub_role_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionAddonsResponse.php b/lib/Model/SubscriptionAddonsResponse.php new file mode 100644 index 00000000..ab62cbb1 --- /dev/null +++ b/lib/Model/SubscriptionAddonsResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionAddonsResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionAddonsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data An array of add-ons that the company has. + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionAddonsResponseAllOf.php b/lib/Model/SubscriptionAddonsResponseAllOf.php new file mode 100644 index 00000000..cd817933 --- /dev/null +++ b/lib/Model/SubscriptionAddonsResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionAddonsResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionAddonsResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return object[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object[]|null $data An array of add-ons that the company has. + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionInstallmentCreateRequest.php b/lib/Model/SubscriptionInstallmentCreateRequest.php new file mode 100644 index 00000000..d8e68b6f --- /dev/null +++ b/lib/Model/SubscriptionInstallmentCreateRequest.php @@ -0,0 +1,441 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionInstallmentCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionInstallmentCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal_id' => 'int', + 'currency' => 'string', + 'payments' => 'object[]', + 'update_deal_value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal_id' => null, + 'currency' => null, + 'payments' => null, + 'update_deal_value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal_id' => 'deal_id', + 'currency' => 'currency', + 'payments' => 'payments', + 'update_deal_value' => 'update_deal_value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal_id' => 'setDealId', + 'currency' => 'setCurrency', + 'payments' => 'setPayments', + 'update_deal_value' => 'setUpdateDealValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal_id' => 'getDealId', + 'currency' => 'getCurrency', + 'payments' => 'getPayments', + 'update_deal_value' => 'getUpdateDealValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['payments'] = $data['payments'] ?? null; + $this->container['update_deal_value'] = $data['update_deal_value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['deal_id'] === null) { + $invalidProperties[] = "'deal_id' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['payments'] === null) { + $invalidProperties[] = "'payments' 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 deal_id + * + * @return int + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int $deal_id The ID of the deal this installment subscription is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency of the installment subscription. Accepts a 3-character currency code. + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets payments + * + * @return object[] + */ + public function getPayments() + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param object[] $payments Array of payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). + * + * @return self + */ + public function setPayments($payments): self + { + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets update_deal_value + * + * @return bool|null + */ + public function getUpdateDealValue() + { + return $this->container['update_deal_value']; + } + + /** + * Sets update_deal_value + * + * @param bool|null $update_deal_value Indicates that the deal value must be set to the installment subscription's total value + * + * @return self + */ + public function setUpdateDealValue($update_deal_value): self + { + $this->container['update_deal_value'] = $update_deal_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionInstallmentUpdateRequest.php b/lib/Model/SubscriptionInstallmentUpdateRequest.php new file mode 100644 index 00000000..cfa152fe --- /dev/null +++ b/lib/Model/SubscriptionInstallmentUpdateRequest.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionInstallmentUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionInstallmentUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'payments' => 'object[]', + 'update_deal_value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payments' => null, + 'update_deal_value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payments' => 'payments', + 'update_deal_value' => 'update_deal_value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payments' => 'setPayments', + 'update_deal_value' => 'setUpdateDealValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payments' => 'getPayments', + 'update_deal_value' => 'getUpdateDealValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['payments'] = $data['payments'] ?? null; + $this->container['update_deal_value'] = $data['update_deal_value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['payments'] === null) { + $invalidProperties[] = "'payments' 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 payments + * + * @return object[] + */ + public function getPayments() + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param object[] $payments Array of payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with a explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). + * + * @return self + */ + public function setPayments($payments): self + { + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets update_deal_value + * + * @return bool|null + */ + public function getUpdateDealValue() + { + return $this->container['update_deal_value']; + } + + /** + * Sets update_deal_value + * + * @param bool|null $update_deal_value Indicates that the deal value must be set to installment subscription's total value + * + * @return self + */ + public function setUpdateDealValue($update_deal_value): self + { + $this->container['update_deal_value'] = $update_deal_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionItem.php b/lib/Model/SubscriptionItem.php new file mode 100644 index 00000000..e4c4e6f3 --- /dev/null +++ b/lib/Model/SubscriptionItem.php @@ -0,0 +1,792 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'user_id' => 'int', + 'deal_id' => 'int', + 'description' => 'string', + 'is_active' => 'bool', + 'cycles_count' => 'int', + 'cycle_amount' => 'int', + 'infinite' => 'bool', + 'currency' => 'string', + 'cadence_type' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'lifetime_value' => 'double', + 'final_status' => 'string', + 'add_time' => 'string', + 'update_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'user_id' => null, + 'deal_id' => null, + 'description' => null, + 'is_active' => null, + 'cycles_count' => null, + 'cycle_amount' => null, + 'infinite' => null, + 'currency' => null, + 'cadence_type' => null, + 'start_date' => 'date', + 'end_date' => 'date', + 'lifetime_value' => 'double', + 'final_status' => null, + 'add_time' => 'datetime', + 'update_time' => 'datetime' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'user_id' => 'user_id', + 'deal_id' => 'deal_id', + 'description' => 'description', + 'is_active' => 'is_active', + 'cycles_count' => 'cycles_count', + 'cycle_amount' => 'cycle_amount', + 'infinite' => 'infinite', + 'currency' => 'currency', + 'cadence_type' => 'cadence_type', + 'start_date' => 'start_date', + 'end_date' => 'end_date', + 'lifetime_value' => 'lifetime_value', + 'final_status' => 'final_status', + 'add_time' => 'add_time', + 'update_time' => 'update_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'user_id' => 'setUserId', + 'deal_id' => 'setDealId', + 'description' => 'setDescription', + 'is_active' => 'setIsActive', + 'cycles_count' => 'setCyclesCount', + 'cycle_amount' => 'setCycleAmount', + 'infinite' => 'setInfinite', + 'currency' => 'setCurrency', + 'cadence_type' => 'setCadenceType', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'lifetime_value' => 'setLifetimeValue', + 'final_status' => 'setFinalStatus', + 'add_time' => 'setAddTime', + 'update_time' => 'setUpdateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'user_id' => 'getUserId', + 'deal_id' => 'getDealId', + 'description' => 'getDescription', + 'is_active' => 'getIsActive', + 'cycles_count' => 'getCyclesCount', + 'cycle_amount' => 'getCycleAmount', + 'infinite' => 'getInfinite', + 'currency' => 'getCurrency', + 'cadence_type' => 'getCadenceType', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'lifetime_value' => 'getLifetimeValue', + 'final_status' => 'getFinalStatus', + 'add_time' => 'getAddTime', + 'update_time' => 'getUpdateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['is_active'] = $data['is_active'] ?? null; + $this->container['cycles_count'] = $data['cycles_count'] ?? null; + $this->container['cycle_amount'] = $data['cycle_amount'] ?? null; + $this->container['infinite'] = $data['infinite'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['cadence_type'] = $data['cadence_type'] ?? null; + $this->container['start_date'] = $data['start_date'] ?? null; + $this->container['end_date'] = $data['end_date'] ?? null; + $this->container['lifetime_value'] = $data['lifetime_value'] ?? null; + $this->container['final_status'] = $data['final_status'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['update_time'] = $data['update_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the subscription + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user who created the subscription + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets deal_id + * + * @return int|null + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int|null $deal_id The ID of the deal this subscription is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the recurring subscription + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets is_active + * + * @return bool|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool|null $is_active The subscription status + * + * @return self + */ + public function setIsActive($is_active): self + { + $this->container['is_active'] = $is_active; + + return $this; + } + + /** + * Gets cycles_count + * + * @return int|null + */ + public function getCyclesCount() + { + return $this->container['cycles_count']; + } + + /** + * Sets cycles_count + * + * @param int|null $cycles_count Shows how many payments a recurring subscription has + * + * @return self + */ + public function setCyclesCount($cycles_count): self + { + $this->container['cycles_count'] = $cycles_count; + + return $this; + } + + /** + * Gets cycle_amount + * + * @return int|null + */ + public function getCycleAmount() + { + return $this->container['cycle_amount']; + } + + /** + * Sets cycle_amount + * + * @param int|null $cycle_amount The amount of each payment + * + * @return self + */ + public function setCycleAmount($cycle_amount): self + { + $this->container['cycle_amount'] = $cycle_amount; + + return $this; + } + + /** + * Gets infinite + * + * @return bool|null + */ + public function getInfinite() + { + return $this->container['infinite']; + } + + /** + * Sets infinite + * + * @param bool|null $infinite Indicates that the recurring subscription will last until it is manually canceled or deleted + * + * @return self + */ + public function setInfinite($infinite): self + { + $this->container['infinite'] = $infinite; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the subscription + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets cadence_type + * + * @return string|null + */ + public function getCadenceType() + { + return $this->container['cadence_type']; + } + + /** + * Sets cadence_type + * + * @param string|null $cadence_type The interval between payments + * + * @return self + */ + public function setCadenceType($cadence_type): self + { + $this->container['cadence_type'] = $cadence_type; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date The start date of the recurring subscription + * + * @return self + */ + public function setStartDate($start_date): self + { + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date The end date of the subscription + * + * @return self + */ + public function setEndDate($end_date): self + { + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets lifetime_value + * + * @return double|null + */ + public function getLifetimeValue() + { + return $this->container['lifetime_value']; + } + + /** + * Sets lifetime_value + * + * @param double|null $lifetime_value The total value of all payments + * + * @return self + */ + public function setLifetimeValue($lifetime_value): self + { + $this->container['lifetime_value'] = $lifetime_value; + + return $this; + } + + /** + * Gets final_status + * + * @return string|null + */ + public function getFinalStatus() + { + return $this->container['final_status']; + } + + /** + * Sets final_status + * + * @param string|null $final_status The final status of the subscription + * + * @return self + */ + public function setFinalStatus($final_status): self + { + $this->container['final_status'] = $final_status; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The creation time of the subscription + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets update_time + * + * @return string|null + */ + public function getUpdateTime() + { + return $this->container['update_time']; + } + + /** + * Sets update_time + * + * @param string|null $update_time The update time of the subscription + * + * @return self + */ + public function setUpdateTime($update_time): self + { + $this->container['update_time'] = $update_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionRecurringCancelRequest.php b/lib/Model/SubscriptionRecurringCancelRequest.php new file mode 100644 index 00000000..c2b9d4c3 --- /dev/null +++ b/lib/Model/SubscriptionRecurringCancelRequest.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionRecurringCancelRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionRecurringCancelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'end_date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'end_date' => 'date' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'end_date' => 'end_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'end_date' => 'setEndDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'end_date' => 'getEndDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['end_date'] = $data['end_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date The subscription termination date. All payments after specified date will be deleted. Default value is the current date. + * + * @return self + */ + public function setEndDate($end_date): self + { + $this->container['end_date'] = $end_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionRecurringCreateRequest.php b/lib/Model/SubscriptionRecurringCreateRequest.php new file mode 100644 index 00000000..046101b7 --- /dev/null +++ b/lib/Model/SubscriptionRecurringCreateRequest.php @@ -0,0 +1,667 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionRecurringCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionRecurringCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'deal_id' => 'int', + 'currency' => 'string', + 'description' => 'string', + 'cadence_type' => 'string', + 'cycles_count' => 'int', + 'cycle_amount' => 'int', + 'start_date' => '\DateTime', + 'infinite' => 'bool', + 'payments' => 'object[]', + 'update_deal_value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deal_id' => null, + 'currency' => null, + 'description' => null, + 'cadence_type' => null, + 'cycles_count' => null, + 'cycle_amount' => null, + 'start_date' => 'date', + 'infinite' => null, + 'payments' => null, + 'update_deal_value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deal_id' => 'deal_id', + 'currency' => 'currency', + 'description' => 'description', + 'cadence_type' => 'cadence_type', + 'cycles_count' => 'cycles_count', + 'cycle_amount' => 'cycle_amount', + 'start_date' => 'start_date', + 'infinite' => 'infinite', + 'payments' => 'payments', + 'update_deal_value' => 'update_deal_value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deal_id' => 'setDealId', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'cadence_type' => 'setCadenceType', + 'cycles_count' => 'setCyclesCount', + 'cycle_amount' => 'setCycleAmount', + 'start_date' => 'setStartDate', + 'infinite' => 'setInfinite', + 'payments' => 'setPayments', + 'update_deal_value' => 'setUpdateDealValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deal_id' => 'getDealId', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'cadence_type' => 'getCadenceType', + 'cycles_count' => 'getCyclesCount', + 'cycle_amount' => 'getCycleAmount', + 'start_date' => 'getStartDate', + 'infinite' => 'getInfinite', + 'payments' => 'getPayments', + 'update_deal_value' => 'getUpdateDealValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const CADENCE_TYPE_WEEKLY = 'weekly'; + const CADENCE_TYPE_MONTHLY = 'monthly'; + const CADENCE_TYPE_QUARTERLY = 'quarterly'; + const CADENCE_TYPE_YEARLY = 'yearly'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getCadenceTypeAllowableValues(): array + { + return [ + self::CADENCE_TYPE_WEEKLY, + self::CADENCE_TYPE_MONTHLY, + self::CADENCE_TYPE_QUARTERLY, + self::CADENCE_TYPE_YEARLY, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deal_id'] = $data['deal_id'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['cadence_type'] = $data['cadence_type'] ?? null; + $this->container['cycles_count'] = $data['cycles_count'] ?? null; + $this->container['cycle_amount'] = $data['cycle_amount'] ?? null; + $this->container['start_date'] = $data['start_date'] ?? null; + $this->container['infinite'] = $data['infinite'] ?? null; + $this->container['payments'] = $data['payments'] ?? null; + $this->container['update_deal_value'] = $data['update_deal_value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['deal_id'] === null) { + $invalidProperties[] = "'deal_id' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['cadence_type'] === null) { + $invalidProperties[] = "'cadence_type' can't be null"; + } + $allowedValues = $this->getCadenceTypeAllowableValues(); + if (!is_null($this->container['cadence_type']) && !in_array($this->container['cadence_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'cadence_type', must be one of '%s'", + $this->container['cadence_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['cycle_amount'] === null) { + $invalidProperties[] = "'cycle_amount' can't be null"; + } + if ($this->container['start_date'] === null) { + $invalidProperties[] = "'start_date' 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 deal_id + * + * @return int + */ + public function getDealId() + { + return $this->container['deal_id']; + } + + /** + * Sets deal_id + * + * @param int $deal_id The ID of the deal this recurring subscription is associated with + * + * @return self + */ + public function setDealId($deal_id): self + { + $this->container['deal_id'] = $deal_id; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The currency of the recurring subscription. Accepts a 3-character currency code. + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the recurring subscription + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets cadence_type + * + * @return string + */ + public function getCadenceType() + { + return $this->container['cadence_type']; + } + + /** + * Sets cadence_type + * + * @param string $cadence_type The interval between payments + * + * @return self + */ + public function setCadenceType($cadence_type): self + { + $allowedValues = $this->getCadenceTypeAllowableValues(); + if (!in_array($cadence_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'cadence_type', must be one of '%s'", + $cadence_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['cadence_type'] = $cadence_type; + + return $this; + } + + /** + * Gets cycles_count + * + * @return int|null + */ + public function getCyclesCount() + { + return $this->container['cycles_count']; + } + + /** + * Sets cycles_count + * + * @param int|null $cycles_count Shows how many payments the subscription has. Note that one field must be set: `cycles_count` or `infinite`. If `cycles_count` is set, then `cycle_amount` and `start_date` are also required. + * + * @return self + */ + public function setCyclesCount($cycles_count): self + { + $this->container['cycles_count'] = $cycles_count; + + return $this; + } + + /** + * Gets cycle_amount + * + * @return int + */ + public function getCycleAmount() + { + return $this->container['cycle_amount']; + } + + /** + * Sets cycle_amount + * + * @param int $cycle_amount The amount of each payment + * + * @return self + */ + public function setCycleAmount($cycle_amount): self + { + $this->container['cycle_amount'] = $cycle_amount; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime $start_date The start date of the recurring subscription. Format: YYYY-MM-DD + * + * @return self + */ + public function setStartDate($start_date): self + { + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets infinite + * + * @return bool|null + */ + public function getInfinite() + { + return $this->container['infinite']; + } + + /** + * Sets infinite + * + * @param bool|null $infinite This indicates that the recurring subscription will last until it's manually canceled or deleted. Note that only one field must be set: `cycles_count` or `infinite`. + * + * @return self + */ + public function setInfinite($infinite): self + { + $this->container['infinite'] = $infinite; + + return $this; + } + + /** + * Gets payments + * + * @return object[]|null + */ + public function getPayments() + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param object[]|null $payments Array of additional payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). + * + * @return self + */ + public function setPayments($payments): self + { + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets update_deal_value + * + * @return bool|null + */ + public function getUpdateDealValue() + { + return $this->container['update_deal_value']; + } + + /** + * Sets update_deal_value + * + * @param bool|null $update_deal_value Indicates that the deal value must be set to recurring subscription's MRR value + * + * @return self + */ + public function setUpdateDealValue($update_deal_value): self + { + $this->container['update_deal_value'] = $update_deal_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionRecurringUpdateRequest.php b/lib/Model/SubscriptionRecurringUpdateRequest.php new file mode 100644 index 00000000..a7eddda4 --- /dev/null +++ b/lib/Model/SubscriptionRecurringUpdateRequest.php @@ -0,0 +1,465 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionRecurringUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionRecurringUpdateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'description' => 'string', + 'cycle_amount' => 'int', + 'payments' => 'object[]', + 'update_deal_value' => 'bool', + 'effective_date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'cycle_amount' => null, + 'payments' => null, + 'update_deal_value' => null, + 'effective_date' => 'date' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'cycle_amount' => 'cycle_amount', + 'payments' => 'payments', + 'update_deal_value' => 'update_deal_value', + 'effective_date' => 'effective_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'cycle_amount' => 'setCycleAmount', + 'payments' => 'setPayments', + 'update_deal_value' => 'setUpdateDealValue', + 'effective_date' => 'setEffectiveDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'cycle_amount' => 'getCycleAmount', + 'payments' => 'getPayments', + 'update_deal_value' => 'getUpdateDealValue', + 'effective_date' => 'getEffectiveDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['description'] = $data['description'] ?? null; + $this->container['cycle_amount'] = $data['cycle_amount'] ?? null; + $this->container['payments'] = $data['payments'] ?? null; + $this->container['update_deal_value'] = $data['update_deal_value'] ?? null; + $this->container['effective_date'] = $data['effective_date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['effective_date'] === null) { + $invalidProperties[] = "'effective_date' 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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the recurring subscription + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets cycle_amount + * + * @return int|null + */ + public function getCycleAmount() + { + return $this->container['cycle_amount']; + } + + /** + * Sets cycle_amount + * + * @param int|null $cycle_amount The amount of each payment + * + * @return self + */ + public function setCycleAmount($cycle_amount): self + { + $this->container['cycle_amount'] = $cycle_amount; + + return $this; + } + + /** + * Gets payments + * + * @return object[]|null + */ + public function getPayments() + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param object[]|null $payments Array of additional payments. It requires a minimum structure as follows: [{ amount:SUM, description:DESCRIPTION, due_at:PAYMENT_DATE }]. Replace SUM with a payment amount, DESCRIPTION with an explanation string, PAYMENT_DATE with a date (format YYYY-MM-DD). + * + * @return self + */ + public function setPayments($payments): self + { + $this->container['payments'] = $payments; + + return $this; + } + + /** + * Gets update_deal_value + * + * @return bool|null + */ + public function getUpdateDealValue() + { + return $this->container['update_deal_value']; + } + + /** + * Sets update_deal_value + * + * @param bool|null $update_deal_value Indicates that the deal value must be set to recurring subscription's MRR value + * + * @return self + */ + public function setUpdateDealValue($update_deal_value): self + { + $this->container['update_deal_value'] = $update_deal_value; + + return $this; + } + + /** + * Gets effective_date + * + * @return \DateTime + */ + public function getEffectiveDate() + { + return $this->container['effective_date']; + } + + /** + * Sets effective_date + * + * @param \DateTime $effective_date All payments after that date will be affected. Format: YYYY-MM-DD + * + * @return self + */ + public function setEffectiveDate($effective_date): self + { + $this->container['effective_date'] = $effective_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionsIdResponse.php b/lib/Model/SubscriptionsIdResponse.php new file mode 100644 index 00000000..4aade84f --- /dev/null +++ b/lib/Model/SubscriptionsIdResponse.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionsIdResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionsIdResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\SubscriptionItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\SubscriptionItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\SubscriptionItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/SubscriptionsIdResponseAllOf.php b/lib/Model/SubscriptionsIdResponseAllOf.php new file mode 100644 index 00000000..79f60391 --- /dev/null +++ b/lib/Model/SubscriptionsIdResponseAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SubscriptionsIdResponseAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'SubscriptionsIdResponse_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\SubscriptionItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\SubscriptionItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\SubscriptionItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Team.php b/lib/Model/Team.php new file mode 100644 index 00000000..b3f66ced --- /dev/null +++ b/lib/Model/Team.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Team implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Team'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseTeam' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseTeam|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseTeam|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/TeamAllOf.php b/lib/Model/TeamAllOf.php new file mode 100644 index 00000000..7807431a --- /dev/null +++ b/lib/Model/TeamAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TeamAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Team_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseTeam' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseTeam|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseTeam|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/TeamId.php b/lib/Model/TeamId.php new file mode 100644 index 00000000..93e6359c --- /dev/null +++ b/lib/Model/TeamId.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TeamId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'TeamId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The team ID + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Teams.php b/lib/Model/Teams.php new file mode 100644 index 00000000..f53dde70 --- /dev/null +++ b/lib/Model/Teams.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Teams implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Teams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseTeam[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseTeam[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseTeam[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/TeamsAllOf.php b/lib/Model/TeamsAllOf.php new file mode 100644 index 00000000..8311d603 --- /dev/null +++ b/lib/Model/TeamsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TeamsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Teams_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseTeam[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseTeam[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseTeam[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Unauthorized.php b/lib/Model/Unauthorized.php new file mode 100644 index 00000000..76f85833 --- /dev/null +++ b/lib/Model/Unauthorized.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Unauthorized implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'unauthorized'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'error' => 'string', + 'error_code' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'error' => null, + 'error_code' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'error' => 'error', + 'error_code' => 'errorCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'error' => 'setError', + 'error_code' => 'setErrorCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'error' => 'getError', + 'error_code' => 'getErrorCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['error'] = $data['error'] ?? null; + $this->container['error_code'] = $data['error_code'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The error message + * + * @return self + */ + public function setError($error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets error_code + * + * @return int|null + */ + public function getErrorCode() + { + return $this->container['error_code']; + } + + /** + * Sets error_code + * + * @param int|null $error_code The response error code + * + * @return self + */ + public function setErrorCode($error_code): self + { + $this->container['error_code'] = $error_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateActivityResponse200.php b/lib/Model/UpdateActivityResponse200.php new file mode 100644 index 00000000..4f05d521 --- /dev/null +++ b/lib/Model/UpdateActivityResponse200.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateActivityResponse200 implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'updateActivityResponse200'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ActivityResponseObject', + 'related_objects' => '\Pipedrive\Model\AddActivityResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success success + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ActivityResponseObject|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ActivityResponseObject|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\AddActivityResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\AddActivityResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateDealProduct.php b/lib/Model/UpdateDealProduct.php new file mode 100644 index 00000000..020e7e73 --- /dev/null +++ b/lib/Model/UpdateDealProduct.php @@ -0,0 +1,615 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateDealProduct implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateDealProduct'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'product_id' => 'int', + 'item_price' => 'float', + 'quantity' => 'int', + 'discount_percentage' => 'float', + 'duration' => 'float', + 'duration_unit' => 'DealProductUnitDuration', + 'product_variation_id' => 'int', + 'comments' => 'string', + 'tax' => 'float', + 'enabled_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'item_price' => null, + 'quantity' => null, + 'discount_percentage' => null, + 'duration' => null, + 'duration_unit' => null, + 'product_variation_id' => null, + 'comments' => null, + 'tax' => null, + 'enabled_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'item_price' => 'item_price', + 'quantity' => 'quantity', + 'discount_percentage' => 'discount_percentage', + 'duration' => 'duration', + 'duration_unit' => 'duration_unit', + 'product_variation_id' => 'product_variation_id', + 'comments' => 'comments', + 'tax' => 'tax', + 'enabled_flag' => 'enabled_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'item_price' => 'setItemPrice', + 'quantity' => 'setQuantity', + 'discount_percentage' => 'setDiscountPercentage', + 'duration' => 'setDuration', + 'duration_unit' => 'setDurationUnit', + 'product_variation_id' => 'setProductVariationId', + 'comments' => 'setComments', + 'tax' => 'setTax', + 'enabled_flag' => 'setEnabledFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'item_price' => 'getItemPrice', + 'quantity' => 'getQuantity', + 'discount_percentage' => 'getDiscountPercentage', + 'duration' => 'getDuration', + 'duration_unit' => 'getDurationUnit', + 'product_variation_id' => 'getProductVariationId', + 'comments' => 'getComments', + 'tax' => 'getTax', + 'enabled_flag' => 'getEnabledFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['product_id'] = $data['product_id'] ?? null; + $this->container['item_price'] = $data['item_price'] ?? null; + $this->container['quantity'] = $data['quantity'] ?? null; + $this->container['discount_percentage'] = $data['discount_percentage'] ?? 0; + $this->container['duration'] = $data['duration'] ?? 1; + $this->container['duration_unit'] = $data['duration_unit'] ?? null; + $this->container['product_variation_id'] = $data['product_variation_id'] ?? null; + $this->container['comments'] = $data['comments'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['enabled_flag'] = $data['enabled_flag'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' 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 product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id The ID of the product to use + * + * @return self + */ + public function setProductId($product_id): self + { + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets item_price + * + * @return float|null + */ + public function getItemPrice() + { + return $this->container['item_price']; + } + + /** + * Sets item_price + * + * @param float|null $item_price The price at which this product will be added to the deal + * + * @return self + */ + public function setItemPrice($item_price): self + { + $this->container['item_price'] = $item_price; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity How many items of this product will be added to the deal + * + * @return self + */ + public function setQuantity($quantity): self + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets discount_percentage + * + * @return float|null + */ + public function getDiscountPercentage() + { + return $this->container['discount_percentage']; + } + + /** + * Sets discount_percentage + * + * @param float|null $discount_percentage The discount %. If omitted, will be set to 0. + * + * @return self + */ + public function setDiscountPercentage($discount_percentage): self + { + $this->container['discount_percentage'] = $discount_percentage; + + return $this; + } + + /** + * Gets duration + * + * @return float|null + */ + public function getDuration() + { + return $this->container['duration']; + } + + /** + * Sets duration + * + * @param float|null $duration The duration of the product + * + * @return self + */ + public function setDuration($duration): self + { + $this->container['duration'] = $duration; + + return $this; + } + + /** + * Gets duration_unit + * + * @return DealProductUnitDuration|null + */ + public function getDurationUnit() + { + return $this->container['duration_unit']; + } + + /** + * Sets duration_unit + * + * @param DealProductUnitDuration|null $duration_unit The unit duration of the product + * + * @return self + */ + public function setDurationUnit($duration_unit): self + { + $this->container['duration_unit'] = $duration_unit; + + return $this; + } + + /** + * Gets product_variation_id + * + * @return int|null + */ + public function getProductVariationId() + { + return $this->container['product_variation_id']; + } + + /** + * Sets product_variation_id + * + * @param int|null $product_variation_id The ID of the product variation to use. When omitted, no variation will be used. + * + * @return self + */ + public function setProductVariationId($product_variation_id): self + { + $this->container['product_variation_id'] = $product_variation_id; + + return $this; + } + + /** + * Gets comments + * + * @return string|null + */ + public function getComments() + { + return $this->container['comments']; + } + + /** + * Sets comments + * + * @param string|null $comments A textual comment associated with this product-deal attachment + * + * @return self + */ + public function setComments($comments): self + { + $this->container['comments'] = $comments; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets enabled_flag + * + * @return bool|null + */ + public function getEnabledFlag() + { + return $this->container['enabled_flag']; + } + + /** + * Sets enabled_flag + * + * @param bool|null $enabled_flag Whether the product is enabled for a deal or not. This makes it possible to add products to a deal with a specific price and discount criteria, but keep them disabled, which refrains them from being included in the deal value calculation. When omitted, the product will be marked as enabled by default. + * + * @return self + */ + public function setEnabledFlag($enabled_flag): self + { + $this->container['enabled_flag'] = $enabled_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateDealRequest.php b/lib/Model/UpdateDealRequest.php new file mode 100644 index 00000000..67af7533 --- /dev/null +++ b/lib/Model/UpdateDealRequest.php @@ -0,0 +1,742 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateDealRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateDealRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'value' => 'string', + 'currency' => 'string', + 'user_id' => 'int', + 'person_id' => 'int', + 'org_id' => 'int', + 'pipeline_id' => 'int', + 'stage_id' => 'int', + 'status' => 'string', + 'expected_close_date' => '\DateTime', + 'probability' => 'float', + 'lost_reason' => 'string', + 'visible_to' => '\Pipedrive\Model\VisibleTo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'value' => null, + 'currency' => null, + 'user_id' => null, + 'person_id' => null, + 'org_id' => null, + 'pipeline_id' => null, + 'stage_id' => null, + 'status' => null, + 'expected_close_date' => 'date', + 'probability' => null, + 'lost_reason' => null, + 'visible_to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'value' => 'value', + 'currency' => 'currency', + 'user_id' => 'user_id', + 'person_id' => 'person_id', + 'org_id' => 'org_id', + 'pipeline_id' => 'pipeline_id', + 'stage_id' => 'stage_id', + 'status' => 'status', + 'expected_close_date' => 'expected_close_date', + 'probability' => 'probability', + 'lost_reason' => 'lost_reason', + 'visible_to' => 'visible_to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'value' => 'setValue', + 'currency' => 'setCurrency', + 'user_id' => 'setUserId', + 'person_id' => 'setPersonId', + 'org_id' => 'setOrgId', + 'pipeline_id' => 'setPipelineId', + 'stage_id' => 'setStageId', + 'status' => 'setStatus', + 'expected_close_date' => 'setExpectedCloseDate', + 'probability' => 'setProbability', + 'lost_reason' => 'setLostReason', + 'visible_to' => 'setVisibleTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'value' => 'getValue', + 'currency' => 'getCurrency', + 'user_id' => 'getUserId', + 'person_id' => 'getPersonId', + 'org_id' => 'getOrgId', + 'pipeline_id' => 'getPipelineId', + 'stage_id' => 'getStageId', + 'status' => 'getStatus', + 'expected_close_date' => 'getExpectedCloseDate', + 'probability' => 'getProbability', + 'lost_reason' => 'getLostReason', + 'visible_to' => 'getVisibleTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const STATUS_OPEN = 'open'; + const STATUS_WON = 'won'; + const STATUS_LOST = 'lost'; + const STATUS_DELETED = 'deleted'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getStatusAllowableValues(): array + { + return [ + self::STATUS_OPEN, + self::STATUS_WON, + self::STATUS_LOST, + self::STATUS_DELETED, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['currency'] = $data['currency'] ?? null; + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['stage_id'] = $data['stage_id'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['probability'] = $data['probability'] ?? null; + $this->container['lost_reason'] = $data['lost_reason'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The title of the deal + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value of the deal. If omitted, value will be set to 0. + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. + * + * @return self + */ + public function setCurrency($currency): self + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user which will be the owner of the created deal. If not provided, the user making the request will be used. + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of a person which this deal will be linked to. If the person does not exist yet, it needs to be created first. This property is required unless `org_id` is specified. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of an organization which this deal will be linked to. If the organization does not exist yet, it needs to be created first. This property is required unless `person_id` is specified. + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline this deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored. + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets stage_id + * + * @return int|null + */ + public function getStageId() + { + return $this->container['stage_id']; + } + + /** + * Sets stage_id + * + * @param int|null $stage_id The ID of the stage this deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline. + * + * @return self + */ + public function setStageId($stage_id): self + { + $this->container['stage_id'] = $stage_id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. + * + * @return self + */ + public function setStatus($status): self + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The expected close date of the deal. In ISO 8601 format: YYYY-MM-DD. + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets probability + * + * @return float|null + */ + public function getProbability() + { + return $this->container['probability']; + } + + /** + * Sets probability + * + * @param float|null $probability The success probability percentage of the deal. Used/shown only when `deal_probability` for the pipeline of the deal is enabled. + * + * @return self + */ + public function setProbability($probability): self + { + $this->container['probability'] = $probability; + + return $this; + } + + /** + * Gets lost_reason + * + * @return string|null + */ + public function getLostReason() + { + return $this->container['lost_reason']; + } + + /** + * Sets lost_reason + * + * @param string|null $lost_reason The optional message about why the deal was lost (to be used when status = lost) + * + * @return self + */ + public function setLostReason($lost_reason): self + { + $this->container['lost_reason'] = $lost_reason; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the deal. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateFile.php b/lib/Model/UpdateFile.php new file mode 100644 index 00000000..fee644dc --- /dev/null +++ b/lib/Model/UpdateFile.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateFile implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\FileData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the request was successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\FileData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\FileData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateFilterRequest.php b/lib/Model/UpdateFilterRequest.php new file mode 100644 index 00000000..9aa5158d --- /dev/null +++ b/lib/Model/UpdateFilterRequest.php @@ -0,0 +1,375 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateFilterRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'updateFilterRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'conditions' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'conditions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'conditions' => 'conditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'conditions' => 'setConditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'conditions' => 'getConditions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['conditions'] = $data['conditions'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['conditions'] === null) { + $invalidProperties[] = "'conditions' 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the filter + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets conditions + * + * @return object + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param object $conditions The conditions of the filter as a JSON object. Please note that a maximum of 16 conditions is allowed per filter and `date` values must be supplied in the `YYYY-MM-DD` format. It requires a minimum structure as follows: `{\"glue\":\"and\",\"conditions\":[{\"glue\":\"and\",\"conditions\": [CONDITION_OBJECTS]},{\"glue\":\"or\",\"conditions\":[CONDITION_OBJECTS]}]}`. Replace `CONDITION_OBJECTS` with JSON objects of the following structure: `{\"object\":\"\",\"field_id\":\"\", \"operator\":\"\",\"value\":\"\", \"extra_value\":\"\"}` or leave the array empty. Depending on the object type you should use another API endpoint to get `field_id`. There are five types of objects you can choose from: `\"person\"`, `\"deal\"`, `\"organization\"`, `\"product\"`, `\"activity\"` and you can use these types of operators depending on what type of a field you have: `\"IS NOT NULL\"`, `\"IS NULL\"`, `\"<=\"`, `\">=\"`, `\"<\"`, `\">\"`, `\"!=\"`, `\"=\"`, `\"LIKE '$%'\"`, `\"LIKE '%$%'\"`, `\"NOT LIKE '$%'\"`. To get a better understanding of how filters work try creating them directly from the Pipedrive application. + * + * @return self + */ + public function setConditions($conditions): self + { + $this->container['conditions'] = $conditions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateLeadLabelRequest.php b/lib/Model/UpdateLeadLabelRequest.php new file mode 100644 index 00000000..ee9c40ed --- /dev/null +++ b/lib/Model/UpdateLeadLabelRequest.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateLeadLabelRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'updateLeadLabelRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'color' => '\Pipedrive\Model\LeadLabelColor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'color' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'color' => 'color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'color' => 'setColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'color' => 'getColor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['color'] = $data['color'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the lead label + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets color + * + * @return \Pipedrive\Model\LeadLabelColor|null + */ + public function getColor() + { + return $this->container['color']; + } + + /** + * Sets color + * + * @param \Pipedrive\Model\LeadLabelColor|null $color color + * + * @return self + */ + public function setColor($color): self + { + $this->container['color'] = $color; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateLeadRequest.php b/lib/Model/UpdateLeadRequest.php new file mode 100644 index 00000000..40228379 --- /dev/null +++ b/lib/Model/UpdateLeadRequest.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateLeadRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'updateLeadRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'title' => 'string', + 'owner_id' => 'int', + 'label_ids' => 'string[]', + 'person_id' => 'int', + 'organization_id' => 'int', + 'is_archived' => 'bool', + 'value' => '\Pipedrive\Model\LeadValue', + 'expected_close_date' => '\DateTime', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'was_seen' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'owner_id' => null, + 'label_ids' => 'uuid', + 'person_id' => null, + 'organization_id' => null, + 'is_archived' => null, + 'value' => null, + 'expected_close_date' => 'date', + 'visible_to' => null, + 'was_seen' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'owner_id' => 'owner_id', + 'label_ids' => 'label_ids', + 'person_id' => 'person_id', + 'organization_id' => 'organization_id', + 'is_archived' => 'is_archived', + 'value' => 'value', + 'expected_close_date' => 'expected_close_date', + 'visible_to' => 'visible_to', + 'was_seen' => 'was_seen' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'owner_id' => 'setOwnerId', + 'label_ids' => 'setLabelIds', + 'person_id' => 'setPersonId', + 'organization_id' => 'setOrganizationId', + 'is_archived' => 'setIsArchived', + 'value' => 'setValue', + 'expected_close_date' => 'setExpectedCloseDate', + 'visible_to' => 'setVisibleTo', + 'was_seen' => 'setWasSeen' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'owner_id' => 'getOwnerId', + 'label_ids' => 'getLabelIds', + 'person_id' => 'getPersonId', + 'organization_id' => 'getOrganizationId', + 'is_archived' => 'getIsArchived', + 'value' => 'getValue', + 'expected_close_date' => 'getExpectedCloseDate', + 'visible_to' => 'getVisibleTo', + 'was_seen' => 'getWasSeen' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['label_ids'] = $data['label_ids'] ?? null; + $this->container['person_id'] = $data['person_id'] ?? null; + $this->container['organization_id'] = $data['organization_id'] ?? null; + $this->container['is_archived'] = $data['is_archived'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['expected_close_date'] = $data['expected_close_date'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['was_seen'] = $data['was_seen'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title The name of the lead + * + * @return self + */ + public function setTitle($title): self + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user which will be the owner of the created lead. If not provided, the user making the request will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets label_ids + * + * @return string[]|null + */ + public function getLabelIds() + { + return $this->container['label_ids']; + } + + /** + * Sets label_ids + * + * @param string[]|null $label_ids The IDs of the lead labels which will be associated with the lead + * + * @return self + */ + public function setLabelIds($label_ids): self + { + $this->container['label_ids'] = $label_ids; + + return $this; + } + + /** + * Gets person_id + * + * @return int|null + */ + public function getPersonId() + { + return $this->container['person_id']; + } + + /** + * Sets person_id + * + * @param int|null $person_id The ID of a person which this lead will be linked to. If the person does not exist yet, it needs to be created first. A lead always has to be linked to a person or organization or both. + * + * @return self + */ + public function setPersonId($person_id): self + { + $this->container['person_id'] = $person_id; + + return $this; + } + + /** + * Gets organization_id + * + * @return int|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param int|null $organization_id The ID of an organization which this lead will be linked to. If the organization does not exist yet, it needs to be created first. A lead always has to be linked to a person or organization or both. + * + * @return self + */ + public function setOrganizationId($organization_id): self + { + $this->container['organization_id'] = $organization_id; + + return $this; + } + + /** + * Gets is_archived + * + * @return bool|null + */ + public function getIsArchived() + { + return $this->container['is_archived']; + } + + /** + * Sets is_archived + * + * @param bool|null $is_archived A flag indicating whether the lead is archived or not + * + * @return self + */ + public function setIsArchived($is_archived): self + { + $this->container['is_archived'] = $is_archived; + + return $this; + } + + /** + * Gets value + * + * @return \Pipedrive\Model\LeadValue|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Pipedrive\Model\LeadValue|null $value value + * + * @return self + */ + public function setValue($value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets expected_close_date + * + * @return \DateTime|null + */ + public function getExpectedCloseDate() + { + return $this->container['expected_close_date']; + } + + /** + * Sets expected_close_date + * + * @param \DateTime|null $expected_close_date The date of when the deal which will be created from the lead is expected to be closed. In ISO 8601 format: YYYY-MM-DD. + * + * @return self + */ + public function setExpectedCloseDate($expected_close_date): self + { + $this->container['expected_close_date'] = $expected_close_date; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the lead. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets was_seen + * + * @return bool|null + */ + public function getWasSeen() + { + return $this->container['was_seen']; + } + + /** + * Sets was_seen + * + * @param bool|null $was_seen A flag indicating whether the lead was seen by someone in the Pipedrive UI + * + * @return self + */ + public function setWasSeen($was_seen): self + { + $this->container['was_seen'] = $was_seen; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateOrganization.php b/lib/Model/UpdateOrganization.php new file mode 100644 index 00000000..fda85f96 --- /dev/null +++ b/lib/Model/UpdateOrganization.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateOrganization implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateOrganization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'visible_to' => '\Pipedrive\Model\VisibleTo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'visible_to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'visible_to' => 'visible_to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'visible_to' => 'setVisibleTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'visible_to' => 'getVisibleTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the organization. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateOrganizationAllOf.php b/lib/Model/UpdateOrganizationAllOf.php new file mode 100644 index 00000000..58102d65 --- /dev/null +++ b/lib/Model/UpdateOrganizationAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateOrganizationAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateOrganization_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the organization + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdatePerson.php b/lib/Model/UpdatePerson.php new file mode 100644 index 00000000..7a94b27c --- /dev/null +++ b/lib/Model/UpdatePerson.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatePerson implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdatePerson'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'owner_id' => 'int', + 'org_id' => 'int', + 'email' => '\Pipedrive\Model\BasicPersonEmail[]', + 'phone' => '\Pipedrive\Model\BasePersonItemPhone[]', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'marketing_status' => '\Pipedrive\Model\MarketingStatus', + 'add_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'owner_id' => null, + 'org_id' => null, + 'email' => null, + 'phone' => null, + 'visible_to' => null, + 'marketing_status' => null, + 'add_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'owner_id' => 'owner_id', + 'org_id' => 'org_id', + 'email' => 'email', + 'phone' => 'phone', + 'visible_to' => 'visible_to', + 'marketing_status' => 'marketing_status', + 'add_time' => 'add_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'owner_id' => 'setOwnerId', + 'org_id' => 'setOrgId', + 'email' => 'setEmail', + 'phone' => 'setPhone', + 'visible_to' => 'setVisibleTo', + 'marketing_status' => 'setMarketingStatus', + 'add_time' => 'setAddTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'owner_id' => 'getOwnerId', + 'org_id' => 'getOrgId', + 'email' => 'getEmail', + 'phone' => 'getPhone', + 'visible_to' => 'getVisibleTo', + 'marketing_status' => 'getMarketingStatus', + 'add_time' => 'getAddTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['org_id'] = $data['org_id'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['phone'] = $data['phone'] ?? null; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['marketing_status'] = $data['marketing_status'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets org_id + * + * @return int|null + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param int|null $org_id The ID of the organization this person will belong to + * + * @return self + */ + public function setOrgId($org_id): self + { + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets email + * + * @return \Pipedrive\Model\BasicPersonEmail[]|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param \Pipedrive\Model\BasicPersonEmail[]|null $email An email address as a string or an array of email objects related to the person. The structure of the array is as follows: `[{ \"value\": \"mail@example.com\", \"primary\": \"true\", \"label\": \"main\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone + * + * @return \Pipedrive\Model\BasePersonItemPhone[]|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param \Pipedrive\Model\BasePersonItemPhone[]|null $phone A phone number supplied as a string or an array of phone objects related to the person. The structure of the array is as follows: `[{ \"value\": \"12345\", \"primary\": \"true\", \"label\": \"mobile\" }]`. Please note that only `value` is required. + * + * @return self + */ + public function setPhone($phone): self + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the person. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets marketing_status + * + * @return MarketingStatus|null + */ + public function getMarketingStatus() + { + return $this->container['marketing_status']; + } + + /** + * Sets marketing_status + * + * @param MarketingStatus|null $marketing_status If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
+ * + * @return self + */ + public function setMarketingStatus($marketing_status): self + { + $this->container['marketing_status'] = $marketing_status; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdatePersonAllOf.php b/lib/Model/UpdatePersonAllOf.php new file mode 100644 index 00000000..aa381194 --- /dev/null +++ b/lib/Model/UpdatePersonAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatePersonAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdatePerson_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the person + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdatePersonResponse.php b/lib/Model/UpdatePersonResponse.php new file mode 100644 index 00000000..25132129 --- /dev/null +++ b/lib/Model/UpdatePersonResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatePersonResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdatePersonResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\PersonItem', + 'related_objects' => '\Pipedrive\Model\ListProductsResponseAllOfRelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\PersonItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\PersonItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\ListProductsResponseAllOfRelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateProductField.php b/lib/Model/UpdateProductField.php new file mode 100644 index 00000000..bb5a8066 --- /dev/null +++ b/lib/Model/UpdateProductField.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateProductField implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateProductField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'options' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'options' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'options' => 'options' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'options' => 'setOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'options' => 'getOptions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['options'] = $data['options'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the field + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return object[]|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param object[]|null $options When `field_type` is either set or enum, possible options on update must be supplied as an array of objects each containing id and label, for example: [{\"id\":1, \"label\":\"red\"},{\"id\":2, \"label\":\"blue\"},{\"id\":3, \"label\":\"lilac\"}] + * + * @return self + */ + public function setOptions($options): self + { + $this->container['options'] = $options; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateProductRequestBody.php b/lib/Model/UpdateProductRequestBody.php new file mode 100644 index 00000000..2750950c --- /dev/null +++ b/lib/Model/UpdateProductRequestBody.php @@ -0,0 +1,585 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateProductRequestBody implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateProductRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'code' => 'string', + 'unit' => 'string', + 'tax' => 'float', + 'active_flag' => 'bool', + 'selectable' => 'bool', + 'visible_to' => '\Pipedrive\Model\VisibleTo', + 'owner_id' => 'int', + 'prices' => 'object[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'code' => null, + 'unit' => null, + 'tax' => null, + 'active_flag' => null, + 'selectable' => null, + 'visible_to' => null, + 'owner_id' => null, + 'prices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'code' => 'code', + 'unit' => 'unit', + 'tax' => 'tax', + 'active_flag' => 'active_flag', + 'selectable' => 'selectable', + 'visible_to' => 'visible_to', + 'owner_id' => 'owner_id', + 'prices' => 'prices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'code' => 'setCode', + 'unit' => 'setUnit', + 'tax' => 'setTax', + 'active_flag' => 'setActiveFlag', + 'selectable' => 'setSelectable', + 'visible_to' => 'setVisibleTo', + 'owner_id' => 'setOwnerId', + 'prices' => 'setPrices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'code' => 'getCode', + 'unit' => 'getUnit', + 'tax' => 'getTax', + 'active_flag' => 'getActiveFlag', + 'selectable' => 'getSelectable', + 'visible_to' => 'getVisibleTo', + 'owner_id' => 'getOwnerId', + 'prices' => 'getPrices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['unit'] = $data['unit'] ?? null; + $this->container['tax'] = $data['tax'] ?? 0; + $this->container['active_flag'] = $data['active_flag'] ?? true; + $this->container['selectable'] = $data['selectable'] ?? true; + $this->container['visible_to'] = $data['visible_to'] ?? null; + $this->container['owner_id'] = $data['owner_id'] ?? null; + $this->container['prices'] = $data['prices'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the product + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The product code + * + * @return self + */ + public function setCode($code): self + { + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit The unit in which this product is sold + * + * @return self + */ + public function setUnit($unit): self + { + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets tax + * + * @return float|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param float|null $tax The tax percentage + * + * @return self + */ + public function setTax($tax): self + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether this product will be made active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets selectable + * + * @return bool|null + */ + public function getSelectable() + { + return $this->container['selectable']; + } + + /** + * Sets selectable + * + * @param bool|null $selectable Whether this product can be selected in deals or not + * + * @return self + */ + public function setSelectable($selectable): self + { + $this->container['selectable'] = $selectable; + + return $this; + } + + /** + * Gets visible_to + * + * @return VisibleTo|null + */ + public function getVisibleTo() + { + return $this->container['visible_to']; + } + + /** + * Sets visible_to + * + * @param VisibleTo|null $visible_to The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner's visibility group
`5`Owner's visibility group and sub-groups
`7`Entire company
+ * + * @return self + */ + public function setVisibleTo($visible_to): self + { + $this->container['visible_to'] = $visible_to; + + return $this; + } + + /** + * Gets owner_id + * + * @return int|null + */ + public function getOwnerId() + { + return $this->container['owner_id']; + } + + /** + * Sets owner_id + * + * @param int|null $owner_id The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. + * + * @return self + */ + public function setOwnerId($owner_id): self + { + $this->container['owner_id'] = $owner_id; + + return $this; + } + + /** + * Gets prices + * + * @return object[]|null + */ + public function getPrices() + { + return $this->container['prices']; + } + + /** + * Sets prices + * + * @param object[]|null $prices An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `overhead_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and a default currency based on the company's currency will be assigned. + * + * @return self + */ + public function setPrices($prices): self + { + $this->container['prices'] = $prices; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateProductResponse.php b/lib/Model/UpdateProductResponse.php new file mode 100644 index 00000000..b97d0ab4 --- /dev/null +++ b/lib/Model/UpdateProductResponse.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateProductResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateProductResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\ProductWithObjectPrices', + 'related_objects' => '\Pipedrive\Model\GetActivitiesResponse200RelatedObjects' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null, + 'related_objects' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data', + 'related_objects' => 'related_objects' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData', + 'related_objects' => 'setRelatedObjects' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData', + 'related_objects' => 'getRelatedObjects' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + $this->container['related_objects'] = $data['related_objects'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\ProductWithObjectPrices|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\ProductWithObjectPrices|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets related_objects + * + * @return \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null + */ + public function getRelatedObjects() + { + return $this->container['related_objects']; + } + + /** + * Sets related_objects + * + * @param \Pipedrive\Model\GetActivitiesResponse200RelatedObjects|null $related_objects related_objects + * + * @return self + */ + public function setRelatedObjects($related_objects): self + { + $this->container['related_objects'] = $related_objects; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateStageRequest.php b/lib/Model/UpdateStageRequest.php new file mode 100644 index 00000000..de96a381 --- /dev/null +++ b/lib/Model/UpdateStageRequest.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateStageRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateStageRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'pipeline_id' => 'int', + 'deal_probability' => 'int', + 'rotten_flag' => 'bool', + 'rotten_days' => 'int', + 'order_nr' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'pipeline_id' => null, + 'deal_probability' => null, + 'rotten_flag' => null, + 'rotten_days' => null, + 'order_nr' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'pipeline_id' => 'pipeline_id', + 'deal_probability' => 'deal_probability', + 'rotten_flag' => 'rotten_flag', + 'rotten_days' => 'rotten_days', + 'order_nr' => 'order_nr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'pipeline_id' => 'setPipelineId', + 'deal_probability' => 'setDealProbability', + 'rotten_flag' => 'setRottenFlag', + 'rotten_days' => 'setRottenDays', + 'order_nr' => 'setOrderNr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'pipeline_id' => 'getPipelineId', + 'deal_probability' => 'getDealProbability', + 'rotten_flag' => 'getRottenFlag', + 'rotten_days' => 'getRottenDays', + 'order_nr' => 'getOrderNr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['pipeline_id'] = $data['pipeline_id'] ?? null; + $this->container['deal_probability'] = $data['deal_probability'] ?? null; + $this->container['rotten_flag'] = $data['rotten_flag'] ?? null; + $this->container['rotten_days'] = $data['rotten_days'] ?? null; + $this->container['order_nr'] = $data['order_nr'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the stage + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets pipeline_id + * + * @return int|null + */ + public function getPipelineId() + { + return $this->container['pipeline_id']; + } + + /** + * Sets pipeline_id + * + * @param int|null $pipeline_id The ID of the pipeline to add stage to + * + * @return self + */ + public function setPipelineId($pipeline_id): self + { + $this->container['pipeline_id'] = $pipeline_id; + + return $this; + } + + /** + * Gets deal_probability + * + * @return int|null + */ + public function getDealProbability() + { + return $this->container['deal_probability']; + } + + /** + * Sets deal_probability + * + * @param int|null $deal_probability The success probability percentage of the deal. Used/shown when deal weighted values are used. + * + * @return self + */ + public function setDealProbability($deal_probability): self + { + $this->container['deal_probability'] = $deal_probability; + + return $this; + } + + /** + * Gets rotten_flag + * + * @return bool|null + */ + public function getRottenFlag() + { + return $this->container['rotten_flag']; + } + + /** + * Sets rotten_flag + * + * @param bool|null $rotten_flag Whether deals in this stage can become rotten + * + * @return self + */ + public function setRottenFlag($rotten_flag): self + { + $this->container['rotten_flag'] = $rotten_flag; + + return $this; + } + + /** + * Gets rotten_days + * + * @return int|null + */ + public function getRottenDays() + { + return $this->container['rotten_days']; + } + + /** + * Sets rotten_days + * + * @param int|null $rotten_days The number of days the deals not updated in this stage would become rotten. Applies only if the `rotten_flag` is set. + * + * @return self + */ + public function setRottenDays($rotten_days): self + { + $this->container['rotten_days'] = $rotten_days; + + return $this; + } + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr An order number for this stage. Order numbers should be used to order the stages in the pipeline. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateStageRequestAllOf.php b/lib/Model/UpdateStageRequestAllOf.php new file mode 100644 index 00000000..a6aaaaf1 --- /dev/null +++ b/lib/Model/UpdateStageRequestAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateStageRequestAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateStageRequest_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'order_nr' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'order_nr' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_nr' => 'order_nr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_nr' => 'setOrderNr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_nr' => 'getOrderNr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['order_nr'] = $data['order_nr'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_nr + * + * @return int|null + */ + public function getOrderNr() + { + return $this->container['order_nr']; + } + + /** + * Sets order_nr + * + * @param int|null $order_nr An order number for this stage. Order numbers should be used to order the stages in the pipeline. + * + * @return self + */ + public function setOrderNr($order_nr): self + { + $this->container['order_nr'] = $order_nr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateTeam.php b/lib/Model/UpdateTeam.php new file mode 100644 index 00000000..5c1abfa4 --- /dev/null +++ b/lib/Model/UpdateTeam.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateTeam implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateTeam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'manager_id' => 'int', + 'users' => 'int[]', + 'active_flag' => '\Pipedrive\Model\NumberBoolean', + 'deleted_flag' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'manager_id' => null, + 'users' => null, + 'active_flag' => null, + 'deleted_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'manager_id' => 'manager_id', + 'users' => 'users', + 'active_flag' => 'active_flag', + 'deleted_flag' => 'deleted_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'manager_id' => 'setManagerId', + 'users' => 'setUsers', + 'active_flag' => 'setActiveFlag', + 'deleted_flag' => 'setDeletedFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'manager_id' => 'getManagerId', + 'users' => 'getUsers', + 'active_flag' => 'getActiveFlag', + 'deleted_flag' => 'getDeletedFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['manager_id'] = $data['manager_id'] ?? null; + $this->container['users'] = $data['users'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The team name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The team description + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets manager_id + * + * @return int|null + */ + public function getManagerId() + { + return $this->container['manager_id']; + } + + /** + * Sets manager_id + * + * @param int|null $manager_id The team manager ID + * + * @return self + */ + public function setManagerId($manager_id): self + { + $this->container['manager_id'] = $manager_id; + + return $this; + } + + /** + * Gets users + * + * @return int[]|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param int[]|null $users The list of user IDs + * + * @return self + */ + public function setUsers($users): self + { + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets active_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $active_flag Flag that indicates whether the team is active + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $deleted_flag Flag that indicates whether the team is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateTeamAllOf.php b/lib/Model/UpdateTeamAllOf.php new file mode 100644 index 00000000..9339ac26 --- /dev/null +++ b/lib/Model/UpdateTeamAllOf.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateTeamAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateTeam_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => '\Pipedrive\Model\NumberBoolean', + 'deleted_flag' => '\Pipedrive\Model\NumberBoolean' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null, + 'deleted_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag', + 'deleted_flag' => 'deleted_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag', + 'deleted_flag' => 'setDeletedFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag', + 'deleted_flag' => 'getDeletedFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets active_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $active_flag Flag that indicates whether the team is active + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $deleted_flag Flag that indicates whether the team is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateTeamWithAdditionalProperties.php b/lib/Model/UpdateTeamWithAdditionalProperties.php new file mode 100644 index 00000000..edbb3900 --- /dev/null +++ b/lib/Model/UpdateTeamWithAdditionalProperties.php @@ -0,0 +1,552 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateTeamWithAdditionalProperties implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UpdateTeamWithAdditionalProperties'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'manager_id' => 'int', + 'users' => 'int[]', + 'active_flag' => '\Pipedrive\Model\NumberBoolean', + 'deleted_flag' => '\Pipedrive\Model\NumberBoolean', + 'add_time' => 'string', + 'created_by_user_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'manager_id' => null, + 'users' => null, + 'active_flag' => null, + 'deleted_flag' => null, + 'add_time' => null, + 'created_by_user_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'manager_id' => 'manager_id', + 'users' => 'users', + 'active_flag' => 'active_flag', + 'deleted_flag' => 'deleted_flag', + 'add_time' => 'add_time', + 'created_by_user_id' => 'created_by_user_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'manager_id' => 'setManagerId', + 'users' => 'setUsers', + 'active_flag' => 'setActiveFlag', + 'deleted_flag' => 'setDeletedFlag', + 'add_time' => 'setAddTime', + 'created_by_user_id' => 'setCreatedByUserId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'manager_id' => 'getManagerId', + 'users' => 'getUsers', + 'active_flag' => 'getActiveFlag', + 'deleted_flag' => 'getDeletedFlag', + 'add_time' => 'getAddTime', + 'created_by_user_id' => 'getCreatedByUserId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['manager_id'] = $data['manager_id'] ?? null; + $this->container['users'] = $data['users'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + $this->container['deleted_flag'] = $data['deleted_flag'] ?? null; + $this->container['add_time'] = $data['add_time'] ?? null; + $this->container['created_by_user_id'] = $data['created_by_user_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The team name + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The team description + * + * @return self + */ + public function setDescription($description): self + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets manager_id + * + * @return int|null + */ + public function getManagerId() + { + return $this->container['manager_id']; + } + + /** + * Sets manager_id + * + * @param int|null $manager_id The team manager ID + * + * @return self + */ + public function setManagerId($manager_id): self + { + $this->container['manager_id'] = $manager_id; + + return $this; + } + + /** + * Gets users + * + * @return int[]|null + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param int[]|null $users The list of user IDs + * + * @return self + */ + public function setUsers($users): self + { + $this->container['users'] = $users; + + return $this; + } + + /** + * Gets active_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $active_flag Flag that indicates whether the team is active + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + + /** + * Gets deleted_flag + * + * @return \Pipedrive\Model\NumberBoolean|null + */ + public function getDeletedFlag() + { + return $this->container['deleted_flag']; + } + + /** + * Sets deleted_flag + * + * @param \Pipedrive\Model\NumberBoolean|null $deleted_flag Flag that indicates whether the team is deleted + * + * @return self + */ + public function setDeletedFlag($deleted_flag): self + { + $this->container['deleted_flag'] = $deleted_flag; + + return $this; + } + + /** + * Gets add_time + * + * @return string|null + */ + public function getAddTime() + { + return $this->container['add_time']; + } + + /** + * Sets add_time + * + * @param string|null $add_time The team creation time. Format: YYYY-MM-DD HH:MM:SS + * + * @return self + */ + public function setAddTime($add_time): self + { + $this->container['add_time'] = $add_time; + + return $this; + } + + /** + * Gets created_by_user_id + * + * @return int|null + */ + public function getCreatedByUserId() + { + return $this->container['created_by_user_id']; + } + + /** + * Sets created_by_user_id + * + * @param int|null $created_by_user_id The ID of the user who created the team + * + * @return self + */ + public function setCreatedByUserId($created_by_user_id): self + { + $this->container['created_by_user_id'] = $created_by_user_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UpdateUserRequest.php b/lib/Model/UpdateUserRequest.php new file mode 100644 index 00000000..08853c53 --- /dev/null +++ b/lib/Model/UpdateUserRequest.php @@ -0,0 +1,345 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'updateUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if ($this->container['active_flag'] === null) { + $invalidProperties[] = "'active_flag' 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 active_flag + * + * @return bool + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool $active_flag Whether the user is active or not. `false` = Not activated, `true` = Activated + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/User.php b/lib/Model/User.php new file mode 100644 index 00000000..e81ee746 --- /dev/null +++ b/lib/Model/User.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +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 string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseUser' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUser|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUser|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserAccess.php b/lib/Model/UserAccess.php new file mode 100644 index 00000000..8c9a3e07 --- /dev/null +++ b/lib/Model/UserAccess.php @@ -0,0 +1,444 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserAccess implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserAccess'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'app' => 'string', + 'admin' => 'bool', + 'permission_set_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'app' => null, + 'admin' => null, + 'permission_set_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'app' => 'app', + 'admin' => 'admin', + 'permission_set_id' => 'permission_set_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'app' => 'setApp', + 'admin' => 'setAdmin', + 'permission_set_id' => 'setPermissionSetId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'app' => 'getApp', + 'admin' => 'getAdmin', + 'permission_set_id' => 'getPermissionSetId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + const APP_SALES = 'sales'; + const APP_PROJECTS = 'projects'; + const APP_CAMPAIGNS = 'campaigns'; + const APP__GLOBAL = 'global'; + const APP_ACCOUNT_SETTINGS = 'account_settings'; + + /** + * Gets allowable values of the enum + * + * @phpstan-return array + * @phpsalm-return array + * @return (string|int)[] + */ + public function getAppAllowableValues(): array + { + return [ + self::APP_SALES, + self::APP_PROJECTS, + self::APP_CAMPAIGNS, + self::APP__GLOBAL, + self::APP_ACCOUNT_SETTINGS, + ]; + } + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['app'] = $data['app'] ?? null; + $this->container['admin'] = $data['admin'] ?? null; + $this->container['permission_set_id'] = $data['permission_set_id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + $allowedValues = $this->getAppAllowableValues(); + if (!is_null($this->container['app']) && !in_array($this->container['app'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'app', must be one of '%s'", + $this->container['app'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets app + * + * @return string|null + */ + public function getApp() + { + return $this->container['app']; + } + + /** + * Sets app + * + * @param string|null $app app + * + * @return self + */ + public function setApp($app): self + { + $allowedValues = $this->getAppAllowableValues(); + if (!is_null($app) && !in_array($app, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'app', must be one of '%s'", + $app, + implode("', '", $allowedValues) + ) + ); + } + $this->container['app'] = $app; + + return $this; + } + + /** + * Gets admin + * + * @return bool|null + */ + public function getAdmin() + { + return $this->container['admin']; + } + + /** + * Sets admin + * + * @param bool|null $admin admin + * + * @return self + */ + public function setAdmin($admin): self + { + $this->container['admin'] = $admin; + + return $this; + } + + /** + * Gets permission_set_id + * + * @return string|null + */ + public function getPermissionSetId() + { + return $this->container['permission_set_id']; + } + + /** + * Sets permission_set_id + * + * @param string|null $permission_set_id permission_set_id + * + * @return self + */ + public function setPermissionSetId($permission_set_id): self + { + $this->container['permission_set_id'] = $permission_set_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserAllOf.php b/lib/Model/UserAllOf.php new file mode 100644 index 00000000..1bff86a3 --- /dev/null +++ b/lib/Model/UserAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'User_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseUser' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUser|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUser|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserAssignmentToPermissionSet.php b/lib/Model/UserAssignmentToPermissionSet.php new file mode 100644 index 00000000..e7afdc95 --- /dev/null +++ b/lib/Model/UserAssignmentToPermissionSet.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserAssignmentToPermissionSet implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserAssignmentToPermissionSet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'user_id' => 'int', + 'permission_set_id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => null, + 'permission_set_id' => null, + 'name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'user_id', + 'permission_set_id' => 'permission_set_id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'permission_set_id' => 'setPermissionSetId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'permission_set_id' => 'getPermissionSetId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['user_id'] = $data['user_id'] ?? null; + $this->container['permission_set_id'] = $data['permission_set_id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return int|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param int|null $user_id The ID of the user in the permission set + * + * @return self + */ + public function setUserId($user_id): self + { + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets permission_set_id + * + * @return string|null + */ + public function getPermissionSetId() + { + return $this->container['permission_set_id']; + } + + /** + * Sets permission_set_id + * + * @param string|null $permission_set_id The ID of the permission set + * + * @return self + */ + public function setPermissionSetId($permission_set_id): self + { + $this->container['permission_set_id'] = $permission_set_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the permission set + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserAssignmentsToPermissionSet.php b/lib/Model/UserAssignmentsToPermissionSet.php new file mode 100644 index 00000000..c5d0b4e4 --- /dev/null +++ b/lib/Model/UserAssignmentsToPermissionSet.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserAssignmentsToPermissionSet implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserAssignmentsToPermissionSet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\UserAssignmentToPermissionSet[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\UserAssignmentToPermissionSet[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserAssignmentToPermissionSet[]|null $data An array of the assignments of the user + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserAssignmentsToPermissionSetAllOf.php b/lib/Model/UserAssignmentsToPermissionSetAllOf.php new file mode 100644 index 00000000..3685e0a6 --- /dev/null +++ b/lib/Model/UserAssignmentsToPermissionSetAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserAssignmentsToPermissionSetAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserAssignmentsToPermissionSet_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\UserAssignmentToPermissionSet[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\UserAssignmentToPermissionSet[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserAssignmentToPermissionSet[]|null $data An array of the assignments of the user + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserConnections.php b/lib/Model/UserConnections.php new file mode 100644 index 00000000..cde828c5 --- /dev/null +++ b/lib/Model/UserConnections.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserConnections implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserConnections'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\UserConnectionsAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\UserConnectionsAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserConnectionsAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserConnectionsAllOf.php b/lib/Model/UserConnectionsAllOf.php new file mode 100644 index 00000000..3b78f1c4 --- /dev/null +++ b/lib/Model/UserConnectionsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserConnectionsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserConnections_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\UserConnectionsAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\UserConnectionsAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserConnectionsAllOfData|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserConnectionsAllOfData.php b/lib/Model/UserConnectionsAllOfData.php new file mode 100644 index 00000000..6d769e46 --- /dev/null +++ b/lib/Model/UserConnectionsAllOfData.php @@ -0,0 +1,343 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserConnectionsAllOfData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserConnections_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'google' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'google' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'google' => 'google' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'google' => 'setGoogle' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'google' => 'getGoogle' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['google'] = $data['google'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets google + * + * @return string|null + */ + public function getGoogle() + { + return $this->container['google']; + } + + /** + * Sets google + * + * @param string|null $google The third party ID or false in case the ID is not found + * + * @return self + */ + public function setGoogle($google): self + { + $this->container['google'] = $google; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserData.php b/lib/Model/UserData.php new file mode 100644 index 00000000..6baaadad --- /dev/null +++ b/lib/Model/UserData.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserData implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'has_pic' => 'int', + 'pic_hash' => 'string', + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'has_pic' => null, + 'pic_hash' => null, + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'has_pic' => 'has_pic', + 'pic_hash' => 'pic_hash', + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'has_pic' => 'setHasPic', + 'pic_hash' => 'setPicHash', + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'has_pic' => 'getHasPic', + 'pic_hash' => 'getPicHash', + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['has_pic'] = $data['has_pic'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the user + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the user + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets has_pic + * + * @return int|null + */ + public function getHasPic() + { + return $this->container['has_pic']; + } + + /** + * Sets has_pic + * + * @param int|null $has_pic Whether the user has picture or not. 0 = No picture, 1 = Has picture. + * + * @return self + */ + public function setHasPic($has_pic): self + { + $this->container['has_pic'] = $has_pic; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The user picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserDataWithId.php b/lib/Model/UserDataWithId.php new file mode 100644 index 00000000..6a2a16d2 --- /dev/null +++ b/lib/Model/UserDataWithId.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserDataWithId implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserDataWithId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'email' => 'string', + 'has_pic' => 'int', + 'pic_hash' => 'string', + 'active_flag' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'email' => null, + 'has_pic' => null, + 'pic_hash' => null, + 'active_flag' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'email' => 'email', + 'has_pic' => 'has_pic', + 'pic_hash' => 'pic_hash', + 'active_flag' => 'active_flag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'email' => 'setEmail', + 'has_pic' => 'setHasPic', + 'pic_hash' => 'setPicHash', + 'active_flag' => 'setActiveFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'email' => 'getEmail', + 'has_pic' => 'getHasPic', + 'pic_hash' => 'getPicHash', + 'active_flag' => 'getActiveFlag' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['email'] = $data['email'] ?? null; + $this->container['has_pic'] = $data['has_pic'] ?? null; + $this->container['pic_hash'] = $data['pic_hash'] ?? null; + $this->container['active_flag'] = $data['active_flag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the 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() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the user + * + * @return self + */ + public function setId($id): self + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the user + * + * @return self + */ + public function setName($name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The email of the user + * + * @return self + */ + public function setEmail($email): self + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets has_pic + * + * @return int|null + */ + public function getHasPic() + { + return $this->container['has_pic']; + } + + /** + * Sets has_pic + * + * @param int|null $has_pic Whether the user has picture or not. 0 = No picture, 1 = Has picture. + * + * @return self + */ + public function setHasPic($has_pic): self + { + $this->container['has_pic'] = $has_pic; + + return $this; + } + + /** + * Gets pic_hash + * + * @return string|null + */ + public function getPicHash() + { + return $this->container['pic_hash']; + } + + /** + * Sets pic_hash + * + * @param string|null $pic_hash The user picture hash + * + * @return self + */ + public function setPicHash($pic_hash): self + { + $this->container['pic_hash'] = $pic_hash; + + return $this; + } + + /** + * Gets active_flag + * + * @return bool|null + */ + public function getActiveFlag() + { + return $this->container['active_flag']; + } + + /** + * Sets active_flag + * + * @param bool|null $active_flag Whether the user is active or not + * + * @return self + */ + public function setActiveFlag($active_flag): self + { + $this->container['active_flag'] = $active_flag; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserIDs.php b/lib/Model/UserIDs.php new file mode 100644 index 00000000..36e6b64f --- /dev/null +++ b/lib/Model/UserIDs.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserIDs implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserIDs'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return int[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param int[]|null $data The list of user IDs + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserIDsAllOf.php b/lib/Model/UserIDsAllOf.php new file mode 100644 index 00000000..12395b59 --- /dev/null +++ b/lib/Model/UserIDsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserIDsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserIDs_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return int[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param int[]|null $data The list of user IDs + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserMe.php b/lib/Model/UserMe.php new file mode 100644 index 00000000..f17713af --- /dev/null +++ b/lib/Model/UserMe.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserMe implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserMe'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseUserMe' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUserMe|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUserMe|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserMeAllOf.php b/lib/Model/UserMeAllOf.php new file mode 100644 index 00000000..4441c895 --- /dev/null +++ b/lib/Model/UserMeAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserMeAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserMe_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseUserMe' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUserMe|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUserMe|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserPermissions.php b/lib/Model/UserPermissions.php new file mode 100644 index 00000000..b38b954b --- /dev/null +++ b/lib/Model/UserPermissions.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserPermissions implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserPermissions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\UserPermissionsItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\UserPermissionsItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserPermissionsItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserPermissionsAllOf.php b/lib/Model/UserPermissionsAllOf.php new file mode 100644 index 00000000..f584a4c0 --- /dev/null +++ b/lib/Model/UserPermissionsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserPermissionsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserPermissions_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\UserPermissionsItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\UserPermissionsItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserPermissionsItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserPermissionsItem.php b/lib/Model/UserPermissionsItem.php new file mode 100644 index 00000000..50fb6321 --- /dev/null +++ b/lib/Model/UserPermissionsItem.php @@ -0,0 +1,1242 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserPermissionsItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserPermissionsItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'can_add_custom_fields' => 'bool', + 'can_add_products' => 'bool', + 'can_add_prospects_as_leads' => 'bool', + 'can_bulk_edit_items' => 'bool', + 'can_change_visibility_of_items' => 'bool', + 'can_convert_deals_to_leads' => 'bool', + 'can_create_own_workflow' => 'bool', + 'can_delete_activities' => 'bool', + 'can_delete_custom_fields' => 'bool', + 'can_delete_deals' => 'bool', + 'can_edit_custom_fields' => 'bool', + 'can_edit_deals_closed_date' => 'bool', + 'can_edit_products' => 'bool', + 'can_edit_shared_filters' => 'bool', + 'can_export_data_from_lists' => 'bool', + 'can_follow_other_users' => 'bool', + 'can_merge_deals' => 'bool', + 'can_merge_organizations' => 'bool', + 'can_merge_people' => 'bool', + 'can_modify_labels' => 'bool', + 'can_see_company_wide_statistics' => 'bool', + 'can_see_deals_list_summary' => 'bool', + 'can_see_hidden_items_names' => 'bool', + 'can_see_other_users' => 'bool', + 'can_see_other_users_statistics' => 'bool', + 'can_see_security_dashboard' => 'bool', + 'can_share_filters' => 'bool', + 'can_share_insights' => 'bool', + 'can_use_api' => 'bool', + 'can_use_email_tracking' => 'bool', + 'can_use_import' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'can_add_custom_fields' => null, + 'can_add_products' => null, + 'can_add_prospects_as_leads' => null, + 'can_bulk_edit_items' => null, + 'can_change_visibility_of_items' => null, + 'can_convert_deals_to_leads' => null, + 'can_create_own_workflow' => null, + 'can_delete_activities' => null, + 'can_delete_custom_fields' => null, + 'can_delete_deals' => null, + 'can_edit_custom_fields' => null, + 'can_edit_deals_closed_date' => null, + 'can_edit_products' => null, + 'can_edit_shared_filters' => null, + 'can_export_data_from_lists' => null, + 'can_follow_other_users' => null, + 'can_merge_deals' => null, + 'can_merge_organizations' => null, + 'can_merge_people' => null, + 'can_modify_labels' => null, + 'can_see_company_wide_statistics' => null, + 'can_see_deals_list_summary' => null, + 'can_see_hidden_items_names' => null, + 'can_see_other_users' => null, + 'can_see_other_users_statistics' => null, + 'can_see_security_dashboard' => null, + 'can_share_filters' => null, + 'can_share_insights' => null, + 'can_use_api' => null, + 'can_use_email_tracking' => null, + 'can_use_import' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'can_add_custom_fields' => 'can_add_custom_fields', + 'can_add_products' => 'can_add_products', + 'can_add_prospects_as_leads' => 'can_add_prospects_as_leads', + 'can_bulk_edit_items' => 'can_bulk_edit_items', + 'can_change_visibility_of_items' => 'can_change_visibility_of_items', + 'can_convert_deals_to_leads' => 'can_convert_deals_to_leads', + 'can_create_own_workflow' => 'can_create_own_workflow', + 'can_delete_activities' => 'can_delete_activities', + 'can_delete_custom_fields' => 'can_delete_custom_fields', + 'can_delete_deals' => 'can_delete_deals', + 'can_edit_custom_fields' => 'can_edit_custom_fields', + 'can_edit_deals_closed_date' => 'can_edit_deals_closed_date', + 'can_edit_products' => 'can_edit_products', + 'can_edit_shared_filters' => 'can_edit_shared_filters', + 'can_export_data_from_lists' => 'can_export_data_from_lists', + 'can_follow_other_users' => 'can_follow_other_users', + 'can_merge_deals' => 'can_merge_deals', + 'can_merge_organizations' => 'can_merge_organizations', + 'can_merge_people' => 'can_merge_people', + 'can_modify_labels' => 'can_modify_labels', + 'can_see_company_wide_statistics' => 'can_see_company_wide_statistics', + 'can_see_deals_list_summary' => 'can_see_deals_list_summary', + 'can_see_hidden_items_names' => 'can_see_hidden_items_names', + 'can_see_other_users' => 'can_see_other_users', + 'can_see_other_users_statistics' => 'can_see_other_users_statistics', + 'can_see_security_dashboard' => 'can_see_security_dashboard', + 'can_share_filters' => 'can_share_filters', + 'can_share_insights' => 'can_share_insights', + 'can_use_api' => 'can_use_api', + 'can_use_email_tracking' => 'can_use_email_tracking', + 'can_use_import' => 'can_use_import' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'can_add_custom_fields' => 'setCanAddCustomFields', + 'can_add_products' => 'setCanAddProducts', + 'can_add_prospects_as_leads' => 'setCanAddProspectsAsLeads', + 'can_bulk_edit_items' => 'setCanBulkEditItems', + 'can_change_visibility_of_items' => 'setCanChangeVisibilityOfItems', + 'can_convert_deals_to_leads' => 'setCanConvertDealsToLeads', + 'can_create_own_workflow' => 'setCanCreateOwnWorkflow', + 'can_delete_activities' => 'setCanDeleteActivities', + 'can_delete_custom_fields' => 'setCanDeleteCustomFields', + 'can_delete_deals' => 'setCanDeleteDeals', + 'can_edit_custom_fields' => 'setCanEditCustomFields', + 'can_edit_deals_closed_date' => 'setCanEditDealsClosedDate', + 'can_edit_products' => 'setCanEditProducts', + 'can_edit_shared_filters' => 'setCanEditSharedFilters', + 'can_export_data_from_lists' => 'setCanExportDataFromLists', + 'can_follow_other_users' => 'setCanFollowOtherUsers', + 'can_merge_deals' => 'setCanMergeDeals', + 'can_merge_organizations' => 'setCanMergeOrganizations', + 'can_merge_people' => 'setCanMergePeople', + 'can_modify_labels' => 'setCanModifyLabels', + 'can_see_company_wide_statistics' => 'setCanSeeCompanyWideStatistics', + 'can_see_deals_list_summary' => 'setCanSeeDealsListSummary', + 'can_see_hidden_items_names' => 'setCanSeeHiddenItemsNames', + 'can_see_other_users' => 'setCanSeeOtherUsers', + 'can_see_other_users_statistics' => 'setCanSeeOtherUsersStatistics', + 'can_see_security_dashboard' => 'setCanSeeSecurityDashboard', + 'can_share_filters' => 'setCanShareFilters', + 'can_share_insights' => 'setCanShareInsights', + 'can_use_api' => 'setCanUseApi', + 'can_use_email_tracking' => 'setCanUseEmailTracking', + 'can_use_import' => 'setCanUseImport' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'can_add_custom_fields' => 'getCanAddCustomFields', + 'can_add_products' => 'getCanAddProducts', + 'can_add_prospects_as_leads' => 'getCanAddProspectsAsLeads', + 'can_bulk_edit_items' => 'getCanBulkEditItems', + 'can_change_visibility_of_items' => 'getCanChangeVisibilityOfItems', + 'can_convert_deals_to_leads' => 'getCanConvertDealsToLeads', + 'can_create_own_workflow' => 'getCanCreateOwnWorkflow', + 'can_delete_activities' => 'getCanDeleteActivities', + 'can_delete_custom_fields' => 'getCanDeleteCustomFields', + 'can_delete_deals' => 'getCanDeleteDeals', + 'can_edit_custom_fields' => 'getCanEditCustomFields', + 'can_edit_deals_closed_date' => 'getCanEditDealsClosedDate', + 'can_edit_products' => 'getCanEditProducts', + 'can_edit_shared_filters' => 'getCanEditSharedFilters', + 'can_export_data_from_lists' => 'getCanExportDataFromLists', + 'can_follow_other_users' => 'getCanFollowOtherUsers', + 'can_merge_deals' => 'getCanMergeDeals', + 'can_merge_organizations' => 'getCanMergeOrganizations', + 'can_merge_people' => 'getCanMergePeople', + 'can_modify_labels' => 'getCanModifyLabels', + 'can_see_company_wide_statistics' => 'getCanSeeCompanyWideStatistics', + 'can_see_deals_list_summary' => 'getCanSeeDealsListSummary', + 'can_see_hidden_items_names' => 'getCanSeeHiddenItemsNames', + 'can_see_other_users' => 'getCanSeeOtherUsers', + 'can_see_other_users_statistics' => 'getCanSeeOtherUsersStatistics', + 'can_see_security_dashboard' => 'getCanSeeSecurityDashboard', + 'can_share_filters' => 'getCanShareFilters', + 'can_share_insights' => 'getCanShareInsights', + 'can_use_api' => 'getCanUseApi', + 'can_use_email_tracking' => 'getCanUseEmailTracking', + 'can_use_import' => 'getCanUseImport' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['can_add_custom_fields'] = $data['can_add_custom_fields'] ?? null; + $this->container['can_add_products'] = $data['can_add_products'] ?? null; + $this->container['can_add_prospects_as_leads'] = $data['can_add_prospects_as_leads'] ?? null; + $this->container['can_bulk_edit_items'] = $data['can_bulk_edit_items'] ?? null; + $this->container['can_change_visibility_of_items'] = $data['can_change_visibility_of_items'] ?? null; + $this->container['can_convert_deals_to_leads'] = $data['can_convert_deals_to_leads'] ?? null; + $this->container['can_create_own_workflow'] = $data['can_create_own_workflow'] ?? null; + $this->container['can_delete_activities'] = $data['can_delete_activities'] ?? null; + $this->container['can_delete_custom_fields'] = $data['can_delete_custom_fields'] ?? null; + $this->container['can_delete_deals'] = $data['can_delete_deals'] ?? null; + $this->container['can_edit_custom_fields'] = $data['can_edit_custom_fields'] ?? null; + $this->container['can_edit_deals_closed_date'] = $data['can_edit_deals_closed_date'] ?? null; + $this->container['can_edit_products'] = $data['can_edit_products'] ?? null; + $this->container['can_edit_shared_filters'] = $data['can_edit_shared_filters'] ?? null; + $this->container['can_export_data_from_lists'] = $data['can_export_data_from_lists'] ?? null; + $this->container['can_follow_other_users'] = $data['can_follow_other_users'] ?? null; + $this->container['can_merge_deals'] = $data['can_merge_deals'] ?? null; + $this->container['can_merge_organizations'] = $data['can_merge_organizations'] ?? null; + $this->container['can_merge_people'] = $data['can_merge_people'] ?? null; + $this->container['can_modify_labels'] = $data['can_modify_labels'] ?? null; + $this->container['can_see_company_wide_statistics'] = $data['can_see_company_wide_statistics'] ?? null; + $this->container['can_see_deals_list_summary'] = $data['can_see_deals_list_summary'] ?? null; + $this->container['can_see_hidden_items_names'] = $data['can_see_hidden_items_names'] ?? null; + $this->container['can_see_other_users'] = $data['can_see_other_users'] ?? null; + $this->container['can_see_other_users_statistics'] = $data['can_see_other_users_statistics'] ?? null; + $this->container['can_see_security_dashboard'] = $data['can_see_security_dashboard'] ?? null; + $this->container['can_share_filters'] = $data['can_share_filters'] ?? null; + $this->container['can_share_insights'] = $data['can_share_insights'] ?? null; + $this->container['can_use_api'] = $data['can_use_api'] ?? null; + $this->container['can_use_email_tracking'] = $data['can_use_email_tracking'] ?? null; + $this->container['can_use_import'] = $data['can_use_import'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets can_add_custom_fields + * + * @return bool|null + */ + public function getCanAddCustomFields() + { + return $this->container['can_add_custom_fields']; + } + + /** + * Sets can_add_custom_fields + * + * @param bool|null $can_add_custom_fields If the user can add custom fields + * + * @return self + */ + public function setCanAddCustomFields($can_add_custom_fields): self + { + $this->container['can_add_custom_fields'] = $can_add_custom_fields; + + return $this; + } + + /** + * Gets can_add_products + * + * @return bool|null + */ + public function getCanAddProducts() + { + return $this->container['can_add_products']; + } + + /** + * Sets can_add_products + * + * @param bool|null $can_add_products If the user can add products + * + * @return self + */ + public function setCanAddProducts($can_add_products): self + { + $this->container['can_add_products'] = $can_add_products; + + return $this; + } + + /** + * Gets can_add_prospects_as_leads + * + * @return bool|null + */ + public function getCanAddProspectsAsLeads() + { + return $this->container['can_add_prospects_as_leads']; + } + + /** + * Sets can_add_prospects_as_leads + * + * @param bool|null $can_add_prospects_as_leads If the user can add prospects as leads + * + * @return self + */ + public function setCanAddProspectsAsLeads($can_add_prospects_as_leads): self + { + $this->container['can_add_prospects_as_leads'] = $can_add_prospects_as_leads; + + return $this; + } + + /** + * Gets can_bulk_edit_items + * + * @return bool|null + */ + public function getCanBulkEditItems() + { + return $this->container['can_bulk_edit_items']; + } + + /** + * Sets can_bulk_edit_items + * + * @param bool|null $can_bulk_edit_items If the user can bulk edit items + * + * @return self + */ + public function setCanBulkEditItems($can_bulk_edit_items): self + { + $this->container['can_bulk_edit_items'] = $can_bulk_edit_items; + + return $this; + } + + /** + * Gets can_change_visibility_of_items + * + * @return bool|null + */ + public function getCanChangeVisibilityOfItems() + { + return $this->container['can_change_visibility_of_items']; + } + + /** + * Sets can_change_visibility_of_items + * + * @param bool|null $can_change_visibility_of_items If the user can change visibility of items + * + * @return self + */ + public function setCanChangeVisibilityOfItems($can_change_visibility_of_items): self + { + $this->container['can_change_visibility_of_items'] = $can_change_visibility_of_items; + + return $this; + } + + /** + * Gets can_convert_deals_to_leads + * + * @return bool|null + */ + public function getCanConvertDealsToLeads() + { + return $this->container['can_convert_deals_to_leads']; + } + + /** + * Sets can_convert_deals_to_leads + * + * @param bool|null $can_convert_deals_to_leads If the user can convert deals to leads + * + * @return self + */ + public function setCanConvertDealsToLeads($can_convert_deals_to_leads): self + { + $this->container['can_convert_deals_to_leads'] = $can_convert_deals_to_leads; + + return $this; + } + + /** + * Gets can_create_own_workflow + * + * @return bool|null + */ + public function getCanCreateOwnWorkflow() + { + return $this->container['can_create_own_workflow']; + } + + /** + * Sets can_create_own_workflow + * + * @param bool|null $can_create_own_workflow If the user can create workflows + * + * @return self + */ + public function setCanCreateOwnWorkflow($can_create_own_workflow): self + { + $this->container['can_create_own_workflow'] = $can_create_own_workflow; + + return $this; + } + + /** + * Gets can_delete_activities + * + * @return bool|null + */ + public function getCanDeleteActivities() + { + return $this->container['can_delete_activities']; + } + + /** + * Sets can_delete_activities + * + * @param bool|null $can_delete_activities If the user can delete activities + * + * @return self + */ + public function setCanDeleteActivities($can_delete_activities): self + { + $this->container['can_delete_activities'] = $can_delete_activities; + + return $this; + } + + /** + * Gets can_delete_custom_fields + * + * @return bool|null + */ + public function getCanDeleteCustomFields() + { + return $this->container['can_delete_custom_fields']; + } + + /** + * Sets can_delete_custom_fields + * + * @param bool|null $can_delete_custom_fields If the user can delete custom fields + * + * @return self + */ + public function setCanDeleteCustomFields($can_delete_custom_fields): self + { + $this->container['can_delete_custom_fields'] = $can_delete_custom_fields; + + return $this; + } + + /** + * Gets can_delete_deals + * + * @return bool|null + */ + public function getCanDeleteDeals() + { + return $this->container['can_delete_deals']; + } + + /** + * Sets can_delete_deals + * + * @param bool|null $can_delete_deals If the user can delete deals + * + * @return self + */ + public function setCanDeleteDeals($can_delete_deals): self + { + $this->container['can_delete_deals'] = $can_delete_deals; + + return $this; + } + + /** + * Gets can_edit_custom_fields + * + * @return bool|null + */ + public function getCanEditCustomFields() + { + return $this->container['can_edit_custom_fields']; + } + + /** + * Sets can_edit_custom_fields + * + * @param bool|null $can_edit_custom_fields If the user can edit custom fields + * + * @return self + */ + public function setCanEditCustomFields($can_edit_custom_fields): self + { + $this->container['can_edit_custom_fields'] = $can_edit_custom_fields; + + return $this; + } + + /** + * Gets can_edit_deals_closed_date + * + * @return bool|null + */ + public function getCanEditDealsClosedDate() + { + return $this->container['can_edit_deals_closed_date']; + } + + /** + * Sets can_edit_deals_closed_date + * + * @param bool|null $can_edit_deals_closed_date If the user can edit deals' closed date + * + * @return self + */ + public function setCanEditDealsClosedDate($can_edit_deals_closed_date): self + { + $this->container['can_edit_deals_closed_date'] = $can_edit_deals_closed_date; + + return $this; + } + + /** + * Gets can_edit_products + * + * @return bool|null + */ + public function getCanEditProducts() + { + return $this->container['can_edit_products']; + } + + /** + * Sets can_edit_products + * + * @param bool|null $can_edit_products If the user can edit products + * + * @return self + */ + public function setCanEditProducts($can_edit_products): self + { + $this->container['can_edit_products'] = $can_edit_products; + + return $this; + } + + /** + * Gets can_edit_shared_filters + * + * @return bool|null + */ + public function getCanEditSharedFilters() + { + return $this->container['can_edit_shared_filters']; + } + + /** + * Sets can_edit_shared_filters + * + * @param bool|null $can_edit_shared_filters If the user can edit shared filters + * + * @return self + */ + public function setCanEditSharedFilters($can_edit_shared_filters): self + { + $this->container['can_edit_shared_filters'] = $can_edit_shared_filters; + + return $this; + } + + /** + * Gets can_export_data_from_lists + * + * @return bool|null + */ + public function getCanExportDataFromLists() + { + return $this->container['can_export_data_from_lists']; + } + + /** + * Sets can_export_data_from_lists + * + * @param bool|null $can_export_data_from_lists If the user can export data from item lists + * + * @return self + */ + public function setCanExportDataFromLists($can_export_data_from_lists): self + { + $this->container['can_export_data_from_lists'] = $can_export_data_from_lists; + + return $this; + } + + /** + * Gets can_follow_other_users + * + * @return bool|null + */ + public function getCanFollowOtherUsers() + { + return $this->container['can_follow_other_users']; + } + + /** + * Sets can_follow_other_users + * + * @param bool|null $can_follow_other_users If the user can follow other users + * + * @return self + */ + public function setCanFollowOtherUsers($can_follow_other_users): self + { + $this->container['can_follow_other_users'] = $can_follow_other_users; + + return $this; + } + + /** + * Gets can_merge_deals + * + * @return bool|null + */ + public function getCanMergeDeals() + { + return $this->container['can_merge_deals']; + } + + /** + * Sets can_merge_deals + * + * @param bool|null $can_merge_deals If the user can merge deals + * + * @return self + */ + public function setCanMergeDeals($can_merge_deals): self + { + $this->container['can_merge_deals'] = $can_merge_deals; + + return $this; + } + + /** + * Gets can_merge_organizations + * + * @return bool|null + */ + public function getCanMergeOrganizations() + { + return $this->container['can_merge_organizations']; + } + + /** + * Sets can_merge_organizations + * + * @param bool|null $can_merge_organizations If the user can merge organizations + * + * @return self + */ + public function setCanMergeOrganizations($can_merge_organizations): self + { + $this->container['can_merge_organizations'] = $can_merge_organizations; + + return $this; + } + + /** + * Gets can_merge_people + * + * @return bool|null + */ + public function getCanMergePeople() + { + return $this->container['can_merge_people']; + } + + /** + * Sets can_merge_people + * + * @param bool|null $can_merge_people If the user can merge people + * + * @return self + */ + public function setCanMergePeople($can_merge_people): self + { + $this->container['can_merge_people'] = $can_merge_people; + + return $this; + } + + /** + * Gets can_modify_labels + * + * @return bool|null + */ + public function getCanModifyLabels() + { + return $this->container['can_modify_labels']; + } + + /** + * Sets can_modify_labels + * + * @param bool|null $can_modify_labels If the user can modify labels + * + * @return self + */ + public function setCanModifyLabels($can_modify_labels): self + { + $this->container['can_modify_labels'] = $can_modify_labels; + + return $this; + } + + /** + * Gets can_see_company_wide_statistics + * + * @return bool|null + */ + public function getCanSeeCompanyWideStatistics() + { + return $this->container['can_see_company_wide_statistics']; + } + + /** + * Sets can_see_company_wide_statistics + * + * @param bool|null $can_see_company_wide_statistics If the user can see company-wide statistics + * + * @return self + */ + public function setCanSeeCompanyWideStatistics($can_see_company_wide_statistics): self + { + $this->container['can_see_company_wide_statistics'] = $can_see_company_wide_statistics; + + return $this; + } + + /** + * Gets can_see_deals_list_summary + * + * @return bool|null + */ + public function getCanSeeDealsListSummary() + { + return $this->container['can_see_deals_list_summary']; + } + + /** + * Sets can_see_deals_list_summary + * + * @param bool|null $can_see_deals_list_summary If the user can see the summary on the deals page + * + * @return self + */ + public function setCanSeeDealsListSummary($can_see_deals_list_summary): self + { + $this->container['can_see_deals_list_summary'] = $can_see_deals_list_summary; + + return $this; + } + + /** + * Gets can_see_hidden_items_names + * + * @return bool|null + */ + public function getCanSeeHiddenItemsNames() + { + return $this->container['can_see_hidden_items_names']; + } + + /** + * Sets can_see_hidden_items_names + * + * @param bool|null $can_see_hidden_items_names If the user can see the names of hidden items + * + * @return self + */ + public function setCanSeeHiddenItemsNames($can_see_hidden_items_names): self + { + $this->container['can_see_hidden_items_names'] = $can_see_hidden_items_names; + + return $this; + } + + /** + * Gets can_see_other_users + * + * @return bool|null + */ + public function getCanSeeOtherUsers() + { + return $this->container['can_see_other_users']; + } + + /** + * Sets can_see_other_users + * + * @param bool|null $can_see_other_users If the user can see other users + * + * @return self + */ + public function setCanSeeOtherUsers($can_see_other_users): self + { + $this->container['can_see_other_users'] = $can_see_other_users; + + return $this; + } + + /** + * Gets can_see_other_users_statistics + * + * @return bool|null + */ + public function getCanSeeOtherUsersStatistics() + { + return $this->container['can_see_other_users_statistics']; + } + + /** + * Sets can_see_other_users_statistics + * + * @param bool|null $can_see_other_users_statistics If the user can see other users' statistics + * + * @return self + */ + public function setCanSeeOtherUsersStatistics($can_see_other_users_statistics): self + { + $this->container['can_see_other_users_statistics'] = $can_see_other_users_statistics; + + return $this; + } + + /** + * Gets can_see_security_dashboard + * + * @return bool|null + */ + public function getCanSeeSecurityDashboard() + { + return $this->container['can_see_security_dashboard']; + } + + /** + * Sets can_see_security_dashboard + * + * @param bool|null $can_see_security_dashboard If the user can see security dashboard + * + * @return self + */ + public function setCanSeeSecurityDashboard($can_see_security_dashboard): self + { + $this->container['can_see_security_dashboard'] = $can_see_security_dashboard; + + return $this; + } + + /** + * Gets can_share_filters + * + * @return bool|null + */ + public function getCanShareFilters() + { + return $this->container['can_share_filters']; + } + + /** + * Sets can_share_filters + * + * @param bool|null $can_share_filters If the user can share filters + * + * @return self + */ + public function setCanShareFilters($can_share_filters): self + { + $this->container['can_share_filters'] = $can_share_filters; + + return $this; + } + + /** + * Gets can_share_insights + * + * @return bool|null + */ + public function getCanShareInsights() + { + return $this->container['can_share_insights']; + } + + /** + * Sets can_share_insights + * + * @param bool|null $can_share_insights If the user can share insights + * + * @return self + */ + public function setCanShareInsights($can_share_insights): self + { + $this->container['can_share_insights'] = $can_share_insights; + + return $this; + } + + /** + * Gets can_use_api + * + * @return bool|null + */ + public function getCanUseApi() + { + return $this->container['can_use_api']; + } + + /** + * Sets can_use_api + * + * @param bool|null $can_use_api If the user can use API + * + * @return self + */ + public function setCanUseApi($can_use_api): self + { + $this->container['can_use_api'] = $can_use_api; + + return $this; + } + + /** + * Gets can_use_email_tracking + * + * @return bool|null + */ + public function getCanUseEmailTracking() + { + return $this->container['can_use_email_tracking']; + } + + /** + * Sets can_use_email_tracking + * + * @param bool|null $can_use_email_tracking If the user can use email tracking + * + * @return self + */ + public function setCanUseEmailTracking($can_use_email_tracking): self + { + $this->container['can_use_email_tracking'] = $can_use_email_tracking; + + return $this; + } + + /** + * Gets can_use_import + * + * @return bool|null + */ + public function getCanUseImport() + { + return $this->container['can_use_import']; + } + + /** + * Sets can_use_import + * + * @param bool|null $can_use_import If the user can use import + * + * @return self + */ + public function setCanUseImport($can_use_import): self + { + $this->container['can_use_import'] = $can_use_import; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserSettings.php b/lib/Model/UserSettings.php new file mode 100644 index 00000000..16f865cb --- /dev/null +++ b/lib/Model/UserSettings.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserSettings implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\UserSettingsItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\UserSettingsItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserSettingsItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserSettingsAllOf.php b/lib/Model/UserSettingsAllOf.php new file mode 100644 index 00000000..945794b8 --- /dev/null +++ b/lib/Model/UserSettingsAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserSettingsAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserSettings_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\UserSettingsItem' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\UserSettingsItem|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\UserSettingsItem|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UserSettingsItem.php b/lib/Model/UserSettingsItem.php new file mode 100644 index 00000000..5394b6e2 --- /dev/null +++ b/lib/Model/UserSettingsItem.php @@ -0,0 +1,612 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserSettingsItem implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'UserSettingsItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'marketplace_allow_custom_install_url' => 'bool', + 'marketplace_app_extensions_vendor' => 'bool', + 'marketplace_team' => 'bool', + 'list_limit' => 'float', + 'beta_app' => 'bool', + 'prevent_salesphone_callto_override' => 'bool', + 'file_upload_destination' => 'string', + 'callto_link_syntax' => 'string', + 'autofill_deal_expected_close_date' => 'bool', + 'person_duplicate_condition' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'marketplace_allow_custom_install_url' => null, + 'marketplace_app_extensions_vendor' => null, + 'marketplace_team' => null, + 'list_limit' => null, + 'beta_app' => null, + 'prevent_salesphone_callto_override' => null, + 'file_upload_destination' => null, + 'callto_link_syntax' => null, + 'autofill_deal_expected_close_date' => null, + 'person_duplicate_condition' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'marketplace_allow_custom_install_url' => 'marketplace_allow_custom_install_url', + 'marketplace_app_extensions_vendor' => 'marketplace_app_extensions_vendor', + 'marketplace_team' => 'marketplace_team', + 'list_limit' => 'list_limit', + 'beta_app' => 'beta_app', + 'prevent_salesphone_callto_override' => 'prevent_salesphone_callto_override', + 'file_upload_destination' => 'file_upload_destination', + 'callto_link_syntax' => 'callto_link_syntax', + 'autofill_deal_expected_close_date' => 'autofill_deal_expected_close_date', + 'person_duplicate_condition' => 'person_duplicate_condition' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'marketplace_allow_custom_install_url' => 'setMarketplaceAllowCustomInstallUrl', + 'marketplace_app_extensions_vendor' => 'setMarketplaceAppExtensionsVendor', + 'marketplace_team' => 'setMarketplaceTeam', + 'list_limit' => 'setListLimit', + 'beta_app' => 'setBetaApp', + 'prevent_salesphone_callto_override' => 'setPreventSalesphoneCalltoOverride', + 'file_upload_destination' => 'setFileUploadDestination', + 'callto_link_syntax' => 'setCalltoLinkSyntax', + 'autofill_deal_expected_close_date' => 'setAutofillDealExpectedCloseDate', + 'person_duplicate_condition' => 'setPersonDuplicateCondition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'marketplace_allow_custom_install_url' => 'getMarketplaceAllowCustomInstallUrl', + 'marketplace_app_extensions_vendor' => 'getMarketplaceAppExtensionsVendor', + 'marketplace_team' => 'getMarketplaceTeam', + 'list_limit' => 'getListLimit', + 'beta_app' => 'getBetaApp', + 'prevent_salesphone_callto_override' => 'getPreventSalesphoneCalltoOverride', + 'file_upload_destination' => 'getFileUploadDestination', + 'callto_link_syntax' => 'getCalltoLinkSyntax', + 'autofill_deal_expected_close_date' => 'getAutofillDealExpectedCloseDate', + 'person_duplicate_condition' => 'getPersonDuplicateCondition' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['marketplace_allow_custom_install_url'] = $data['marketplace_allow_custom_install_url'] ?? null; + $this->container['marketplace_app_extensions_vendor'] = $data['marketplace_app_extensions_vendor'] ?? null; + $this->container['marketplace_team'] = $data['marketplace_team'] ?? null; + $this->container['list_limit'] = $data['list_limit'] ?? null; + $this->container['beta_app'] = $data['beta_app'] ?? null; + $this->container['prevent_salesphone_callto_override'] = $data['prevent_salesphone_callto_override'] ?? null; + $this->container['file_upload_destination'] = $data['file_upload_destination'] ?? null; + $this->container['callto_link_syntax'] = $data['callto_link_syntax'] ?? null; + $this->container['autofill_deal_expected_close_date'] = $data['autofill_deal_expected_close_date'] ?? null; + $this->container['person_duplicate_condition'] = $data['person_duplicate_condition'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets marketplace_allow_custom_install_url + * + * @return bool|null + */ + public function getMarketplaceAllowCustomInstallUrl() + { + return $this->container['marketplace_allow_custom_install_url']; + } + + /** + * Sets marketplace_allow_custom_install_url + * + * @param bool|null $marketplace_allow_custom_install_url If the vendors are allowed to install custom Marketplace apps with functionality and content in the Pipedrive UI or not + * + * @return self + */ + public function setMarketplaceAllowCustomInstallUrl($marketplace_allow_custom_install_url): self + { + $this->container['marketplace_allow_custom_install_url'] = $marketplace_allow_custom_install_url; + + return $this; + } + + /** + * Gets marketplace_app_extensions_vendor + * + * @return bool|null + */ + public function getMarketplaceAppExtensionsVendor() + { + return $this->container['marketplace_app_extensions_vendor']; + } + + /** + * Sets marketplace_app_extensions_vendor + * + * @param bool|null $marketplace_app_extensions_vendor If the vendors are allowed to extend their Marketplace apps with functionality and content in the Pipedrive UI or not + * + * @return self + */ + public function setMarketplaceAppExtensionsVendor($marketplace_app_extensions_vendor): self + { + $this->container['marketplace_app_extensions_vendor'] = $marketplace_app_extensions_vendor; + + return $this; + } + + /** + * Gets marketplace_team + * + * @return bool|null + */ + public function getMarketplaceTeam() + { + return $this->container['marketplace_team']; + } + + /** + * Sets marketplace_team + * + * @param bool|null $marketplace_team If the vendors are allowed to be part of the Marketplace team or not + * + * @return self + */ + public function setMarketplaceTeam($marketplace_team): self + { + $this->container['marketplace_team'] = $marketplace_team; + + return $this; + } + + /** + * Gets list_limit + * + * @return float|null + */ + public function getListLimit() + { + return $this->container['list_limit']; + } + + /** + * Sets list_limit + * + * @param float|null $list_limit The number of results shown in list by default + * + * @return self + */ + public function setListLimit($list_limit): self + { + $this->container['list_limit'] = $list_limit; + + return $this; + } + + /** + * Gets beta_app + * + * @return bool|null + */ + public function getBetaApp() + { + return $this->container['beta_app']; + } + + /** + * Sets beta_app + * + * @param bool|null $beta_app Whether beta app is enabled + * + * @return self + */ + public function setBetaApp($beta_app): self + { + $this->container['beta_app'] = $beta_app; + + return $this; + } + + /** + * Gets prevent_salesphone_callto_override + * + * @return bool|null + */ + public function getPreventSalesphoneCalltoOverride() + { + return $this->container['prevent_salesphone_callto_override']; + } + + /** + * Sets prevent_salesphone_callto_override + * + * @param bool|null $prevent_salesphone_callto_override Prevent salesphone call to override + * + * @return self + */ + public function setPreventSalesphoneCalltoOverride($prevent_salesphone_callto_override): self + { + $this->container['prevent_salesphone_callto_override'] = $prevent_salesphone_callto_override; + + return $this; + } + + /** + * Gets file_upload_destination + * + * @return string|null + */ + public function getFileUploadDestination() + { + return $this->container['file_upload_destination']; + } + + /** + * Sets file_upload_destination + * + * @param string|null $file_upload_destination The destination of file upload + * + * @return self + */ + public function setFileUploadDestination($file_upload_destination): self + { + $this->container['file_upload_destination'] = $file_upload_destination; + + return $this; + } + + /** + * Gets callto_link_syntax + * + * @return string|null + */ + public function getCalltoLinkSyntax() + { + return $this->container['callto_link_syntax']; + } + + /** + * Sets callto_link_syntax + * + * @param string|null $callto_link_syntax The call to link syntax + * + * @return self + */ + public function setCalltoLinkSyntax($callto_link_syntax): self + { + $this->container['callto_link_syntax'] = $callto_link_syntax; + + return $this; + } + + /** + * Gets autofill_deal_expected_close_date + * + * @return bool|null + */ + public function getAutofillDealExpectedCloseDate() + { + return $this->container['autofill_deal_expected_close_date']; + } + + /** + * Sets autofill_deal_expected_close_date + * + * @param bool|null $autofill_deal_expected_close_date Whether the expected close date of the deal is filled automatically or not + * + * @return self + */ + public function setAutofillDealExpectedCloseDate($autofill_deal_expected_close_date): self + { + $this->container['autofill_deal_expected_close_date'] = $autofill_deal_expected_close_date; + + return $this; + } + + /** + * Gets person_duplicate_condition + * + * @return string|null + */ + public function getPersonDuplicateCondition() + { + return $this->container['person_duplicate_condition']; + } + + /** + * Sets person_duplicate_condition + * + * @param string|null $person_duplicate_condition Allow the vendors to duplicate a person + * + * @return self + */ + public function setPersonDuplicateCondition($person_duplicate_condition): self + { + $this->container['person_duplicate_condition'] = $person_duplicate_condition; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Users.php b/lib/Model/Users.php new file mode 100644 index 00000000..734c1456 --- /dev/null +++ b/lib/Model/Users.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Users implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Users'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'data' => '\Pipedrive\Model\BaseUser[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUser[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUser[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/UsersAllOf.php b/lib/Model/UsersAllOf.php new file mode 100644 index 00000000..5c56fb20 --- /dev/null +++ b/lib/Model/UsersAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UsersAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Users_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseUser[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseUser[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseUser[]|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/VisibleTo.php b/lib/Model/VisibleTo.php new file mode 100644 index 00000000..7b3f4726 --- /dev/null +++ b/lib/Model/VisibleTo.php @@ -0,0 +1,68 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +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 string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'status' => 'string', + 'data' => '\Pipedrive\Model\BaseWebhook' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'status' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'status' => 'status', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'status' => 'setStatus', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'status' => 'getStatus', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the response + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseWebhook|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseWebhook|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/WebhookAllOf.php b/lib/Model/WebhookAllOf.php new file mode 100644 index 00000000..8429b539 --- /dev/null +++ b/lib/Model/WebhookAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class WebhookAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Webhook_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseWebhook' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseWebhook|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseWebhook|null $data data + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/WebhookBadRequest.php b/lib/Model/WebhookBadRequest.php new file mode 100644 index 00000000..fb5eb365 --- /dev/null +++ b/lib/Model/WebhookBadRequest.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class WebhookBadRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WebhookBadRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'status' => 'string', + 'errors' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'status' => null, + 'errors' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'status' => 'status', + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'status' => 'setStatus', + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'status' => 'getStatus', + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['errors'] = $data['errors'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the response + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets errors + * + * @return object|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param object|null $errors List of errors + * + * @return self + */ + public function setErrors($errors): self + { + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/WebhookBadRequestAllOf.php b/lib/Model/WebhookBadRequestAllOf.php new file mode 100644 index 00000000..e4a39753 --- /dev/null +++ b/lib/Model/WebhookBadRequestAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class WebhookBadRequestAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WebhookBadRequest_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'errors' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'errors' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['errors'] = $data['errors'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets errors + * + * @return object|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param object|null $errors List of errors + * + * @return self + */ + public function setErrors($errors): self + { + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/Webhooks.php b/lib/Model/Webhooks.php new file mode 100644 index 00000000..971a37b0 --- /dev/null +++ b/lib/Model/Webhooks.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Webhooks implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Webhooks'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'status' => 'string', + 'data' => '\Pipedrive\Model\BaseWebhook[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'status' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'status' => 'status', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'status' => 'setStatus', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'status' => 'getStatus', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the response + * + * @return self + */ + public function setStatus($status): self + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseWebhook[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseWebhook[]|null $data The array of Webhooks + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/WebhooksAllOf.php b/lib/Model/WebhooksAllOf.php new file mode 100644 index 00000000..ba193575 --- /dev/null +++ b/lib/Model/WebhooksAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class WebhooksAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'Webhooks_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'data' => '\Pipedrive\Model\BaseWebhook[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Pipedrive\Model\BaseWebhook[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Pipedrive\Model\BaseWebhook[]|null $data The array of Webhooks + * + * @return self + */ + public function setData($data): self + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/WebhooksDeleteForbiddenSchema.php b/lib/Model/WebhooksDeleteForbiddenSchema.php new file mode 100644 index 00000000..cd7ce723 --- /dev/null +++ b/lib/Model/WebhooksDeleteForbiddenSchema.php @@ -0,0 +1,372 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class WebhooksDeleteForbiddenSchema implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WebhooksDeleteForbiddenSchema'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'success' => 'bool', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success'] = $data['success'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success If the response is successful or not + * + * @return self + */ + public function setSuccess($success): self + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The error message + * + * @return self + */ + public function setMessage($message): self + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/Model/WebhooksDeleteForbiddenSchemaAllOf.php b/lib/Model/WebhooksDeleteForbiddenSchemaAllOf.php new file mode 100644 index 00000000..6a3152ef --- /dev/null +++ b/lib/Model/WebhooksDeleteForbiddenSchemaAllOf.php @@ -0,0 +1,342 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class WebhooksDeleteForbiddenSchemaAllOf implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'WebhooksDeleteForbiddenSchema_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @phpsalm-var array + */ + protected static array $openAPITypes = [ + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @phpstan-return array + * @psalm-return array + * @return array + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(): string + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var array + * @phpstan-var array + * @psalm-var array + */ + protected array $container = []; + + /** + * Constructor + * + * @phpstan-param array|null $data + * @psalm-param array|null $data + * @param array|null $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + * @phpstan-return array + * @psalm-return array + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message The error message + * + * @return self + */ + public function setMessage($message): self + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @throws JsonException + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @throws JsonException + * @return string + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR); + } +} + + diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php new file mode 100644 index 00000000..05a11d9d --- /dev/null +++ b/lib/ObjectSerializer.php @@ -0,0 +1,406 @@ +|null serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, string $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } + + if ($data instanceof DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + 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', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } + 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; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param mixed $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value): string + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * 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) + { + $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 mixed $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + 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($value) + { + if ($value instanceof DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return $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|null + */ + 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, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return 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 array|array>|null $httpHeaders HTTP headers + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, string $class, array $httpHeaders = null) + { + 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 === 'object') { + settype($data, 'array'); + return $data; + } else if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some API's 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 API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new DateTime())->setTimestamp(strtotime($data)); + } + } else { + return null; + } + } + + /** @psalm-suppress ParadoxicalCondition */ + if ($class === '\SplFileObject') { + /** @var StreamInterface $data */ + + // determine file name + if (is_array($httpHeaders) && array_key_exists('Content-Disposition', $httpHeaders) && is_string($httpHeaders['Content-Disposition']) && + 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(), ''); + } + + if (!$filename) { + return null; + } + + $file = fopen($filename, 'w'); + + if (!$file) { + return null; + } + + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new SplFileObject($filename, 'r'); + } + + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + 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 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 = '\Pipedrive\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) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..829c6f79 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "pipedrive", + "description": "PHP API client generated by OpenAPI Generator", + "scripts": { + "test:functional": "echo \"Skip\"", + "test:functional:start": "echo \"Skip\"", + "test:functional:stop": "echo \"Skip\"" + } +} \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..36c100ac --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,10 @@ +parameters: + paths: + - lib + level: 8 + ignoreErrors: + excludePaths: + checkAlwaysTrueStrictComparison: false + treatPhpDocTypesAsCertain: false + checkGenericClassInNonGenericObjectType: false + reportUnmatchedIgnoredErrors: false \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 2782d196..8a289836 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,20 +1,13 @@ - - - - - ./tests - - - \ No newline at end of file + + + + + ./test + + + + + + diff --git a/src/APIException.php b/src/APIException.php deleted file mode 100644 index 7bd9e3d4..00000000 --- a/src/APIException.php +++ /dev/null @@ -1,88 +0,0 @@ -getResponse()->getStatusCode()); - $this->context = $context; - $this->errorMessage = $reason; - - if (get_class() != 'APIException') { - $this->unbox(); - } - } - - /** - * Unbox response into this exception class - */ - public function unbox() - { - } - - /** - * The HTTP context from the API request - * @return Http\HttpContext - */ - public function getContext() - { - return $this->context; - } - - /** - * The HTTP response code from the API request - * @return int - */ - public function getResponseCode() - { - return $this->context->getResponse()->getStatusCode(); - } - - /** - * The HTTP response body from the API request - * @return mixed - */ - public function getResponseBody() - { - return $this->context->getResponse()->getRawBody(); - } - - /** - * The reason for raising an exception - * @return string - */ - public function getReason() - { - return $this->message; - } -} diff --git a/src/APIHelper.php b/src/APIHelper.php deleted file mode 100644 index 1717e188..00000000 --- a/src/APIHelper.php +++ /dev/null @@ -1,189 +0,0 @@ - $value) { - $replaceValue = ''; - - //load parameter value - if (is_null($value)) { - $replaceValue = ''; - } elseif (is_array($value)) { - $replaceValue = implode("/", array_map("urlencode", $value)); - } else { - $replaceValue = urlencode(strval($value)); - } - - //find the template parameter and replace it with its value - $url = str_replace('{' . strval($key) . '}', $replaceValue, $url); - } - - return $url; - } - - /** - * Appends the given set of parameters to the given query string - * @param string $queryBuilder The query url string to append the parameters - * @param array $parameters The parameters to append - * @return void - */ - public static function appendUrlWithQueryParameters(&$queryBuilder, $parameters) - { - //perform parameter validation - if (is_null($queryBuilder) || !is_string($queryBuilder)) { - throw new InvalidArgumentException('Given value for parameter "queryBuilder" is invalid.'); - } - - if (is_null($parameters)) { - return; - } - - $parameters = array_filter($parameters, function($value) { - return isset($value); - }); - - if (empty($parameters)) { - return; - } - //does the query string already has parameters - $hasParams = (strrpos($queryBuilder, '?') > 0); - - //if already has parameters, use the & to append new parameters - $queryBuilder = $queryBuilder . (($hasParams) ? '&' : '?'); - - //append parameters - $queryBuilder = $queryBuilder . http_build_query($parameters); - } - - /** - * Validates and processes the given Url - * @param string $url The given Url to process - * @return string Pre-processed Url as string */ - public static function cleanUrl($url) - { - //perform parameter validation - if (is_null($url) || !is_string($url)) { - throw new InvalidArgumentException('Invalid Url.'); - } - //ensure that the urls are absolute - $matchCount = preg_match("#^(https?://[^/]+)#", $url, $matches); - if ($matchCount == 0) { - throw new InvalidArgumentException('Invalid Url format.'); - } - //get the http protocol match - $protocol = $matches[1]; - - //remove redundant forward slashes - $query = substr($url, strlen($protocol)); - $query = preg_replace("#//+#", "/", $query); - - //add api token if enabled - if (Configuration::$apiToken != null){ - if (strpos($query, "?") == false){ // if no query parameters in query - $query = $query . '?'; - } else { - $query = $query . '&'; - } - $query = $query . 'api_token=' . Configuration::$apiToken; - } - - //return process url - return $protocol.$query; - } - - /** - * Deserialize a Json string - * @param string $json A valid Json string - * @param mixed $instance Instance of an object to map the json into - * @param boolean $isArray Is the Json an object array? - * @return mixed Decoded Json - */ - public static function deserialize($json, $instance = null, $isArray = false) - { - if ($instance == null) { - return json_decode($json, true); - } else { - $mapper = new \apimatic\jsonmapper\JsonMapper(); - if ($isArray) { - return $mapper->mapArray(json_decode($json), array(), $instance); - } else { - return $mapper->map(json_decode($json), $instance); - } - } - } - - /** - * Check if an array isAssociative (has string keys) - * @param array $array A valid array - * @return boolean True if the array is Associative, false if it is Indexed - */ - private static function isAssociative($arr) - { - foreach ($arr as $key => $value) { - if (is_string($key)) { - return true; - } - } - - return false; - } - - /** - * Prepare a model for form encoding - * @param JsonSerializable $model A valid instance of JsonSerializable - * @return array The model as a map of key value pairs - */ - public static function prepareFormFields($model) - { - if (!$model instanceof JsonSerializable) { - return $model; - } - - $arr = $model->jsonSerialize(); - - foreach ($model as $key => $value) { - if ($value instanceof JsonSerializable) { - $arr[$key] = static::prepareFormFields($model->$key); - } elseif (is_array($value) && !empty($value) && !static::isAssociative($value) && - $value[0] instanceof JsonSerializable) { - $temp = array(); - foreach ($value as $k => $v) { - $temp[$k] = static::prepareFormFields($v); - } - $arr[$key] = $temp; - } - } - return $arr; - } -} diff --git a/src/Client.php b/src/Client.php deleted file mode 100644 index 8e742c33..00000000 --- a/src/Client.php +++ /dev/null @@ -1,320 +0,0 @@ - null]; - } - /** - * Singleton access to Activities controller - * @return Controllers\ActivitiesController The *Singleton* instance - */ - public function getActivities() - { - return Controllers\ActivitiesController::getInstance(); - } - /** - * Singleton access to ActivityFields controller - * @return Controllers\ActivityFieldsController The *Singleton* instance - */ - public function getActivityFields() - { - return Controllers\ActivityFieldsController::getInstance(); - } - /** - * Singleton access to ActivityTypes controller - * @return Controllers\ActivityTypesController The *Singleton* instance - */ - public function getActivityTypes() - { - return Controllers\ActivityTypesController::getInstance(); - } - /** - * Singleton access to CallLogs controller - * @return Controllers\CallLogsController The *Singleton* instance - */ - public function getCallLogs() - { - return Controllers\CallLogsController::getInstance(); - } - /** - * Singleton access to Currencies controller - * @return Controllers\CurrenciesController The *Singleton* instance - */ - public function getCurrencies() - { - return Controllers\CurrenciesController::getInstance(); - } - /** - * Singleton access to DealFields controller - * @return Controllers\DealFieldsController The *Singleton* instance - */ - public function getDealFields() - { - return Controllers\DealFieldsController::getInstance(); - } - /** - * Singleton access to Deals controller - * @return Controllers\DealsController The *Singleton* instance - */ - public function getDeals() - { - return Controllers\DealsController::getInstance(); - } - /** - * Singleton access to Files controller - * @return Controllers\FilesController The *Singleton* instance - */ - public function getFiles() - { - return Controllers\FilesController::getInstance(); - } - /** - * Singleton access to Filters controller - * @return Controllers\FiltersController The *Singleton* instance - */ - public function getFilters() - { - return Controllers\FiltersController::getInstance(); - } - /** - * Singleton access to GlobalMessages controller - * @return Controllers\GlobalMessagesController The *Singleton* instance - */ - public function getGlobalMessages() - { - return Controllers\GlobalMessagesController::getInstance(); - } - /** - * Singleton access to Goals controller - * @return Controllers\GoalsController The *Singleton* instance - */ - public function getGoals() - { - return Controllers\GoalsController::getInstance(); - } - /** - * Singleton access to MailMessages controller - * @return Controllers\MailMessagesController The *Singleton* instance - */ - public function getMailMessages() - { - return Controllers\MailMessagesController::getInstance(); - } - /** - * Singleton access to MailThreads controller - * @return Controllers\MailThreadsController The *Singleton* instance - */ - public function getMailThreads() - { - return Controllers\MailThreadsController::getInstance(); - } - /** - * Singleton access to NoteFields controller - * @return Controllers\NoteFieldsController The *Singleton* instance - */ - public function getNoteFields() - { - return Controllers\NoteFieldsController::getInstance(); - } - /** - * Singleton access to Notes controller - * @return Controllers\NotesController The *Singleton* instance - */ - public function getNotes() - { - return Controllers\NotesController::getInstance(); - } - /** - * Singleton access to OrganizationFields controller - * @return Controllers\OrganizationFieldsController The *Singleton* instance - */ - public function getOrganizationFields() - { - return Controllers\OrganizationFieldsController::getInstance(); - } - /** - * Singleton access to OrganizationRelationships controller - * @return Controllers\OrganizationRelationshipsController The *Singleton* instance - */ - public function getOrganizationRelationships() - { - return Controllers\OrganizationRelationshipsController::getInstance(); - } - /** - * Singleton access to Organizations controller - * @return Controllers\OrganizationsController The *Singleton* instance - */ - public function getOrganizations() - { - return Controllers\OrganizationsController::getInstance(); - } - /** - * Singleton access to PermissionSets controller - * @return Controllers\PermissionSetsController The *Singleton* instance - */ - public function getPermissionSets() - { - return Controllers\PermissionSetsController::getInstance(); - } - /** - * Singleton access to PersonFields controller - * @return Controllers\PersonFieldsController The *Singleton* instance - */ - public function getPersonFields() - { - return Controllers\PersonFieldsController::getInstance(); - } - /** - * Singleton access to Persons controller - * @return Controllers\PersonsController The *Singleton* instance - */ - public function getPersons() - { - return Controllers\PersonsController::getInstance(); - } - /** - * Singleton access to Pipelines controller - * @return Controllers\PipelinesController The *Singleton* instance - */ - public function getPipelines() - { - return Controllers\PipelinesController::getInstance(); - } - /** - * Singleton access to ProductFields controller - * @return Controllers\ProductFieldsController The *Singleton* instance - */ - public function getProductFields() - { - return Controllers\ProductFieldsController::getInstance(); - } - /** - * Singleton access to Products controller - * @return Controllers\ProductsController The *Singleton* instance - */ - public function getProducts() - { - return Controllers\ProductsController::getInstance(); - } - /** - * Singleton access to Recents controller - * @return Controllers\RecentsController The *Singleton* instance - */ - public function getRecents() - { - return Controllers\RecentsController::getInstance(); - } - /** - * Singleton access to Roles controller - * @return Controllers\RolesController The *Singleton* instance - */ - public function getRoles() - { - return Controllers\RolesController::getInstance(); - } - /** - * Singleton access to SearchResults controller - * @return Controllers\SearchResultsController The *Singleton* instance - */ - public function getSearchResults() - { - return Controllers\SearchResultsController::getInstance(); - } - /** - * Singleton access to Stages controller - * @return Controllers\StagesController The *Singleton* instance - */ - public function getStages() - { - return Controllers\StagesController::getInstance(); - } - /** - * Singleton access to Teams controller - * @return Controllers\TeamsController The *Singleton* instance - */ - public function getTeams() - { - return Controllers\TeamsController::getInstance(); - } - /** - * Singleton access to UserConnections controller - * @return Controllers\UserConnectionsController The *Singleton* instance - */ - public function getUserConnections() - { - return Controllers\UserConnectionsController::getInstance(); - } - /** - * Singleton access to UserSettings controller - * @return Controllers\UserSettingsController The *Singleton* instance - */ - public function getUserSettings() - { - return Controllers\UserSettingsController::getInstance(); - } - /** - * Singleton access to Users controller - * @return Controllers\UsersController The *Singleton* instance - */ - public function getUsers() - { - return Controllers\UsersController::getInstance(); - } - /** - * Singleton access to Webhooks controller - * @return Controllers\WebhooksController The *Singleton* instance - */ - public function getWebhooks() - { - return Controllers\WebhooksController::getInstance(); - } - /** - * Singleton access to ItemSearch controller - * @return Controllers\ItemSearchController The *Singleton* instance - */ - public function getItemSearch() - { - return Controllers\ItemSearchController::getInstance(); - } - /** - * Singleton access to OAuthAuthorization controller - * @return Controllers\OAuthAuthorizationController The *Singleton* instance - */ - public function getOAuthAuthorization() - { - return Controllers\OAuthAuthorizationController::getInstance(); - } - /** - * Get OAuth 2 authorization manager - * @return OAuthManager - */ - public function auth() - { - return OAuthManager::getInstance(); - } -} diff --git a/src/Configuration.php b/src/Configuration.php deleted file mode 100644 index bc3dbd46..00000000 --- a/src/Configuration.php +++ /dev/null @@ -1,78 +0,0 @@ - array( - Servers::DEFAULT_ => 'https://api.pipedrive.com/v1', - Servers::OAUTH => 'https://oauth.pipedrive.com', - ), - ); -} diff --git a/src/Controllers/ActivitiesController.php b/src/Controllers/ActivitiesController.php deleted file mode 100644 index 23c344a7..00000000 --- a/src/Controllers/ActivitiesController.php +++ /dev/null @@ -1,477 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activities'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns all activities assigned to a particular user. - * - * @param array $options Array with all options for search - * @param integer $options['userId'] (optional) ID of the user whose activities will be fetched. If omitted, - * the user associated with the API token will be used. If 0, activities for - * all company users will be fetched based on the permission sets. - * @param integer $options['filterId'] (optional) ID of the filter to use (will narrow down results if used - * together with user_id parameter). - * @param string $options['type'] (optional) Type of the activity, can be one type or multiple types - * separated by a comma. This is in correlation with the key_string - * parameter of ActivityTypes. - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param DateTime $options['startDate'] (optional) Date in format of YYYY-MM-DD from which activities to fetch - * from. - * @param DateTime $options['endDate'] (optional) Date in format of YYYY-MM-DD until which activities to fetch - * to. - * @param int $options['done'] (optional) Whether the activity is done or not. 0 = Not done, 1 = Done. - * If omitted returns both Done and Not done activities. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllActivitiesAssignedToAParticularUser( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activities'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - 'filter_id' => $this->val($options, 'filterId'), - 'type' => $this->val($options, 'type'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'start_date' => DateTimeHelper::toSimpleDate($this->val($options, 'startDate')), - 'end_date' => DateTimeHelper::toSimpleDate($this->val($options, 'endDate')), - 'done' => $this->val($options, 'done'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new activity. Includes more_activities_scheduled_in_context property in response's - * additional_data which indicates whether there are more undone activities scheduled with the same - * deal, person or organization (depending on the supplied data). For more information on how to add an - * activity, see this tutorial. - * - * @param array $options Array with all options for search - * @param string $options['subject'] Subject of the activity - * @param string $options['type'] Type of the activity. This is in correlation with the key_string - * parameter of ActivityTypes. - * @param int $options['done'] (optional) TODO: type description here - * @param DateTime $options['dueDate'] (optional) Due date of the activity. Format: YYYY-MM-DD - * @param string $options['dueTime'] (optional) Due time of the activity in UTC. Format: HH:MM - * @param string $options['duration'] (optional) Duration of the activity. Format: HH:MM - * @param integer $options['userId'] (optional) ID of the user whom the activity will be assigned to. If - * omitted, the activity will be assigned to the authorized user. - * @param integer $options['dealId'] (optional) ID of the deal this activity will be associated with - * @param integer $options['personId'] (optional) ID of the person this activity will be associated with - * @param string $options['participants'] (optional) List of multiple persons (participants) this activity will - * be associated with. If omitted, single participant from person_id field - * is used. It requires a structure as follows: [{"person_id":1, - * "primary_flag":true}] - * @param integer $options['orgId'] (optional) ID of the organization this activity will be associated - * with - * @param string $options['note'] (optional) Note of the activity (HTML format) - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAnActivity( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activities'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'subject' => $this->val($options, 'subject'), - 'type' => $this->val($options, 'type'), - 'done' => APIHelper::prepareFormFields($this->val($options, 'done')), - 'due_date' => DateTimeHelper::toSimpleDate($this->val($options, 'dueDate')), - 'due_time' => $this->val($options, 'dueTime'), - 'duration' => $this->val($options, 'duration'), - 'user_id' => $this->val($options, 'userId'), - 'deal_id' => $this->val($options, 'dealId'), - 'person_id' => $this->val($options, 'personId'), - 'participants' => $this->val($options, 'participants'), - 'org_id' => $this->val($options, 'orgId'), - 'note' => $this->val($options, 'note'), - 'busy_flag' => $this->val($options, 'busyFlag') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Deletes an activity. - * - * @param integer $id ID of the activity - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAnActivity( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activities/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns details of a specific activity. - * - * @param integer $id ID of the activity - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDetailsOfAnActivity( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activities/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Modifies an activity. Includes more_activities_scheduled_in_context property in response's - * additional_data which indicates whether there are more undone activities scheduled with the same - * deal, person or organization (depending on the supplied data). - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the activity - * @param string $options['subject'] Subject of the activity - * @param string $options['type'] Type of the activity. This is in correlation with the key_string - * parameter of ActivityTypes. - * @param int $options['done'] (optional) TODO: type description here - * @param DateTime $options['dueDate'] (optional) Due date of the activity. Format: YYYY-MM-DD - * @param string $options['dueTime'] (optional) Due time of the activity in UTC. Format: HH:MM - * @param string $options['duration'] (optional) Duration of the activity. Format: HH:MM - * @param integer $options['userId'] (optional) ID of the user whom the activity will be assigned to. If - * omitted, the activity will be assigned to the authorized user. - * @param integer $options['dealId'] (optional) ID of the deal this activity will be associated with - * @param integer $options['personId'] (optional) ID of the person this activity will be associated with - * @param string $options['participants'] (optional) List of multiple persons (participants) this activity will - * be associated with. If omitted, single participant from person_id field - * is used. It requires a structure as follows: [{"person_id":1, - * "primary_flag":true}] - * @param integer $options['orgId'] (optional) ID of the organization this activity will be associated - * with - * @param string $options['note'] (optional) Note of the activity (HTML format) - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateEditAnActivity( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activities/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'subject' => $this->val($options, 'subject'), - 'type' => $this->val($options, 'type'), - 'done' => APIHelper::prepareFormFields($this->val($options, 'done')), - 'due_date' => DateTimeHelper::toSimpleDate($this->val($options, 'dueDate')), - 'due_time' => $this->val($options, 'dueTime'), - 'duration' => $this->val($options, 'duration'), - 'user_id' => $this->val($options, 'userId'), - 'deal_id' => $this->val($options, 'dealId'), - 'person_id' => $this->val($options, 'personId'), - 'participants' => $this->val($options, 'participants'), - 'org_id' => $this->val($options, 'orgId'), - 'note' => $this->val($options, 'note'), - 'busy_flag' => $this->val($options, 'busyFlag') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/ActivityFieldsController.php b/src/Controllers/ActivityFieldsController.php deleted file mode 100644 index cf9acf16..00000000 --- a/src/Controllers/ActivityFieldsController.php +++ /dev/null @@ -1,92 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activityFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } -} diff --git a/src/Controllers/ActivityTypesController.php b/src/Controllers/ActivityTypesController.php deleted file mode 100644 index 6dfd4383..00000000 --- a/src/Controllers/ActivityTypesController.php +++ /dev/null @@ -1,342 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activityTypes'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns all activity types - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllActivityTypes() - { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activityTypes'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new activity type, returns the ID, the key_string and the order number of the newly added - * activity type upon success. - * - * @param array $options Array with all options for search - * @param string $options['name'] Name of the activity type - * @param string $options['iconKey'] Icon graphic to use for representing this activity type. - * @param string $options['color'] (optional) A designated color for the activity type in 6-character HEX format - * (e.g. FFFFFF for white, 000000 for black). - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addNewActivityType( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activityTypes'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'icon_key' => APIHelper::prepareFormFields($this->val($options, 'iconKey')), - 'color' => $this->val($options, 'color') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks an activity type as deleted. - * - * @param integer $id ID of the activity type - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAnActivityType( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activityTypes/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates an activity type. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the activity type - * @param string $options['name'] (optional) Name of the activity type - * @param string $options['iconKey'] (optional) Icon graphic to use for representing this activity type. - * @param string $options['color'] (optional) A designated color for the activity type in 6-character HEX - * format (e.g. FFFFFF for white, 000000 for black). - * @param integer $options['orderNr'] (optional) An order number for this activity type. Order numbers should be - * used to order the types in the activity type selections. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateEditActivityType( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/activityTypes/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'icon_key' => APIHelper::prepareFormFields($this->val($options, 'iconKey')), - 'color' => $this->val($options, 'color'), - 'order_nr' => $this->val($options, 'orderNr') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/BaseController.php b/src/Controllers/BaseController.php deleted file mode 100644 index fabe44c1..00000000 --- a/src/Controllers/BaseController.php +++ /dev/null @@ -1,69 +0,0 @@ -httpCallBack = $httpCallBack; - } - - /** - * Get HttpCallBack for this controller - * @return HttpCallBack The HttpCallBack object set for this controller - */ - public function getHttpCallBack() - { - return $this->httpCallBack; - } - - /** - * Get a new JsonMapper instance for mapping objects - * @return \apimatic\jsonmapper\JsonMapper JsonMapper instance - */ - protected function getJsonMapper() - { - $mapper = new JsonMapper(); - return $mapper; - } - - protected function validateResponse(HttpResponse $response, HttpContext $_httpContext) - { - if (($response->getStatusCode() < 200) || ($response->getStatusCode() > 208)) { //[200,208] = HTTP OK - throw new APIException('HTTP Response Not OK', $_httpContext); - } - } -} diff --git a/src/Controllers/CallLogsController.php b/src/Controllers/CallLogsController.php deleted file mode 100644 index 98d039dd..00000000 --- a/src/Controllers/CallLogsController.php +++ /dev/null @@ -1,362 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/callLogs'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns details of a specific call log - * - * @param integer $id ID of the deal - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDetailsOfACallLog( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/callLogs/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new call log - * - * @param integer $body['user_id'] (optional) The ID of the owner of the call log - * @param integer $body['activity_id'] (optional) If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify deal_id, person_id or org_id, as they will be ignored in favor of the values already available in the activity. - * @param string $body['subject'] (optional) Name of the activity this call is attached to - * @param string $body['duration'] (optional) Call duration in seconds - * @param string $body['outcome'] Describes the outcome of the call - * @param string $body['from_phone_number'] (optional) The number that made the call - * @param string $body['to_phone_number'] The number called - * @param string $body['start_time'] The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. - * @param string $body['end_time'] The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. - * @param integer $body['person_id'] (optional) The ID of the Person this call is associated with - * @param integer $body['org_id'] (optional) The ID of the Organization this call is associated with - * @param integer $body['deal_id'] (optional) The ID of the Deal this call is associated with - * @param string $body['note'] (optional) Note for the call log in HTML format - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addACallLog( - $body - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/callLogs'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds an audio recording to the call log. That audio can be played - * by those who have access to the call log object. - * - * @param integer $id The ID received when you create the call log - * @param array $options Array with all options for search - * @param string $options['file'] Audio file supported by the HTML5 specification - * @param string $options['mime_type'] The MIME type of the audio file supported by the HTML5 specification - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function attachAnAudioFileToTheCallLog( - $id, - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/callLogs/{id}/recordings'; - - //process path parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken), - ); - - //prepare parameters - $_parameters = array ( - 'file' => Request\Body::File($this->val($options, 'file'), $this->val($options, 'mime_type')), - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request::buildHTTPCurlQuery($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Deletes a call log. If there is an audio recording attached to it, - * it will also be deleted. The related activity will not be removed - * by this request. If you want to remove the related activities, - * please use the endpoint which is specific for activities. - * - * @param string $id ID of the callLog - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteACallLog( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/callLogs/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/CurrenciesController.php b/src/Controllers/CurrenciesController.php deleted file mode 100644 index 37053454..00000000 --- a/src/Controllers/CurrenciesController.php +++ /dev/null @@ -1,104 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/currencies'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $term, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Currencies')); - } -} diff --git a/src/Controllers/DealFieldsController.php b/src/Controllers/DealFieldsController.php deleted file mode 100644 index c47dd86a..00000000 --- a/src/Controllers/DealFieldsController.php +++ /dev/null @@ -1,399 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/dealFields'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about all fields deals can have - * - * @param array $options Array with all options for search - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllDealFields( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/dealFields'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new deal field. For more information on adding a new custom field, see this - * tutorial. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewDealField( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/dealFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a field as deleted. For more information on how to delete a custom field, see this - * tutorial. - * - * @param integer $id ID of the field - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteADealField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/dealFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific deal field. - * - * @param integer $id ID of the field - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneDealField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/dealFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates a deal field. See an example of updating custom fields’ values in this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the field - * @param string $options['name'] Name of the field - * @param string $options['options'] (optional) When field_type is either set or enum, possible options must be - * supplied as a JSON-encoded sequential array, for example: ["red","blue", - * "lilac"] - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateADealField( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/dealFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'options' => $this->val($options, 'options') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/DealsController.php b/src/Controllers/DealsController.php deleted file mode 100644 index a09b2546..00000000 --- a/src/Controllers/DealsController.php +++ /dev/null @@ -1,1824 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteMultipleDeals')); - } - - /** - * Returns all deals. For more information on how to get all deals, see this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['userId'] (optional) If supplied, only deals matching the given user will be - * returned. - * @param integer $options['filterId'] (optional) ID of the filter to use - * @param integer $options['stageId'] (optional) If supplied, only deals within the given stage will be - * returned. - * @param string $options['status'] (optional) Only fetch deals with specific status. If omitted, all not - * deleted deals are fetched. - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma - * (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are - * supported (no nested keys). - * @param int $options['ownedByYou'] (optional) When supplied, only deals owned by you are returned. However - * filter_id takes precedence over owned_by_you when both are supplied. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllDeals( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - 'filter_id' => $this->val($options, 'filterId'), - 'stage_id' => $this->val($options, 'stageId'), - 'status' => $this->val($options, 'status', Models\Status2Enum::ALL_NOT_DELETED), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'sort' => $this->val($options, 'sort'), - 'owned_by_you' => $this->val($options, 'ownedByYou'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new deal. Note that you can supply additional custom fields along with the request that are - * not described here. These custom fields are different for each Pipedrive account and can be - * recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and - * look for 'key' values. For more information on how to add a deal, see this tutorial. - * - * @param object $body (optional) TODO: type description here - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addADeal( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetAddedDeal')); - } - - /** - * Returns summary of all the deals. - * - * @param array $options Array with all options for search - * @param string $options['status'] (optional) Only fetch deals with specific status. open = Open, won = Won, - * lost = Lost - * @param integer $options['filterId'] (optional) user_id will not be considered. Only deals matching the given - * filter will be returned. - * @param integer $options['userId'] (optional) Only deals matching the given user will be returned. user_id - * will not be considered if you use filter_id. - * @param integer $options['stageId'] (optional) Only deals within the given stage will be returned. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsSummary( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/summary'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'status' => $this->val($options, 'status'), - 'filter_id' => $this->val($options, 'filterId'), - 'user_id' => $this->val($options, 'userId'), - 'stage_id' => $this->val($options, 'stageId'), - 'pipeline_id' => $this->val($options, 'pipelineId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetDealsSummary')); - } - - /** - * Returns open and won deals, grouped by defined interval of time set in a date-type dealField - * (field_key) — e.g. when month is the chosen interval, and 3 months are asked starting from January - * 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the - * value of the given field_key. - * - * @param array $options Array with all options for search - * @param DateTime $options['startDate'] Date where first interval starts. Format: YYYY-MM-DD - * @param string $options['interval'] Type of interval.
day
Day
week
A full week - * (7 days) starting from start_date
month
A - * full month (depending on the number of days in given month) - * starting from start_date
quarter
A full - * quarter (3 months) starting from start_date
- * @param integer $options['amount'] Number of given intervals, starting from start_date, to - * fetch. E.g. 3 (months). - * @param string $options['fieldKey'] The name of the date field by which to get deals by. - * @param integer $options['userId'] (optional) If supplied, only deals matching the given user - * will be returned. - * @param integer $options['pipelineId'] (optional) If supplied, only deals matching the given - * pipeline will be returned. - * @param integer $options['filterId'] (optional) If supplied, only deals matching the given filter - * will be returned. - * @param int $options['excludeDeals'] (optional) Whether to exclude deals list (1) or not (0). - * Note that when deals are excluded, the timeline summary - * (counts and values) is still returned. - * @param string $options['totalsConvertCurrency'] (optional) 3-letter currency code of any of the supported - * currencies. When supplied, totals_converted is returned per - * each interval which contains the currency-converted total - * amounts in the given currency. You may also set this - * parameter to 'default_currency' in which case users default - * currency is used. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsTimeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/timeline'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start_date' => DateTimeHelper::toSimpleDate($this->val($options, 'startDate')), - 'interval' => $this->val($options, 'interval'), - 'amount' => $this->val($options, 'amount'), - 'field_key' => $this->val($options, 'fieldKey'), - 'user_id' => $this->val($options, 'userId'), - 'pipeline_id' => $this->val($options, 'pipelineId'), - 'filter_id' => $this->val($options, 'filterId'), - 'exclude_deals' => $this->val($options, 'excludeDeals'), - 'totals_convert_currency' => $this->val($options, 'totalsConvertCurrency'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetDealsTimeline')); - } - - /** - * Marks a deal as deleted. - * - * @param integer $id ID of the deal - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteADeal( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteDeal')); - } - - /** - * Returns details of a specific deal. Note that this also returns some additional fields which are not - * present when asking for all deals – such as deal age and stay in pipeline stages. Also note that - * custom fields appear as long hashes in the resulting data. These hashes can be mapped against the - * 'key' value of dealFields. For more information on how to get all details of a deal, see this tutorial. - * - * @param integer $id ID of the deal - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDetailsOfADeal( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates the properties of a deal. For more information on how to update a deal, see this - * tutorial. - * - * Note that you can supply additional custom fields along with the request that are - * not described here. These custom fields are different for each Pipedrive account and can be - * recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and - * look for 'key' values. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param string $options['title'] (optional) Deal title - * @param string $options['value'] (optional) Value of the deal. If omitted, value will be set to 0. - * @param string $options['currency'] (optional) Currency of the deal. Accepts a 3-character currency code. If - * omitted, currency will be set to the default currency of the authorized - * user. - * @param integer $options['userId'] (optional) ID of the user who will be marked as the owner of this deal. - * If omitted, the authorized user ID will be used. - * @param integer $options['personId'] (optional) ID of the person this deal will be associated with - * @param integer $options['orgId'] (optional) ID of the organization this deal will be associated with - * @param integer $options['stageId'] (optional) ID of the stage this deal will be placed in a pipeline (note - * that you can't supply the ID of the pipeline as this will be assigned - * automatically based on stage_id). If omitted, the deal will be placed in - * the first stage of the default pipeline. - * @param string $options['status'] (optional) open = Open, won = Won, lost = Lost, deleted = Deleted. If - * omitted, status will be set to open. - * @param double $options['probability'] (optional) Deal success probability percentage. Used/shown only when - * deal_probability for the pipeline of the deal is enabled. - * @param string $options['lostReason'] (optional) Optional message about why the deal was lost (to be used when - * status=lost) - * @param int $options['visibleTo'] (optional) Visibility of the deal. If omitted, visibility will be set to - * the default visibility setting of this item type for the authorized user. - *
1
Owner & followers - * (private)
3
Entire company (shared)
- * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $options); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Json($options)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetAddedDeal')); - } - - /** - * Lists activities associated with a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['done'] (optional) Whether the activity is done or not. 0 = Not done, 1 = Done. If - * omitted returns both Done and Not done activities. - * @param string $options['exclude'] (optional) A comma-separated string of activity IDs to exclude from result - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listActivitiesAssociatedWithADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/activities'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'done' => $this->val($options, 'done'), - 'exclude' => $this->val($options, 'exclude'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Duplicate a deal - * - * @param integer $id ID of the deal - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function createDuplicateDeal( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/duplicate'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetDuplicatedDeal')); - } - - /** - * Lists files associated with a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['includeDeletedFiles'] (optional) When enabled, the list of files will also include - * deleted files. Please note that trying to download these files - * will not work. - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma - * (field_name_1 ASC, field_name_2 DESC). Only first-level field - * keys are supported (no nested keys). Supported fields: id, - * user_id, deal_id, person_id, org_id, product_id, add_time, - * update_time, file_name, file_type, file_size, comment. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFilesAttachedToADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/files'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'include_deleted_files' => $this->val($options, 'includeDeletedFiles'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists updates about a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listUpdatesAboutADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/flow'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists the followers of a deal. - * - * @param integer $id ID of the deal - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFollowersOfADeal( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a follower to a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['userId'] ID of the user - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAFollowerToADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'user_id' => $this->val($options, 'userId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\AddedDealFollower')); - } - - /** - * Deletes a follower from a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['followerId'] ID of the follower - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAFollowerFromADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/followers/{follower_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'follower_id' => $this->val($options, 'followerId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteDealFollower')); - } - - /** - * Lists mail messages associated with a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listMailMessagesAssociatedWithADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/mailMessages'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Merges a deal with another deal. For more information on how to merge two deals, see this - * tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['mergeWithId'] ID of the deal that the deal will be merged with - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateMergeTwoDeals( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/merge'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'merge_with_id' => $this->val($options, 'mergeWithId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetMergedDeal')); - } - - /** - * Lists participants associated with a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listParticipantsOfADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/participants'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a participant to a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['personId'] ID of the person - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAParticipantToADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/participants'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'person_id' => $this->val($options, 'personId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Deletes a participant from a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['dealParticipantId'] ID of the deal participant - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAParticipantFromADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/participants/{deal_participant_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'deal_participant_id' => $this->val($options, 'dealParticipantId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteDealParticipant')); - } - - /** - * List users permitted to access a deal - * - * @param integer $id ID of the deal - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listPermittedUsers( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/permittedUsers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists all persons associated with a deal, regardless of whether the person is the primary contact of - * the deal, or added as a participant. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listAllPersonsAssociatedWithADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/persons'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists products attached to a deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['includeProductData'] (optional) Whether to fetch product data along with each - * attached product (1) or not (0, default). - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listProductsAttachedToADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/products'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'include_product_data' => $this->val($options, 'includeProductData'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a product to the deal. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param object $options['body'] (optional) TODO: type description here - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAProductToADeal($options) { - return $this->addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($options); - } - public function addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/products'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($this->val($options, 'body')); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetAddProductAttachementDetails')); - } - - /** - * Updates product attachment details. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['productAttachmentId'] ID of the deal-product (the ID of the product attached to the - * deal) - * @param double $options['itemPrice'] (optional) Price at which this product will be added to the - * deal - * @param integer $options['quantity'] (optional) Quantity – e.g. how many items of this product will - * be added to the deal - * @param double $options['discountPercentage'] (optional) Discount %. If omitted, will be set to 0 - * @param double $options['duration'] (optional) Duration of the product (when product durations are - * not enabled for the company or if omitted, defaults to 1) - * @param integer $options['productVariationId'] (optional) ID of the product variation to use. When omitted, no - * variation will be used. - * @param string $options['comments'] (optional) Any textual comment associated with this product- - * deal attachment. Visible and editable in the application UI. - * @param int $options['enabledFlag'] (optional) Whether the product is enabled on the deal or not. - * This makes it possible to add products to a deal with specific - * price and discount criteria - but keep them disabled, which - * refrains them from being included in deal price calculation. - * When omitted, the product will be marked as enabled by default. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateTheProductAttachedToADeal($options) { - return $this->updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($options); - } - public function updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/products/{product_attachment_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'product_attachment_id' => $this->val($options, 'productAttachmentId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'product_id' => $this->val($options, 'productId'), - 'item_price' => $this->val($options, 'itemPrice'), - 'quantity' => $this->val($options, 'quantity'), - 'discount_percentage' => $this->val($options, 'discountPercentage'), - 'duration' => $this->val($options, 'duration'), - 'product_variation_id' => $this->val($options, 'productVariationId'), - 'comments' => $this->val($options, 'comments'), - 'enabled_flag' => APIHelper::prepareFormFields($this->val($options, 'enabledFlag')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetProductAttachementDetails')); - } - - /** - * Deletes a product attachment from a deal, using the product_attachment_id. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the deal - * @param integer $options['productAttachmentId'] Product attachment ID. This is returned as - * product_attachment_id after attaching a product to a deal or as - * id when listing the products attached to a deal. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAnAttachedProductFromADeal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/{id}/products/{product_attachment_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'product_attachment_id' => $this->val($options, 'productAttachmentId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteDealProduct')); - } - - /** - * Searches all Deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found Deals can be filtered by Person ID and Organization ID. - * - * @param array $options Array with all options for search - * @param string $options['term'] The search term to look for. Minimum 2 characters (or 1 if using exact_match). - * @param string $options['fields'] (optional) A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @param bool $options['exactMatch'] (optional) When enabled, only full exact matches against the given term are returned. It is not case sensitive. - * @param integer $options['personId'] (optional) Will filter Deals by the provided Person ID. The upper limit of found Deals associated with the Person is 2000. - * @param integer $options['organizationId'] (optional) Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. - * @param string $options['status'] (optional) Will filter Deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found Deals associated with the status is 2000. - * @param string $options['includeFields'] (optional) Supports including optional fields in the results which are not provided by default. - * @param integer $options['start'] (optional) Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. - * @param integer $options['limit'] (optional) Items shown per page - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function searchDeals( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/deals/search'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'fields' => $this->val($options, 'fields'), - 'exact_match' => $this->val($options, 'exactMatch'), - 'person_id' => $this->val($options, 'personId'), - 'organization_id' => $this->val($options, 'organizationId'), - 'status' => $this->val($options, 'status'), - 'include_fields' => $this->val($options, 'includeFields'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/FilesController.php b/src/Controllers/FilesController.php deleted file mode 100644 index 6d52be52..00000000 --- a/src/Controllers/FilesController.php +++ /dev/null @@ -1,546 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'include_deleted_files' => $this->val($options, 'includeDeletedFiles'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lets you upload a file and associate it with Deal, Person, Organization, Activity or Product. For - * more information on how to add a file, see this tutorial. - * - * @param array $options Array with all options for search - * @param string $options['file'] A single file, supplied in the multipart/form-data encoding and contained - * within the given boundaries. - * @param integer $options['dealId'] (optional) ID of the deal to associate file(s) with - * @param integer $options['personId'] (optional) ID of the person to associate file(s) with - * @param integer $options['orgId'] (optional) ID of the organization to associate file(s) with - * @param integer $options['productId'] (optional) ID of the product to associate file(s) with - * @param integer $options['activityId'] (optional) ID of the activity to associate file(s) with - * @param integer $options['noteId'] (optional) ID of the note to associate file(s) with - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addFile( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'file' => Request\Body::File($this->val($options, 'file')), - 'deal_id' => $this->val($options, 'dealId'), - 'person_id' => $this->val($options, 'personId'), - 'org_id' => $this->val($options, 'orgId'), - 'product_id' => $this->val($options, 'productId'), - 'activity_id' => $this->val($options, 'activityId'), - 'note_id' => $this->val($options, 'noteId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request::buildHTTPCurlQuery($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Creates a new empty file in the remote location (googledrive) that will be linked to the item you - * supply. For more information on how to add a remote file, see this tutorial. - * - * @param array $options Array with all options for search - * @param string $options['fileType'] The file type - * @param string $options['title'] The title of the file - * @param string $options['itemType'] The item type - * @param integer $options['itemId'] ID of the item to associate the file with - * @param string $options['remoteLocation'] The location type to send the file to. Only googledrive is supported - * at the moment. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function createARemoteFileAndLinkItToAnItem( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files/remote'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'file_type' => APIHelper::prepareFormFields($this->val($options, 'fileType')), - 'title' => $this->val($options, 'title'), - 'item_type' => APIHelper::prepareFormFields($this->val($options, 'itemType')), - 'item_id' => $this->val($options, 'itemId'), - 'remote_location' => APIHelper::prepareFormFields($this->val($options, 'remoteLocation')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Links an existing remote file (googledrive) to the item you supply. For more information on how to - * link a remote file, see this tutorial. - * - * @param array $options Array with all options for search - * @param string $options['itemType'] The item type - * @param integer $options['itemId'] ID of the item to associate the file with - * @param string $options['remoteId'] The remote item id - * @param string $options['remoteLocation'] The location type to send the file to. Only googledrive is supported - * at the moment. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function createLinkARemoteFileToAnItem( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files/remoteLink'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'item_type' => APIHelper::prepareFormFields($this->val($options, 'itemType')), - 'item_id' => $this->val($options, 'itemId'), - 'remote_id' => $this->val($options, 'remoteId'), - 'remote_location' => APIHelper::prepareFormFields($this->val($options, 'remoteLocation')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a file as deleted. - * - * @param integer $id ID of the file - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAFile( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific file. - * - * @param integer $id ID of the file - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneFile( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates the properties of a file. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the file - * @param string $options['name'] (optional) Visible name of the file - * @param string $options['description'] (optional) Description of the file - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateFileDetails( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'description' => $this->val($options, 'description') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Initializes a file download. - * - * @param integer $id ID of the file - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDownloadOneFile( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/files/{id}/download'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/FiltersController.php b/src/Controllers/FiltersController.php deleted file mode 100644 index 3dcbf3de..00000000 --- a/src/Controllers/FiltersController.php +++ /dev/null @@ -1,473 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about all filters - * - * @param string $type (optional) Types of filters to fetch - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllFilters( - $type = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'type' => $type, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new filter, returns the ID upon success. Note that in the conditions json object only one - * first-level condition group is supported, and it must be glued with 'AND', and only two second level - * condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other - * combinations do not work (yet) but the syntax supports introducing them in future. For more - * information on how to add a new filter, see this tutorial. - * - * @param array $options Array with all options for search - * @param string $options['name'] Filter name - * @param string $options['conditions'] Filter conditions as a JSON object. It requires a minimum structure as - * follows: {"glue":"and","conditions":[{"glue":"and","conditions": - * [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. - * Replace CONDITION_OBJECTS with JSON objects of the following structure: - * {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or - * leave the array empty. Depending on the object type you should use another - * API endpoint to get field_id. There are five types of objects you can - * choose from: "person", "deal", "organization", "product", "activity" and - * you can use these types of operators depending on what type of a field you - * have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE - * '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT - * LIKE '%$'". To get a better understanding of how filters work try creating - * them directly from the Pipedrive application. - * @param string $options['type'] Type of filter to create. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewFilter( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'conditions' => $this->val($options, 'conditions'), - 'type' => APIHelper::prepareFormFields($this->val($options, 'type')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns all supported filter helpers. It helps to know what conditions and helpers are available - * when you want to add or update filters. For more information on how filter’s helpers can be - * used, see this tutorial. - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllFilterHelpers() - { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters/helpers'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a filter as deleted. - * - * @param integer $id ID of the filter - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAFilter( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific filter. Note that this also returns the condition lines of the filter. - * - * @param integer $id ID of the filter - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneFilter( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates existing filter. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the filter - * @param string $options['conditions'] Filter conditions as a JSON object. It requires a minimum structure as - * follows: {"glue":"and","conditions":[{"glue":"and","conditions": - * [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. - * Replace CONDITION_OBJECTS with JSON objects of the following structure: - * {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or - * leave the array empty. Depending on the object type you should use another - * API endpoint to get field_id. There are five types of objects you can - * choose from: "person", "deal", "organization", "product", "activity" and - * you can use these types of operators depending on what type of a field you - * have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE - * '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT - * LIKE '%$'". To get a better understanding of how filters work try creating - * them directly from the Pipedrive application. - * @param string $options['name'] (optional) Filter name - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateFilter( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/filters/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'conditions' => $this->val($options, 'conditions'), - 'name' => $this->val($options, 'name') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/GlobalMessagesController.php b/src/Controllers/GlobalMessagesController.php deleted file mode 100644 index b2ad7052..00000000 --- a/src/Controllers/GlobalMessagesController.php +++ /dev/null @@ -1,159 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/globalMessages'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'limit' => (null != $limit) ? $limit : 1, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GlobalMessageGet')); - } - - /** - * Removes global message from being shown, if message is dismissible - * - * @param integer $id ID of global message to be dismissed. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteDismissAGlobalMessage( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/globalMessages/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GlobalMessageDelete')); - } -} diff --git a/src/Controllers/GoalsController.php b/src/Controllers/GoalsController.php deleted file mode 100644 index 285e4816..00000000 --- a/src/Controllers/GoalsController.php +++ /dev/null @@ -1,423 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/goals'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to - * the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type. - * params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. - * Additionally, `is_active=` can be provided to search for only active/inactive goals. - * When providing `period.start`, `period.end` must also be provided and vice versa. - * - * @param array $options Array with all options for search - * @param string $options['typeName'] (optional) Type of the goal. If provided, - * everyone's goals will be returned. - * @param string $options['title'] (optional) Title of the goal. - * @param bool $options['isActive'] (optional) Whether goal is active or not. - * @param integer $options['assigneeId'] (optional) ID of the user who's goal to fetch. When - * omitted, only your goals will be returned. - * @param string $options['assigneeType'] (optional) Type of the goal's assignee. If provided, - * everyone's goals will be returned. - * @param double $options['expectedOutcomeTarget'] (optional) Numeric value of the outcome. If - * provided, everyone's goals will be returned. - * @param string $options['expectedOutcomeTrackingMetric'] (optional) Tracking metric of the expected outcome - * of the goal. If provided, everyone's goals will be - * returned. - * @param integer $options['expectedOutcomeCurrencyId'] (optional) Numeric ID of the goal's currency. Only - * applicable to goals with `expected_outcome. - * tracking_metric` with value `sum`. If provided, - * everyone's goals will be returned. - * @param integer $options['typeParamsPipelineId'] (optional) ID of the pipeline or `null` for all - * pipelines. If provided, everyone's goals will be - * returned. - * @param integer $options['typeParamsStageId'] (optional) ID of the stage. Applicable to only - * `deals_progressed` type of goals. If provided, - * everyone's goals will be returned. - * @param integer $options['typeParamsActivityTypeId'] (optional) ID of the activity type. Applicable to - * only `activities_completed` or `activities_added` - * types of goals. If provided, everyone's goals will - * be returned. - * @param DateTime $options['periodStart'] (optional) Start date of the period for which to - * find goals. Date in format of YYYY-MM-DD. When - * `period.start` is provided, `period.end` must be - * provided too. - * @param DateTime $options['periodEnd'] (optional) End date of the period for which to find - * goals. Date in format of YYYY-MM-DD. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function findGoals( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/goals/find'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'type.name' => $this->val($options, 'typeName'), - 'title' => $this->val($options, 'title'), - 'is_active' => $this->val($options, 'isActive', true), - 'assignee.id' => $this->val($options, 'assigneeId'), - 'assignee.type' => $this->val($options, 'assigneeType'), - 'expected_outcome.target' => $this->val($options, 'expectedOutcomeTarget'), - 'expected_outcome.tracking_metric' => $this->val($options, 'expectedOutcomeTrackingMetric'), - 'expected_outcome.currency_id' => $this->val($options, 'expectedOutcomeCurrencyId'), - 'type.params.pipeline_id' => $this->val($options, 'typeParamsPipelineId'), - 'type.params.stage_id' => $this->val($options, 'typeParamsStageId'), - 'type.params.activity_type_id' => $this->val($options, 'typeParamsActivityTypeId'), - 'period.start' => DateTimeHelper::toSimpleDate($this->val($options, 'periodStart')), - 'period.end' => DateTimeHelper::toSimpleDate($this->val($options, 'periodEnd')), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates existing goal. - * - * @param array $options Array with all options for search - * @param string $options['id'] ID of the goal to be updated. - * @param string $options['title'] (optional) Title of the goal. - * @param object $options['assignee'] (optional) Who is this goal assigned to. It requires the following - * JSON structure: { "id": "1", "type": "person" }. `type` can be either - * `person`, `company` or `team`. ID of the assignee person, company or - * team. - * @param object $options['type'] (optional) Type of the goal. It requires the following JSON structure: - * { "name": "deals_started", "params": { "pipeline_id": 1 } }. Type - * can be one of: `deals_won`,`deals_progressed`,`activities_completed`, - * `activities_added` or `deals_started`. `params` can include - * `pipeline_id`, `stage_id` or `activity_type_id`. `stage_id` is - * related to only `deals_progressed` type of goals and - * `activity_type_id` to `activities_completed` or `activities_added` - * types of goals. To track goal in all pipelines set `pipeline_id` as - * `null`. - * @param object $options['expectedOutcome'] (optional) Expected outcome of the goal. Expected outcome can be - * tracked either by `quantity` or by `sum`. It requires the following - * JSON structure: { "target": "50", "tracking_metric": "quantity" } or - * { "target": "50", "tracking_metric": "sum", "currency_id": 1 }. - * `currency_id` should only be added to `sum` type of goals. - * @param object $options['duration'] (optional) Date when the goal starts and ends. It requires the - * following JSON structure: { "start": "2019-01-01", "end": "2022-12- - * 31" }. Date in format of YYYY-MM-DD. - * @param string $options['interval'] (optional) Date when the goal starts and ends. It requires the - * following JSON structure: { "start": "2019-01-01", "end": "2022-12- - * 31" }. Date in format of YYYY-MM-DD. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateExistingGoal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/goals/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'title' => $this->val($options, 'title'), - 'assignee' => $this->val($options, 'assignee'), - 'type' => $this->val($options, 'type'), - 'expected_outcome' => $this->val($options, 'expectedOutcome'), - 'duration' => $this->val($options, 'duration'), - 'interval' => APIHelper::prepareFormFields($this->val($options, 'interval')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks goal as deleted. - * - * @param string $id ID of the goal to be deleted. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteExistingGoal( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/goals/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Gets progress of a goal for specified period. - * - * @param array $options Array with all options for search - * @param string $options['id'] ID of the goal that the results are looked for. - * @param DateTime $options['periodStart'] Start date of the period for which to find progress of a goal. Date in - * format of YYYY-MM-DD. - * @param DateTime $options['periodEnd'] End date of the period for which to find progress of a goal. Date in - * format of YYYY-MM-DD. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getResultOfAGoal( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/goals/{id}/results'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'period.start' => DateTimeHelper::toSimpleDate($this->val($options, 'periodStart')), - 'period.end' => DateTimeHelper::toSimpleDate($this->val($options, 'periodEnd')), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/ItemSearchController.php b/src/Controllers/ItemSearchController.php deleted file mode 100644 index b6fa1c73..00000000 --- a/src/Controllers/ItemSearchController.php +++ /dev/null @@ -1,198 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/itemSearch'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'item_types' => $this->val($options, 'itemTypes'), - 'fields' => $this->val($options, 'fields'), - 'search_for_related_items' => $this->val($options, 'searchForRelatedItems'), - 'exact_match' => $this->val($options, 'exactMatch'), - 'include_fields' => $this->val($options, 'includeFields'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (Deals, Persons, Organizations or Products). - * - * @param array $options Array with all options for search - * @param string $options['term'] The search term to look for. Minimum 2 characters (or 1 if using exact_match). - * @param string $options['fieldType'] The type of the field to perform the search from - * @param string $options['fieldKey'] The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). - * @param bool $options['exactMatch'] (optional) When enabled, only full exact matches against the given term are returned. The search is case sensitive - * @param bool $options['returnItemIds'] (optional) Whether to return the IDs of the matching items or not. When not set or set to 0 or false, only distinct values of the searched field are returned. When set to 1 or true, the ID of each found item is returned. - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function performASearchUsingASpecificFieldFromAnItemType( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/itemSearch/field'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'field_type' => $this->val($options, 'fieldType'), - 'exact_match' => $this->val($options, 'exactMatch'), - 'field_key' => $this->val($options, 'fieldKey'), - 'return_item_ids' => $this->val($options, 'returnItemIds'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/MailMessagesController.php b/src/Controllers/MailMessagesController.php deleted file mode 100644 index eca7ea92..00000000 --- a/src/Controllers/MailMessagesController.php +++ /dev/null @@ -1,126 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/mailbox/mailMessages/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'include_body' => $this->val($options, 'includeBody'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\MailMessage')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/MailThreadsController.php b/src/Controllers/MailThreadsController.php deleted file mode 100644 index 872f164e..00000000 --- a/src/Controllers/MailThreadsController.php +++ /dev/null @@ -1,360 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/mailbox/mailThreads'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'folder' => $this->val($options, 'folder'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\MailThread')); - } - - /** - * Marks mail thread as deleted. - * - * @param integer $id ID of the mail thread - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteMailThread( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/mailbox/mailThreads/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\MailThreadDelete')); - } - - /** - * Returns specific mail thread. - * - * @param integer $id ID of the mail thread - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneMailThread( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/mailbox/mailThreads/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\MailThreadOne')); - } - - /** - * Updates the properties of a mail thread. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the mail thread - * @param integer $options['dealId'] (optional) ID of the deal this thread is associated with - * @param int $options['sharedFlag'] (optional) TODO: type description here - * @param int $options['readFlag'] (optional) TODO: type description here - * @param int $options['archivedFlag'] (optional) TODO: type description here - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateMailThreadDetails( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/mailbox/mailThreads/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'deal_id' => $this->val($options, 'dealId'), - 'shared_flag' => APIHelper::prepareFormFields($this->val($options, 'sharedFlag')), - 'read_flag' => APIHelper::prepareFormFields($this->val($options, 'readFlag')), - 'archived_flag' => APIHelper::prepareFormFields($this->val($options, 'archivedFlag')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\MailThreadPut')); - } - - /** - * Get mail messages inside specified mail thread. - * - * @param integer $id ID of the mail thread - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllMailMessagesOfMailThread( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/mailbox/mailThreads/{id}/mailMessages'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\MailThreadMessages')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/NoteFieldsController.php b/src/Controllers/NoteFieldsController.php deleted file mode 100644 index 35a48be4..00000000 --- a/src/Controllers/NoteFieldsController.php +++ /dev/null @@ -1,92 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/noteFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } -} diff --git a/src/Controllers/NotesController.php b/src/Controllers/NotesController.php deleted file mode 100644 index ac327ae6..00000000 --- a/src/Controllers/NotesController.php +++ /dev/null @@ -1,452 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/notes'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - 'lead_id' => $this->val($options, 'leadId'), - 'deal_id' => $this->val($options, 'dealId'), - 'person_id' => $this->val($options, 'personId'), - 'org_id' => $this->val($options, 'orgId'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'sort' => $this->val($options, 'sort'), - 'start_date' => DateTimeHelper::toSimpleDate($this->val($options, 'startDate')), - 'end_date' => DateTimeHelper::toSimpleDate($this->val($options, 'endDate')), - 'pinned_to_lead_flag' => $this->val($options, 'pinnedToLeadFlag'), - 'pinned_to_deal_flag' => $this->val($options, 'pinnedToDealFlag'), - 'pinned_to_organization_flag' => $this->val($options, 'pinnedToOrganizationFlag'), - 'pinned_to_person_flag' => $this->val($options, 'pinnedToPersonFlag'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetNotes')); - } - - /** - * Adds a new note. - * - * @param array $options Array with all options for search - * @param string $options['content'] Content of the note in HTML format. Subject to - * sanitization on the back-end. - * @param integer $options['userId'] (optional) ID of the user who will be marked as the - * author of this note. Only an admin can change the author. - * @param string $options['leadId'] (optional) ID of the lead the note will be attached to. - * @param integer $options['dealId'] (optional) ID of the deal the note will be attached to. - * @param integer $options['personId'] (optional) ID of the person this note will be attached to. - * @param integer $options['orgId'] (optional) ID of the organization this note will be - * attached to. - * @param string $options['addTime'] (optional) Optional creation date & time of the Note in - * UTC. Can be set in the past or in the future. Requires - * admin user API token. Format: YYYY-MM-DD HH:MM:SS - * @param int $options['pinnedToLeadFlag'] (optional) If set, then results are filtered by note to - * lead pinning state (lead_id is also required). - * @param int $options['pinnedToDealFlag'] (optional) If set, then results are filtered by note to - * deal pinning state (deal_id is also required). - * @param int $options['pinnedToOrganizationFlag'] (optional) If set, then results are filtered by note to - * organization pinning state (org_id is also required). - * @param int $options['pinnedToPersonFlag'] (optional) If set, then results are filtered by note to - * person pinning state (person_id is also required). - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANote( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/notes'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'content' => $this->val($options, 'content'), - 'user_id' => $this->val($options, 'userId'), - 'lead_id' => $this->val($options, 'leadId'), - 'deal_id' => $this->val($options, 'dealId'), - 'person_id' => $this->val($options, 'personId'), - 'org_id' => $this->val($options, 'orgId'), - 'add_time' => $this->val($options, 'addTime'), - 'pinned_to_lead_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToLeadFlag')), - 'pinned_to_deal_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToDealFlag')), - 'pinned_to_organization_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToOrganizationFlag')), - 'pinned_to_person_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToPersonFlag')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PostNote')); - } - - /** - * Deletes a specific note. - * - * @param integer $id ID of the note - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteANote( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/notes/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteNote')); - } - - /** - * Returns details about a specific note. - * - * @param integer $id ID of the note - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneNote( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/notes/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PostNote')); - } - - /** - * Updates a note. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the note - * @param string $options['content'] Content of the note in HTML format. Subject to - * sanitization on the back-end. - * @param integer $options['userId'] (optional) ID of the user who will be marked as the - * author of this note. Only an admin can change the author. - * @param string $options['leadId'] (optional) ID of the lead the note will be attached to. - * @param integer $options['dealId'] (optional) ID of the deal the note will be attached to. - * @param integer $options['personId'] (optional) ID of the person this note will be attached to. - * @param integer $options['orgId'] (optional) ID of the organization this note will be - * attached to. - * @param string $options['addTime'] (optional) Optional creation date & time of the Note in - * UTC. Can be set in the past or in the future. Requires - * admin user API token. Format: YYYY-MM-DD HH:MM:SS - * @param int $options['pinnedToLeadFlag'] (optional) If set, then results are filtered by note to - * lead pinning state (lead_id is also required). - * @param int $options['pinnedToDealFlag'] (optional) If set, then results are filtered by note to - * deal pinning state (deal_id is also required). - * @param int $options['pinnedToOrganizationFlag'] (optional) If set, then results are filtered by note to - * organization pinning state (org_id is also required). - * @param int $options['pinnedToPersonFlag'] (optional) If set, then results are filtered by note to - * person pinning state (person_id is also required). - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateANote( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/notes/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'content' => $this->val($options, 'content'), - 'user_id' => $this->val($options, 'userId'), - 'lead_id' => $this->val($options, 'leadId'), - 'deal_id' => $this->val($options, 'dealId'), - 'person_id' => $this->val($options, 'personId'), - 'org_id' => $this->val($options, 'orgId'), - 'add_time' => $this->val($options, 'addTime'), - 'pinned_to_lead_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToLeadFlag')), - 'pinned_to_deal_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToDealFlag')), - 'pinned_to_organization_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToOrganizationFlag')), - 'pinned_to_person_flag' => APIHelper::prepareFormFields($this->val($options, 'pinnedToPersonFlag')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PostNote')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/OAuthAuthorizationController.php b/src/Controllers/OAuthAuthorizationController.php deleted file mode 100644 index 5787b14b..00000000 --- a/src/Controllers/OAuthAuthorizationController.php +++ /dev/null @@ -1,213 +0,0 @@ - BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => $this->val($options, 'authorization') - ); - - //prepare parameters - $_parameters = array ( - 'grant_type' => 'authorization_code', - 'code' => $this->val($options, 'code'), - 'redirect_uri' => $this->val($options, 'redirectUri') - ); - if (isset($fieldParameters)) { - $_parameters = array_merge($_parameters, $fieldParameters); - } - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 400) { - throw new Exceptions\OAuthProviderException('OAuth 2 provider returned an error.', $_httpContext); - } - - if ($response->code == 401) { - throw new Exceptions\OAuthProviderException( - 'OAuth 2 provider says client authentication failed.', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return $mapper->mapClass($response->body, 'Pipedrive\\Models\\OAuthToken'); - } - - /** - * Obtain a new access token using a refresh token - * - * @param array $options Array with all options for search - * @param string $options['authorization'] Authorization header in Basic auth format - * @param string $options['refreshToken'] Refresh token - * @param string $options['scope'] (optional) Requested scopes as a space-delimited list. - * @param array $fieldParameters Additional optional form parameters are supported by this endpoint - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function createRefreshToken( - $options, - $fieldParameters = null - ) { - - //prepare query string for API call - $_queryBuilder = '/oauth/token'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri(Servers::OAUTH) . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => $this->val($options, 'authorization') - ); - - //prepare parameters - $_parameters = array ( - 'grant_type' => 'refresh_token', - 'refresh_token' => $this->val($options, 'refreshToken'), - 'scope' => $this->val($options, 'scope') - ); - if (isset($fieldParameters)) { - $_parameters = array_merge($_parameters, $fieldParameters); - } - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 400) { - throw new Exceptions\OAuthProviderException('OAuth 2 provider returned an error.', $_httpContext); - } - - if ($response->code == 401) { - throw new Exceptions\OAuthProviderException( - 'OAuth 2 provider says client authentication failed.', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return $mapper->mapClass($response->body, 'Pipedrive\\Models\\OAuthToken'); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/OrganizationFieldsController.php b/src/Controllers/OrganizationFieldsController.php deleted file mode 100644 index e8d6759c..00000000 --- a/src/Controllers/OrganizationFieldsController.php +++ /dev/null @@ -1,391 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationFields'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about all organization fields - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllOrganizationFields() - { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new organization field. For more information on adding a new custom field, see this - * tutorial. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewOrganizationField( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a field as deleted. For more information on how to delete a custom field, see this - * tutorial. - * - * @param integer $id ID of the field - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAnOrganizationField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific organization field. - * - * @param integer $id ID of the field - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneOrganizationField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates an organization field. See an example of updating custom fields’ values in this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the field - * @param string $options['name'] Name of the field - * @param string $options['options'] (optional) When field_type is either set or enum, possible options must be - * supplied as a JSON-encoded sequential array of objects. All active items must - * be supplied and already existing items must have their ID supplied. New items - * only require a label. Example: [{"id":123,"label":"Existing Item"},{"label": - * "New Item"}] - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAnOrganizationField( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'options' => $this->val($options, 'options') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/OrganizationRelationshipsController.php b/src/Controllers/OrganizationRelationshipsController.php deleted file mode 100644 index 152ad0fe..00000000 --- a/src/Controllers/OrganizationRelationshipsController.php +++ /dev/null @@ -1,350 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationRelationships'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'org_id' => $orgId, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Creates and returns an organization relationship. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function createAnOrganizationRelationship( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationRelationships'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Deletes an organization relationship and returns the deleted id. - * - * @param integer $id ID of the organization relationship - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAnOrganizationRelationship( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationRelationships/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Finds and returns an organization relationship from its ID. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization relationship - * @param integer $options['orgId'] (optional) ID of the base organization for the returned calculated values - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneOrganizationRelationship( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationRelationships/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'org_id' => $this->val($options, 'orgId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates and returns an organization relationship. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization relationship - * @param integer $options['orgId'] (optional) ID of the base organization for the returned calculated - * values - * @param string $options['type'] (optional) The type of organization relationship. - * @param integer $options['relOwnerOrgId'] (optional) The owner of this relationship. If type is 'parent', - * then the owner is the parent and the linked organization is the - * daughter. - * @param integer $options['relLinkedOrgId'] (optional) The linked organization in this relationship. If type is - * 'parent', then the linked organization is the daughter. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAnOrganizationRelationship( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizationRelationships/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'org_id' => $this->val($options, 'orgId'), - 'type' => APIHelper::prepareFormFields($this->val($options, 'type')), - 'rel_owner_org_id' => $this->val($options, 'relOwnerOrgId'), - 'rel_linked_org_id' => $this->val($options, 'relLinkedOrgId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/OrganizationsController.php b/src/Controllers/OrganizationsController.php deleted file mode 100644 index 99f802b6..00000000 --- a/src/Controllers/OrganizationsController.php +++ /dev/null @@ -1,1166 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns all organizations - * - * @param array $options Array with all options for search - * @param integer $options['userId'] (optional) If supplied, only organizations owned by the given user will be - * returned. - * @param integer $options['filterId'] (optional) ID of the filter to use - * @param string $options['firstChar'] (optional) If supplied, only organizations whose name starts with the - * specified letter will be returned (case insensitive). - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma (field_name_1 - * ASC, field_name_2 DESC). Only first-level field keys are supported (no - * nested keys). - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllOrganizations( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - 'filter_id' => $this->val($options, 'filterId'), - 'first_char' => $this->val($options, 'firstChar'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Searches all Organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - * - * @param array $options Array with all options for search - * @param string $options['term'] The search term to look for. Minimum 2 characters (or 1 if using exact_match). - * @param string $options['fields'] (optional) A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @param bool $options['exactMatch'] (optional) When enabled, only full exact matches against the given term are returned. It is not case sensitive. - * @param integer $options['start'] (optional) Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. - * @param integer $options['limit'] (optional) Items shown per page - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function searchOrganizations( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/search'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'fields' => $this->val($options, 'fields'), - 'exact_match' => $this->val($options, 'exactMatch'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new organization. Note that you can supply additional custom fields along with the request - * that are not described here. These custom fields are different for each Pipedrive account and can be - * recognized by long hashes as keys. To determine which custom fields exists, fetch the - * organizationFields and look for 'key' values. For more information on how to add an organization, - * see this tutorial. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAnOrganization( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks an organization as deleted. - * - * @param integer $id ID of the organization - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAnOrganization( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns details of an organization. Note that this also returns some additional fields which are not - * present when asking for all organizations. Also note that custom fields appear as long hashes in the - * resulting data. These hashes can be mapped against the 'key' value of organizationFields. - * - * @param integer $id ID of the organization - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDetailsOfAnOrganization( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates the properties of an organization. - * - * Note that you can supply additional custom fields along with the request - * that are not described here. These custom fields are different for each Pipedrive account and can be - * recognized by long hashes as keys. To determine which custom fields exists, fetch the - * organizationFields and look for 'key' values. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param string $options['name'] (optional) Organization name - * @param integer $options['ownerId'] (optional) ID of the user who will be marked as the owner of this - * organization. When omitted, the authorized user ID will be used. - * @param int $options['visibleTo'] (optional) Visibility of the organization. If omitted, visibility will be - * set to the default visibility setting of this item type for the authorized - * user.
1
Owner & followers - * (private)
3
Entire company (shared)
- * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $options); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Json($options)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists activities associated with an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['done'] (optional) Whether the activity is done or not. 0 = Not done, 1 = Done. If - * omitted returns both Done and Not done activities. - * @param string $options['exclude'] (optional) A comma-separated string of activity IDs to exclude from result - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listActivitiesAssociatedWithAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/activities'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'done' => $this->val($options, 'done'), - 'exclude' => $this->val($options, 'exclude'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists deals associated with an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param string $options['status'] (optional) Only fetch deals with specific status. If omitted, - * all not deleted deals are fetched. - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma - * (field_name_1 ASC, field_name_2 DESC). Only first-level - * field keys are supported (no nested keys). - * @param int $options['onlyPrimaryAssociation'] (optional) If set, only deals that are directly associated - * to the organization are fetched. If not set (default), all - * deals are fetched that are either directly or indirectly - * related to the organization. Indirect relations include - * relations through custom, organization-type fields and - * through persons of the given organization. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listDealsAssociatedWithAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/deals'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'status' => $this->val($options, 'status', Models\Status2Enum::ALL_NOT_DELETED), - 'sort' => $this->val($options, 'sort'), - 'only_primary_association' => $this->val($options, 'onlyPrimaryAssociation'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists files associated with an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['includeDeletedFiles'] (optional) When enabled, the list of files will also include - * deleted files. Please note that trying to download these files - * will not work. - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma - * (field_name_1 ASC, field_name_2 DESC). Only first-level field - * keys are supported (no nested keys). Supported fields: id, - * user_id, deal_id, person_id, org_id, product_id, add_time, - * update_time, file_name, file_type, file_size, comment. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFilesAttachedToAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/files'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'include_deleted_files' => $this->val($options, 'includeDeletedFiles'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists updates about an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listUpdatesAboutAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/flow'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists the followers of an organization. - * - * @param integer $id ID of the organization - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFollowersOfAnOrganization( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a follower to an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['userId'] ID of the user - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAFollowerToAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'user_id' => $this->val($options, 'userId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Deletes a follower from an organization. You can retrieve the follower_id from the List - * followers of an organization endpoint. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['followerId'] ID of the follower - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAFollowerFromAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/followers/{follower_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'follower_id' => $this->val($options, 'followerId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists mail messages associated with an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listMailMessagesAssociatedWithAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/mailMessages'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Merges an organization with another organization. For more information on how to merge two - * organizations, see this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['mergeWithId'] ID of the organization that the organization will be merged with - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateMergeTwoOrganizations( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/merge'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'merge_with_id' => $this->val($options, 'mergeWithId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * List users permitted to access an organization - * - * @param integer $id ID of the organization - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listPermittedUsers( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/permittedUsers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists persons associated with an organization. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the organization - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listPersonsOfAnOrganization( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/organizations/{id}/persons'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/PermissionSetsController.php b/src/Controllers/PermissionSetsController.php deleted file mode 100644 index 910ed593..00000000 --- a/src/Controllers/PermissionSetsController.php +++ /dev/null @@ -1,247 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/permissionSets'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 404) { - throw new APIException('If the User ID has no assignments, then it will return NotFound', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PermissionSets')); - } - - /** - * Get one Permission Set - * - * @param integer $id ID of the permission set - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOnePermissionSet( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/permissionSets/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 404) { - throw new APIException('If the User ID has no assignments, then it will return NotFound', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\SinglePermissionSetsItem')); - } - - /** - * The list of assignments for a Permission Set - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the permission set - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listPermissionSetAssignments( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/permissionSets/{id}/assignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 404) { - throw new APIException('If the User ID has no assignments, then it will return NotFound', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserAssignmentsToPermissionSet')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/PersonFieldsController.php b/src/Controllers/PersonFieldsController.php deleted file mode 100644 index 87a25b64..00000000 --- a/src/Controllers/PersonFieldsController.php +++ /dev/null @@ -1,400 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/personFields'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about all person fields - * - * @param integer $options['limit'] (optional) For pagination, the limit of entries to be returned - * @param integer $options['start'] (optional) For pagination, the position that represents the first result for the page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllPersonFields( - $options = array() - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/personFields'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new person field. For more information on adding a new custom field, see this - * tutorial. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewPersonField( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/personFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a field as deleted. For more information on how to delete a custom field, see this - * tutorial. - * - * @param integer $id ID of the field - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAPersonField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/personFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific person field. - * - * @param integer $id ID of the field - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOnePersonField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/personFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates a person field. See an example of updating custom fields’ values in this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the field - * @param string $options['name'] Name of the field - * @param string $options['options'] (optional) When field_type is either set or enum, possible options must be - * supplied as a JSON-encoded sequential array of objects. All active items must - * be supplied and already existing items must have their ID supplied. New items - * only require a label. Example: [{"id":123,"label":"Existing Item"},{"label": - * "New Item"}] - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAPersonField( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/personFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'options' => $this->val($options, 'options') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/PersonsController.php b/src/Controllers/PersonsController.php deleted file mode 100644 index b962bcb7..00000000 --- a/src/Controllers/PersonsController.php +++ /dev/null @@ -1,1290 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns all persons - * - * @param array $options Array with all options for search - * @param integer $options['userId'] (optional) If supplied, only persons owned by the given user will be - * returned. - * @param integer $options['filterId'] (optional) ID of the filter to use. - * @param string $options['firstChar'] (optional) If supplied, only persons whose name starts with the specified - * letter will be returned (case insensitive). - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma (field_name_1 - * ASC, field_name_2 DESC). Only first-level field keys are supported (no - * nested keys). - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllPersons( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - 'filter_id' => $this->val($options, 'filterId'), - 'first_char' => $this->val($options, 'firstChar'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found Persons can be filtered by Organization ID. - * - * @param array $options Array with all options for search - * @param string $options['term'] The search term to look for. Minimum 2 characters (or 1 if using exact_match). - * @param string $options['fields'] (optional) A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @param bool $options['exactMatch'] (optional) When enabled, only full exact matches against the given term are returned. It is not case sensitive. - * @param integer $options['organizationId'] (optional) Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. - * @param string $options['includeFields'] (optional) Supports including optional fields in the results which are not provided by default. - * @param integer $options['start'] (optional) Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. - * @param integer $options['limit'] (optional) Items shown per page - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function searchPersons( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/search'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'fields' => $this->val($options, 'fields'), - 'exact_match' => $this->val($options, 'exactMatch'), - 'organization_id' => $this->val($options, 'organizationId'), - 'include_fields' => $this->val($options, 'includeFields'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new person. Note that you can supply additional custom fields along with the request that are - * not described here. These custom fields are different for each Pipedrive account and can be - * recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields - * and look for 'key' values. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAPerson( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a person as deleted. - * - * @param integer $id ID of a person - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAPerson( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns details of a person. Note that this also returns some additional fields which are not - * present when asking for all persons. Also note that custom fields appear as long hashes in the - * resulting data. These hashes can be mapped against the 'key' value of personFields. - * - * @param integer $id ID of a person - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDetailsOfAPerson( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates the properties of a person. For more information on how to update a person, see this tutorial. - * - * Note that you can supply additional custom fields along with the request that are - * not described here. These custom fields are different for each Pipedrive account and can be - * recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields - * and look for 'key' values. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param string $options['name'] (optional) Person name - * @param integer $options['ownerId'] (optional) ID of the user who will be marked as the owner of this person. - * When omitted, the authorized user ID will be used. - * @param integer $options['orgId'] (optional) ID of the organization this person will belong to. - * @param array $options['email'] (optional) Email addresses (one or more) associated with the person, - * presented in the same manner as received by GET request of a person. - * @param array $options['phone'] (optional) Phone numbers (one or more) associated with the person, - * presented in the same manner as received by GET request of a person. - * @param int $options['visibleTo'] (optional) Visibility of the person. If omitted, visibility will be set to - * the default visibility setting of this item type for the authorized user. - *
1
Owner & followers - * (private)
3
Entire company (shared)
- * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $options); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Json($options)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists activities associated with a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['done'] (optional) Whether the activity is done or not. 0 = Not done, 1 = Done. If - * omitted returns both Done and Not done activities. - * @param string $options['exclude'] (optional) A comma-separated string of activity IDs to exclude from result - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listActivitiesAssociatedWithAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/activities'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'done' => $this->val($options, 'done'), - 'exclude' => $this->val($options, 'exclude'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists deals associated with a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param string $options['status'] (optional) Only fetch deals with specific status. If omitted, all not deleted - * deals are fetched. - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma (field_name_1 ASC, - * field_name_2 DESC). Only first-level field keys are supported (no nested - * keys). - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listDealsAssociatedWithAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/deals'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'status' => $this->val($options, 'status', Models\Status2Enum::ALL_NOT_DELETED), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists files associated with a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['includeDeletedFiles'] (optional) When enabled, the list of files will also include - * deleted files. Please note that trying to download these files - * will not work. - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma - * (field_name_1 ASC, field_name_2 DESC). Only first-level field - * keys are supported (no nested keys). Supported fields: id, - * user_id, deal_id, person_id, org_id, product_id, add_time, - * update_time, file_name, file_type, file_size, comment. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFilesAttachedToAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/files'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'include_deleted_files' => $this->val($options, 'includeDeletedFiles'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists updates about a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listUpdatesAboutAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/flow'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists the followers of a person. - * - * @param integer $id ID of a person - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFollowersOfAPerson( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a follower to a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['userId'] ID of the user - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAFollowerToAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'user_id' => $this->val($options, 'userId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Delete a follower from a person - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['followerId'] ID of the follower - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deletesAFollowerFromAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/followers/{follower_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'follower_id' => $this->val($options, 'followerId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists mail messages associated with a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listMailMessagesAssociatedWithAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/mailMessages'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Merges a person with another person. For more information on how to merge two persons, see this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['mergeWithId'] ID of the person that the person will be merged with - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateMergeTwoPersons( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/merge'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'merge_with_id' => $this->val($options, 'mergeWithId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * List users permitted to access a person - * - * @param integer $id ID of a person - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listPermittedUsers( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/permittedUsers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Delete person picture - * - * @param integer $id ID of a person - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deletePersonPicture( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/picture'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Add a picture to a person. If a picture is already set, the old picture will be replaced. Added - * image (or the cropping parameters supplied with the request) should have an equal width and height - * and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized - * to 128 and 512 pixel wide squares. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param string $options['file'] One image supplied in the multipart/form-data encoding. - * @param integer $options['cropX'] (optional) X coordinate to where start cropping form (in pixels) - * @param integer $options['cropY'] (optional) Y coordinate to where start cropping form (in pixels) - * @param integer $options['cropWidth'] (optional) Width of cropping area (in pixels) - * @param integer $options['cropHeight'] (optional) Height of cropping area (in pixels) - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addPersonPicture( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/picture'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'file' => Request\Body::File($this->val($options, 'file')), - 'crop_x' => $this->val($options, 'cropX'), - 'crop_y' => $this->val($options, 'cropY'), - 'crop_width' => $this->val($options, 'cropWidth'), - 'crop_height' => $this->val($options, 'cropHeight') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request::buildHTTPCurlQuery($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists products associated with a person. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of a person - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listProductsAssociatedWithAPerson( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/persons/{id}/products'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/PipelinesController.php b/src/Controllers/PipelinesController.php deleted file mode 100644 index c7afbc49..00000000 --- a/src/Controllers/PipelinesController.php +++ /dev/null @@ -1,573 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new pipeline - * - * @param array $options Array with all options for search - * @param string $options['name'] (optional) Name of the pipeline - * @param int $options['dealProbability'] (optional) TODO: type description here - * @param integer $options['orderNr'] (optional) Defines pipelines order. First order(order_nr=0) is the - * default pipeline. - * @param int $options['active'] (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewPipeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'deal_probability' => APIHelper::prepareFormFields($this->val($options, 'dealProbability')), - 'order_nr' => $this->val($options, 'orderNr'), - 'active' => APIHelper::prepareFormFields($this->val($options, 'active')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a pipeline as deleted. - * - * @param integer $id ID of the pipeline - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAPipeline( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline - * across its stages. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the pipeline - * @param string $options['totalsConvertCurrency'] (optional) 3-letter currency code of any of the supported - * currencies. When supplied, per_stages_converted is returned - * in deals_summary which contains the currency-converted total - * amounts in the given currency per each stage. You may also - * set this parameter to 'default_currency' in which case users - * default currency is used. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOnePipeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'totals_convert_currency' => $this->val($options, 'totalsConvertCurrency'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates pipeline properties - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the pipeline - * @param string $options['name'] (optional) Name of the pipeline - * @param int $options['dealProbability'] (optional) TODO: type description here - * @param integer $options['orderNr'] (optional) Defines pipelines order. First order(order_nr=0) is the - * default pipeline. - * @param int $options['active'] (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateEditAPipeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'deal_probability' => APIHelper::prepareFormFields($this->val($options, 'dealProbability')), - 'order_nr' => $this->val($options, 'orderNr'), - 'active' => APIHelper::prepareFormFields($this->val($options, 'active')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns all stage-to-stage conversion and pipeline-to-close rates for given time period. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the pipeline - * @param DateTime $options['startDate'] Start of the period. Date in format of YYYY-MM-DD. - * @param DateTime $options['endDate'] End of the period. Date in format of YYYY-MM-DD. - * @param integer $options['userId'] (optional) ID of the user who's pipeline metrics statistics to fetch. If - * omitted, the authorized user will be used. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsConversionRatesInPipeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines/{id}/conversion_statistics'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start_date' => DateTimeHelper::toSimpleDate($this->val($options, 'startDate')), - 'end_date' => DateTimeHelper::toSimpleDate($this->val($options, 'endDate')), - 'user_id' => $this->val($options, 'userId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists deals in a specific pipeline across all its stages - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the pipeline - * @param integer $options['filterId'] (optional) If supplied, only deals matching the given filter - * will be returned. - * @param integer $options['userId'] (optional) If supplied, filter_id will not be considered and - * only deals owned by the given user will be returned. If - * omitted, deals owned by the authorized user will be returned. - * @param int $options['everyone'] (optional) If supplied, filter_id and user_id will not be - * considered – instead, deals owned by everyone will be - * returned. - * @param integer $options['stageId'] (optional) If supplied, only deals within the given stage - * will be returned. - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['getSummary'] (optional) Whether to include summary of the pipeline in the - * additional_data or not. - * @param string $options['totalsConvertCurrency'] (optional) 3-letter currency code of any of the supported - * currencies. When supplied, per_stages_converted is returned - * inside deals_summary inside additional_data which contains - * the currency-converted total amounts in the given currency - * per each stage. You may also set this parameter to - * 'default_currency' in which case users default currency is - * used. Only works when get_summary parameter flag is enabled. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsInAPipeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines/{id}/deals'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'filter_id' => $this->val($options, 'filterId'), - 'user_id' => $this->val($options, 'userId'), - 'everyone' => $this->val($options, 'everyone'), - 'stage_id' => $this->val($options, 'stageId'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'get_summary' => $this->val($options, 'getSummary'), - 'totals_convert_currency' => $this->val($options, 'totalsConvertCurrency'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns statistics for deals movements for given time period. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the pipeline - * @param DateTime $options['startDate'] Start of the period. Date in format of YYYY-MM-DD. - * @param DateTime $options['endDate'] End of the period. Date in format of YYYY-MM-DD. - * @param integer $options['userId'] (optional) ID of the user who's pipeline statistics to fetch. If omitted, - * the authorized user will be used. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsMovementsInPipeline( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/pipelines/{id}/movement_statistics'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start_date' => DateTimeHelper::toSimpleDate($this->val($options, 'startDate')), - 'end_date' => DateTimeHelper::toSimpleDate($this->val($options, 'endDate')), - 'user_id' => $this->val($options, 'userId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/ProductFieldsController.php b/src/Controllers/ProductFieldsController.php deleted file mode 100644 index 09e40874..00000000 --- a/src/Controllers/ProductFieldsController.php +++ /dev/null @@ -1,423 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/productFields'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteMultipleProductFieldsResponse')); - } - - /** - * Returns data about all product fields - * - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllProductFields() - { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/productFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetAllProductFieldsResponse')); - } - - /** - * Adds a new product field. For more information on adding a new custom field, see this - * tutorial. - * - * @param object $body (optional) TODO: type description here - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewProductField( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/productFields'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetProductFieldResponse')); - } - - /** - * Marks a field as deleted. For more information on how to delete a custom field, see this - * tutorial. - * - * @param integer $id ID of the Product Field - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAProductField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/productFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 410) { - throw new Exceptions\FailResponseException( - 'The Product Field with the specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteProductFieldResponse')); - } - - /** - * Returns data about a specific product field. - * - * @param integer $id ID of the Product Field - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneProductField( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/productFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 410) { - throw new Exceptions\FailResponseException( - 'The Product Field with the specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetProductFieldResponse')); - } - - /** - * Updates a product field. See an example of updating custom fields’ values in this tutorial. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the Product Field - * @param string $options['name'] Name of the field - * @param string $options['options'] (optional) When field_type is either set or enum, possible options must be - * supplied as a JSON-encoded sequential array, for example: ["red","blue", - * "lilac"] - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAProductField( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/productFields/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'options' => $this->val($options, 'options') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetProductFieldResponse')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/ProductsController.php b/src/Controllers/ProductsController.php deleted file mode 100644 index 5447a71a..00000000 --- a/src/Controllers/ProductsController.php +++ /dev/null @@ -1,793 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - 'filter_id' => $this->val($options, 'filterId'), - 'first_char' => $this->val($options, 'firstChar'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Searches all Products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. - * - * @param array $options Array with all options for search - * @param string $options['term'] The search term to look for. Minimum 2 characters (or 1 if using exact_match). - * @param string $options['fields'] (optional) A comma-separated string array. The fields to perform the search from. Defaults to all of them. - * @param bool $options['exactMatch'] (optional) When enabled, only full exact matches against the given term are returned. It is not case sensitive - * @param string $options['includeFields'] (optional) Supports including optional fields in the results which are not provided by default. - * @param integer $options['start'] (optional) Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. - * @param integer $options['limit'] (optional) Items shown per page - * - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function searchProducts( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/search'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'fields' => $this->val($options, 'fields'), - 'exact_match' => $this->val($options, 'exactMatch'), - 'include_fields' => $this->val($options, 'includeFields'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new product to the products inventory. For more information on how to add a product, see this tutorial. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAProduct( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a product as deleted. - * - * @param integer $id ID of the product - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAProduct( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific product. - * - * @param integer $id ID of the product - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneProduct( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates product data. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the product - * @param string $options['name'] (optional) Name of the product. - * @param string $options['code'] (optional) Product code. - * @param string $options['unit'] (optional) Unit in which this product is sold - * @param double $options['tax'] (optional) Tax percentage - * @param int $options['activeFlag'] (optional) Whether this product will be made active or not. - * @param int $options['visibleTo'] (optional) Visibility of the product. If omitted, visibility will be set - * to the default visibility setting of this item type for the authorized - * user.
1
Owner & followers - * (private)
3
Entire company (shared)
- * @param integer $options['ownerId'] (optional) ID of the user who will be marked as the owner of this product. - * When omitted, the authorized user ID will be used. - * @param string $options['prices'] (optional) Array of objects, each containing: currency (string), price - * (number), cost (number, optional), overhead_cost (number, optional). Note - * that there can only be one price per product per currency. When 'prices' - * is omitted altogether, no prices will be set up for the product. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateAProduct( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $options); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Json($options)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about deals that have a product attached to. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the product - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param string $options['status'] (optional) Only fetch deals with specific status. If omitted, all not deleted - * deals are fetched. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsWhereAProductIsAttachedTo( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}/deals'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'status' => $this->val($options, 'status', Models\Status2Enum::ALL_NOT_DELETED), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\BasicDeal')); - } - - /** - * Lists files associated with a product. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the product - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @param int $options['includeDeletedFiles'] (optional) When enabled, the list of files will also include - * deleted files. Please note that trying to download these files - * will not work. - * @param string $options['sort'] (optional) Field names and sorting mode separated by a comma - * (field_name_1 ASC, field_name_2 DESC). Only first-level field - * keys are supported (no nested keys). Supported fields: id, - * user_id, deal_id, person_id, org_id, product_id, add_time, - * update_time, file_name, file_type, file_size, comment. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFilesAttachedToAProduct( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}/files'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - 'include_deleted_files' => $this->val($options, 'includeDeletedFiles'), - 'sort' => $this->val($options, 'sort'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists the followers of a Product - * - * @param integer $id ID of the product - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFollowersOfAProduct( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserIDs')); - } - - /** - * Adds a follower to a product. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the product - * @param integer $options['userId'] ID of the user - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addAFollowerToAProduct( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $options); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Json($options)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\NewFollowerResponse')); - } - - /** - * Deletes a follower from a product. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the product - * @param integer $options['followerId'] ID of the follower - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAFollowerFromAProduct( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}/followers/{follower_id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - 'follower_id' => $this->val($options, 'followerId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteProductFollowerResponse')); - } - - /** - * Lists users permitted to access a product. - * - * @param integer $id ID of the product - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listPermittedUsers( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/products/{id}/permittedUsers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserIDs')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/RecentsController.php b/src/Controllers/RecentsController.php deleted file mode 100644 index ac06a12d..00000000 --- a/src/Controllers/RecentsController.php +++ /dev/null @@ -1,123 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/recents'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'since_timestamp' => $this->val($options, 'sinceTimestamp'), - 'items' => $this->val($options, 'items'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/RolesController.php b/src/Controllers/RolesController.php deleted file mode 100644 index 02566cd2..00000000 --- a/src/Controllers/RolesController.php +++ /dev/null @@ -1,730 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetRoles')); - } - - /** - * Add a role - * - * @param object $body (optional) TODO: type description here - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addARole( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PostRoles')); - } - - /** - * Delete a role - * - * @param integer $id ID of the role - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteARole( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteRole')); - } - - /** - * Get one role - * - * @param integer $id ID of the role - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneRole( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetRole')); - } - - /** - * Update role details - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the role - * @param integer $options['parentRoleId'] (optional) The ID of the parent Role - * @param string $options['name'] (optional) The name of the Role - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateRoleDetails( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'parent_role_id' => $this->val($options, 'parentRoleId'), - 'name' => $this->val($options, 'name') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PutRole')); - } - - /** - * Delete assignment from a role - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the role - * @param integer $options['userId'] ID of the user - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteARoleAssignment( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}/assignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'user_id' => $this->val($options, 'userId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\DeleteRoleAssignment')); - } - - /** - * List assignments for a role - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the role - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listRoleAssignments( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}/assignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetRoleAssignments')); - } - - /** - * Add assignment for a role - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the role - * @param integer $options['userId'] ID of the user - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addRoleAssignment( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}/assignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'user_id' => $this->val($options, 'userId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PostRoleAssignment')); - } - - /** - * List role sub-roles - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the role - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listRoleSubRoles( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}/roles'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetRoleSubroles')); - } - - /** - * List role settings - * - * @param integer $id ID of the role - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listRoleSettings( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}/settings'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\GetRoleSettings')); - } - - /** - * Add or update role setting - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the role - * @param string $options['settingKey'] TODO: type description here - * @param int $options['value'] Possible values for default_visibility settings: 0...1. - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addOrUpdateRoleSetting( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/roles/{id}/settings'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'setting_key' => APIHelper::prepareFormFields($this->val($options, 'settingKey')), - 'value' => APIHelper::prepareFormFields($this->val($options, 'value')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\PostRoleSettings')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/StagesController.php b/src/Controllers/StagesController.php deleted file mode 100644 index 022457cc..00000000 --- a/src/Controllers/StagesController.php +++ /dev/null @@ -1,458 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'ids' => $ids, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about all stages - * - * @param integer $pipelineId (optional) ID of the pipeline to fetch stages for. If omitted, stages for all - * pipelines will be fetched. - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllStages( - $pipelineId = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'pipeline_id' => $pipelineId, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Adds a new stage, returns the ID upon success. - * - * @param object $body (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewStage( - $body = null - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($body); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Marks a stage as deleted. - * - * @param integer $id ID of the stage - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteAStage( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Returns data about a specific stage - * - * @param integer $id ID of the stage - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneStage( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Updates the properties of a stage. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the stage - * @param object $options['body'] (optional) TODO: type description here - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateStageDetails( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($this->val($options, 'body')); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists deals in a specific stage - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the stage - * @param integer $options['filterId'] (optional) If supplied, only deals matching the given filter will be - * returned. - * @param integer $options['userId'] (optional) If supplied, filter_id will not be considered and only deals - * owned by the given user will be returned. If omitted, deals owned by the - * authorized user will be returned. - * @param int $options['everyone'] (optional) If supplied, filter_id and user_id will not be considered – - * instead, deals owned by everyone will be returned. - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function getDealsInAStage( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/stages/{id}/deals'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'filter_id' => $this->val($options, 'filterId'), - 'user_id' => $this->val($options, 'userId'), - 'everyone' => $this->val($options, 'everyone'), - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/TeamsController.php b/src/Controllers/TeamsController.php deleted file mode 100644 index 5fcfaae9..00000000 --- a/src/Controllers/TeamsController.php +++ /dev/null @@ -1,613 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'order_by' => $this->val($options, 'orderBy', Models\OrderByEnum::ID), - 'skip_users' => $this->val($options, 'skipUsers'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Teams')); - } - - /** - * Adds a new team to the company and returns the created object - * - * @param array $options Array with all options for search - * @param string $options['name'] The Team name - * @param integer $options['managerId'] The Team manager ID - * @param string $options['description'] (optional) The Team description - * @param array $options['users'] (optional) IDs of the Users that belong to the Team - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewTeam( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'manager_id' => $this->val($options, 'managerId'), - 'description' => $this->val($options, 'description'), - 'users' => array_values($this->val($options, 'users')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Teams')); - } - - /** - * Returns data about a specific team - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the team - * @param int $options['skipUsers'] (optional) When enabled, the teams will not include IDs of member users - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getASingleTeam( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'skip_users' => $this->val($options, 'skipUsers'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'Team with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Teams')); - } - - /** - * Updates an existing team and returns the updated object - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the team - * @param object $options['body'] (optional) TODO: type description here - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateATeam( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'content-type' => 'application/json; charset=utf-8', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //json encode body - $_bodyJson = Request\Body::Json($this->val($options, 'body')); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, $_bodyJson); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'Team with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Teams')); - } - - /** - * Returns list of all user IDs within a team - * - * @param integer $id ID of the team - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllUsersInATeam( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams/{id}/users'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'Team with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserIDs')); - } - - /** - * Adds users to an existing team - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the team - * @param array $options['users'] List of User IDs - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addUsersToATeam( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams/{id}/users'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'users' => array_values($this->val($options, 'users')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'Team with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserIDs')); - } - - /** - * Deletes users from an existing team - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the team - * @param array $options['users'] List of User IDs - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteUsersFromATeam( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams/{id}/users'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'users' => array_values($this->val($options, 'users')) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'Team with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserIDs')); - } - - /** - * Returns data about all teams which have specified user as a member - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the user - * @param string $options['orderBy'] (optional) Field name to sort returned teams by - * @param int $options['skipUsers'] (optional) When enabled, the teams will not include IDs of member users - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getAllTeamsOfAUser( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/teams/user/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'order_by' => $this->val($options, 'orderBy', Models\OrderByEnum::ID), - 'skip_users' => $this->val($options, 'skipUsers'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Teams')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/UserConnectionsController.php b/src/Controllers/UserConnectionsController.php deleted file mode 100644 index ae00b577..00000000 --- a/src/Controllers/UserConnectionsController.php +++ /dev/null @@ -1,100 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/userConnections'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 401) { - throw new Exceptions\UnauthorizedException('Unauthorized response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserConnections')); - } -} diff --git a/src/Controllers/UserSettingsController.php b/src/Controllers/UserSettingsController.php deleted file mode 100644 index f5a197a1..00000000 --- a/src/Controllers/UserSettingsController.php +++ /dev/null @@ -1,92 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/userSettings'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } -} diff --git a/src/Controllers/UsersController.php b/src/Controllers/UsersController.php deleted file mode 100644 index 34e0e235..00000000 --- a/src/Controllers/UsersController.php +++ /dev/null @@ -1,898 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Users')); - } - - /** - * Adds a new user to the company, returns the ID upon success. - * - * @param array $options Array with all options for search - * @param string $options['name'] Name of the user - * @param string $options['email'] Email of the user - * @param bool $options['activeFlag'] Whether the user is active or not. false = Not activated, true = - * Activated - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function addANewUser( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'name' => $this->val($options, 'name'), - 'email' => $this->val($options, 'email'), - 'active_flag' => $this->val($options, 'activeFlag') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\User')); - } - - /** - * Finds users by their name. - * - * @param array $options Array with all options for search - * @param string $options['term'] Search term to look for - * @param int $options['searchByEmail'] (optional) When enabled, term will only be matched against email - * addresses of users. Default: false - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function findUsersByName( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/find'; - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'term' => $this->val($options, 'term'), - 'search_by_email' => $this->val($options, 'searchByEmail'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Users')); - } - - /** - * Returns data about an authorized user within the company with bound company data: company ID, - * company name, and domain. Note that the 'locale' property means 'Date and number format' in the - * Pipedrive settings, not the chosen language. - * - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getCurrentUserData() - { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/me'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 401) { - throw new Exceptions\UnauthorizedException('Unauthorized response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserMe')); - } - - /** - * Returns data about a specific user within the company - * - * @param integer $id ID of the user - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function getOneUser( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'User with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\User')); - } - - /** - * Updates the properties of a user. Currently, only active_flag can be updated. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the user - * @param bool $options['activeFlag'] Whether the user is active or not. false = Not activated, true = - * Activated - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function updateUserDetails( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'active_flag' => $this->val($options, 'activeFlag') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::put($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - if ($response->code == 404) { - throw new Exceptions\FailResponseException( - 'User with specified ID does not exist or is inaccessible', - $_httpContext - ); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\User')); - } - - /** - * Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get - * synced in to Pipedrive when using the built-in Mailbox. - * - * @param integer $id ID of the user - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listBlacklistedEmailAddressesOfAUser( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/blacklistedEmails'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Add blacklisted email address for a specific user. - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the user - * @param string $options['address'] Email address to blacklist (can contain \\* for wildcards, e.g. \\*@example. - * com, or john\\*@ex\\*.com) - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addBlacklistedEmailAddressForAUser( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/blacklistedEmails'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'address' => $this->val($options, 'address') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Lists followers of a specific user. - * - * @param integer $id ID of the user - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function listFollowersOfAUser( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/followers'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 403) { - throw new Exceptions\FailResponseException('Forbidden response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\UserIDs')); - } - - /** - * List aggregated permissions over all assigned permission sets for a user - * - * @param integer $id ID of the user - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listUserPermissions( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/permissions'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Delete a role assignment for a user - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the user - * @param integer $options['roleId'] ID of the role - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteARoleAssignment( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/roleAssignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'role_id' => $this->val($options, 'roleId'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * List role assignments for a user - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the user - * @param integer $options['start'] (optional) Pagination start - * @param integer $options['limit'] (optional) Items shown per page - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listRoleAssignments( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/roleAssignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'start' => $this->val($options, 'start', 0), - 'limit' => $this->val($options, 'limit'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * Add role assignment for a user - * - * @param array $options Array with all options for search - * @param integer $options['id'] ID of the user - * @param integer $options['roleId'] ID of the role - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function addRoleAssignment( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/roleAssignments'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $this->val($options, 'id'), - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //prepare parameters - $_parameters = array ( - 'role_id' => $this->val($options, 'roleId') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::Form($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - /** - * List settings of user's assigned role - * - * @param integer $id ID of the user - * @return \Pipedrive\Utils\JsonSerializer response from the API call - * @throws APIException Thrown if API call fails - */ - public function listUserRoleSettings( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/users/{id}/roleSettings'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - return CamelCaseHelper::keysToCamelCase($response->body); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Controllers/WebhooksController.php b/src/Controllers/WebhooksController.php deleted file mode 100644 index 3e66047f..00000000 --- a/src/Controllers/WebhooksController.php +++ /dev/null @@ -1,279 +0,0 @@ -checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/webhooks'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken) - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::get($_queryUrl, $_headers); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 401) { - throw new Exceptions\UnauthorizedException('Unauthorized response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\WebhooksResponse')); - } - - /** - * Creates a new webhook and returns its details. Note that specifying an event which triggers the - * webhook combines 2 parameters - 'event_action' and 'event_object'. E.g., use '\*.\*' for getting - * notifications about all events, 'added.deal' for any newly added deals, 'deleted.persons' for any - * deleted persons, etc. See https://pipedrive.readme.io/docs/guide-for-webhooks for more details. - * - * @param array $options Array with all options for search - * @param string $options['subscriptionUrl'] A full, valid, publicly accessible URL. Determines where to send - * the notifications. Please note that you cannot use Pipedrive API - * endpoints as the subscription_url. - * @param string $options['eventAction'] Type of action to receive notifications about. Wildcard will match - * all supported actions. - * @param string $options['eventObject'] Type of object to receive notifications about. Wildcard will match - * all supported objects. - * @param integer $options['userId'] (optional) The ID of the user this webhook will be authorized with. - * If not set, current authorized user will be used. Note that this - * does not filter only certain user's events — rather, this - * specifies the user's permissions under which each event is checked. - * Events about objects the selected user is not entitled to access - * are not sent. If you want to receive notifications for all events, - * a top-level admin user should be used. - * @param string $options['httpAuthUser'] (optional) HTTP basic auth username of the subscription URL - * endpoint (if required). - * @param string $options['httpAuthPassword'] (optional) HTTP basic auth password of the subscription URL - * endpoint (if required). - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function createANewWebhook( - $options - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/webhooks'; - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken), - 'Content-Type' => 'application/json' - ); - - //prepare parameters - $_parameters = array ( - 'subscription_url' => $this->val($options, 'subscriptionUrl'), - 'event_action' => APIHelper::prepareFormFields($this->val($options, 'eventAction')), - 'event_object' => APIHelper::prepareFormFields($this->val($options, 'eventObject')), - 'user_id' => $this->val($options, 'userId'), - 'http_auth_user' => $this->val($options, 'httpAuthUser'), - 'http_auth_password' => $this->val($options, 'httpAuthPassword') - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl, $_parameters); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::post($_queryUrl, $_headers, Request\Body::json($_parameters)); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 400) { - throw new Exceptions\SchemaException('The bad response on webhook creation', $_httpContext); - } - - if ($response->code == 401) { - throw new Exceptions\UnauthorizedException('Unauthorized response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\WebhooksResponse1')); - } - - /** - * Deletes the specified webhook. - * - * @param integer $id The ID of the webhook to delete - * @return mixed response from the API call - * @throws APIException Thrown if API call fails - */ - public function deleteExistingWebhook( - $id - ) { - //check or get oauth token - OAuthManager::getInstance()->checkAuthorization(); - - //prepare query string for API call - $_queryBuilder = '/webhooks/{id}'; - - //process optional query parameters - $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'id' => $id, - )); - - //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = array ( - 'user-agent' => BaseController::USER_AGENT, - 'Accept' => 'application/json', - 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken), - 'Content-Type' => 'application/json' - ); - - //call on-before Http callback - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - //and invoke the API call request to fetch the response - $response = Request::delete($_queryUrl, $_headers, Request\Body::json(array())); - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //Error handling using HTTP status codes - if ($response->code == 401) { - throw new Exceptions\UnauthorizedException('Unauthorized response', $_httpContext); - } - - if ($response->code == 403) { - throw new Exceptions\Webhooks403ErrorException('The webhook deletion forbidden response', $_httpContext); - } - - if ($response->code == 404) { - throw new Exceptions\SchemaException('The webhook deletion not found response', $_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpContext); - - $mapper = $this->getJsonMapper(); - - return CamelCaseHelper::keysToCamelCase($mapper->mapClass($response->body, 'Pipedrive\\Models\\Schema1')); - } - - - /** - * Array access utility method - * @param array $arr Array of values to read from - * @param string $key Key to get the value from the array - * @param mixed|null $default Default value to use if the key was not found - * @return mixed - */ - private function val($arr, $key, $default = null) - { - if (isset($arr[$key])) { - return is_bool($arr[$key]) ? var_export($arr[$key], true) : $arr[$key]; - } - return $default; - } -} diff --git a/src/Environments.php b/src/Environments.php deleted file mode 100644 index 1d304f9e..00000000 --- a/src/Environments.php +++ /dev/null @@ -1,19 +0,0 @@ -onBeforeRequest = $onBeforeRequest; - $this->onAfterRequest = $onAfterRequest; - } - - /** - * Set on-before event callback - * @param callable $func On-before event callable - */ - public function setOnBeforeRequest(callable $func) - { - $this->onBeforeRequest = $func; - } - - /** - * Get On-before API call event callable - * @return callable Callable - */ - public function getOnBeforeRequest() - { - return $this->onBeforeRequest; - } - - /** - * Set On-after API call event callable - * @param callable $func On-after event callable - */ - public function setOnAfterRequest(callable $func) - { - $this->onAfterRequest = $func; - } - - /** - * Get On-After API call event callable - * @return callable On-after event callable - */ - public function getOnAfterRequest() - { - return $this->onAfterRequest; - } - - /** - * Call on-before event callable - * @param HttpRequest $httpRequest HttpRequest for this call - */ - public function callOnBeforeRequest(HttpRequest $httpRequest) - { - if ($this->onBeforeRequest != null) { - call_user_func($this->onBeforeRequest, $httpRequest); - } - } - - /** - * Call on-after event callable - * @param HttpRequest $httpRequest HttpRequest for this call - */ - public function callOnAfterRequest(HttpContext $httpContext) - { - if ($this->onAfterRequest != null) { - call_user_func($this->onAfterRequest, $httpContext); - } - } -} diff --git a/src/Http/HttpContext.php b/src/Http/HttpContext.php deleted file mode 100644 index 48f586ad..00000000 --- a/src/Http/HttpContext.php +++ /dev/null @@ -1,55 +0,0 @@ -request = $request; - $this->response = $response; - } - - /** - * Getter for the Http Request - * @return HttpRequest request - */ - public function getRequest() - { - return $this->request; - } - - /** - * Getter for the Http Response - * @return HttpResponse response - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/src/Http/HttpMethod.php b/src/Http/HttpMethod.php deleted file mode 100644 index f720c643..00000000 --- a/src/Http/HttpMethod.php +++ /dev/null @@ -1,21 +0,0 @@ -httpMethod = $httpMethod; - $this->headers = $headers; - $this->queryUrl = $queryUrl; - $this->parameters = $parameters; - } - - /** - * Get http method - * @return string - */ - public function getHttpMethod() - { - return $this->httpMethod; - } - - /** - * Set http method - * @param string $httpMethod Http Method as defined in HttpMethod class - */ - public function setHttpMethod($httpMethod) - { - $this->httpMethod = $httpMethod; - } - - /** - * Get headers - * @return array Map of headers - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Set headers - * @param array $headers Headers as map - */ - public function setHeaders(array $headers) - { - $this->headers = $headers; - } - - /** - * Get query url - * @return string Query url - */ - public function getQueryUrl() - { - return $this->queryUrl; - } - - /** - * Set query url - * @param string $queryUrl Query url - */ - public function setQueryUrl($queryUrl) - { - $this->queryUrl = $queryUrl; - } - - /** - * Get parameters - * @return array Map of input parameters - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * Set parameters - * @param array $parameters Map of input parameters - */ - public function setParameters($parameters) - { - $this->parameters = $parameters; - } -} diff --git a/src/Http/HttpResponse.php b/src/Http/HttpResponse.php deleted file mode 100644 index 759b085e..00000000 --- a/src/Http/HttpResponse.php +++ /dev/null @@ -1,72 +0,0 @@ -statusCode = $statusCode; - $this->headers = $headers; - $this->rawBody = $rawBody; - } - - /** - * Get status code - * @return int Status code - */ - public function getStatusCode() - { - return $this->statusCode; - } - - /** - * Get headers - * @return array Map of headers - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Get raw response body - * @return string Raw body - */ - public function getRawBody() - { - return $this->rawBody; - } -} diff --git a/src/Models/Activity.php b/src/Models/Activity.php deleted file mode 100644 index daae061a..00000000 --- a/src/Models/Activity.php +++ /dev/null @@ -1,158 +0,0 @@ -subject - * @param int $done Initialization value for $this->done - * @param string $type Initialization value for $this->type - * @param \DateTime $dueDate Initialization value for $this->dueDate - * @param string $dueTime Initialization value for $this->dueTime - * @param string $duration Initialization value for $this->duration - * @param integer $userId Initialization value for $this->userId - * @param integer $dealId Initialization value for $this->dealId - * @param integer $personId Initialization value for $this->personId - * @param string $participants Initialization value for $this->participants - * @param integer $orgId Initialization value for $this->orgId - * @param string $note Initialization value for $this->note - */ - public function __construct() - { - if (12 == func_num_args()) { - $this->subject = func_get_arg(0); - $this->done = func_get_arg(1); - $this->type = func_get_arg(2); - $this->dueDate = func_get_arg(3); - $this->dueTime = func_get_arg(4); - $this->duration = func_get_arg(5); - $this->userId = func_get_arg(6); - $this->dealId = func_get_arg(7); - $this->personId = func_get_arg(8); - $this->participants = func_get_arg(9); - $this->orgId = func_get_arg(10); - $this->note = func_get_arg(11); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['subject'] = $this->subject; - $json['done'] = $this->done; - $json['type'] = $this->type; - $json['due_date'] = isset($this->dueDate) ? - DateTimeHelper::toSimpleDate($this->dueDate) : null; - $json['due_time'] = $this->dueTime; - $json['duration'] = $this->duration; - $json['user_id'] = $this->userId; - $json['deal_id'] = $this->dealId; - $json['person_id'] = $this->personId; - $json['participants'] = $this->participants; - $json['org_id'] = $this->orgId; - $json['note'] = $this->note; - - return $json; - } -} diff --git a/src/Models/AddedDealFollower.php b/src/Models/AddedDealFollower.php deleted file mode 100644 index 40648699..00000000 --- a/src/Models/AddedDealFollower.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data4 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/AdditionalData.php b/src/Models/AdditionalData.php deleted file mode 100644 index 82dd0848..00000000 --- a/src/Models/AdditionalData.php +++ /dev/null @@ -1,64 +0,0 @@ -start - * @param integer $limit Initialization value for $this->limit - * @param bool $moreItemsInCollection Initialization value for $this->moreItemsInCollection - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->start = func_get_arg(0); - $this->limit = func_get_arg(1); - $this->moreItemsInCollection = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['start'] = $this->start; - $json['limit'] = $this->limit; - $json['more_items_in_collection'] = $this->moreItemsInCollection; - - return $json; - } -} diff --git a/src/Models/AdditionalData2.php b/src/Models/AdditionalData2.php deleted file mode 100644 index 18ad63f2..00000000 --- a/src/Models/AdditionalData2.php +++ /dev/null @@ -1,45 +0,0 @@ -settings - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->settings = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['settings'] = $this->settings; - - return $json; - } -} diff --git a/src/Models/AdditionalData3.php b/src/Models/AdditionalData3.php deleted file mode 100644 index f1e8e2c1..00000000 --- a/src/Models/AdditionalData3.php +++ /dev/null @@ -1,46 +0,0 @@ -dropboxEmail - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->dropboxEmail = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['dropbox_email'] = $this->dropboxEmail; - - return $json; - } -} diff --git a/src/Models/AdditionalData4.php b/src/Models/AdditionalData4.php deleted file mode 100644 index 33d15f35..00000000 --- a/src/Models/AdditionalData4.php +++ /dev/null @@ -1,45 +0,0 @@ -pagination - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->pagination = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['pagination'] = $this->pagination; - - return $json; - } -} diff --git a/src/Models/AdditionalData5.php b/src/Models/AdditionalData5.php deleted file mode 100644 index b8bd15d1..00000000 --- a/src/Models/AdditionalData5.php +++ /dev/null @@ -1,46 +0,0 @@ -matchesFilters - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->matchesFilters = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['matches_filters'] = $this->matchesFilters; - - return $json; - } -} diff --git a/src/Models/AdditionalDataWithPaginationDetails.php b/src/Models/AdditionalDataWithPaginationDetails.php deleted file mode 100644 index 3b1f0241..00000000 --- a/src/Models/AdditionalDataWithPaginationDetails.php +++ /dev/null @@ -1,45 +0,0 @@ -pagination - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->pagination = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['pagination'] = $this->pagination; - - return $json; - } -} diff --git a/src/Models/Age.php b/src/Models/Age.php deleted file mode 100644 index 1eeb5c04..00000000 --- a/src/Models/Age.php +++ /dev/null @@ -1,100 +0,0 @@ -y - * @param integer $m Initialization value for $this->m - * @param integer $d Initialization value for $this->d - * @param integer $h Initialization value for $this->h - * @param integer $i Initialization value for $this->i - * @param integer $s Initialization value for $this->s - * @param integer $totalSeconds Initialization value for $this->totalSeconds - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->y = func_get_arg(0); - $this->m = func_get_arg(1); - $this->d = func_get_arg(2); - $this->h = func_get_arg(3); - $this->i = func_get_arg(4); - $this->s = func_get_arg(5); - $this->totalSeconds = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['y'] = $this->y; - $json['m'] = $this->m; - $json['d'] = $this->d; - $json['h'] = $this->h; - $json['i'] = $this->i; - $json['s'] = $this->s; - $json['total_seconds'] = $this->totalSeconds; - - return $json; - } -} diff --git a/src/Models/AssigneeTypeEnum.php b/src/Models/AssigneeTypeEnum.php deleted file mode 100644 index e666bb6d..00000000 --- a/src/Models/AssigneeTypeEnum.php +++ /dev/null @@ -1,29 +0,0 @@ -y - * @param integer $m Initialization value for $this->m - * @param integer $d Initialization value for $this->d - * @param integer $h Initialization value for $this->h - * @param integer $i Initialization value for $this->i - * @param integer $s Initialization value for $this->s - * @param integer $totalSeconds Initialization value for $this->totalSeconds - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->y = func_get_arg(0); - $this->m = func_get_arg(1); - $this->d = func_get_arg(2); - $this->h = func_get_arg(3); - $this->i = func_get_arg(4); - $this->s = func_get_arg(5); - $this->totalSeconds = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['y'] = $this->y; - $json['m'] = $this->m; - $json['d'] = $this->d; - $json['h'] = $this->h; - $json['i'] = $this->i; - $json['s'] = $this->s; - $json['total_seconds'] = $this->totalSeconds; - - return $json; - } -} diff --git a/src/Models/BaseCurrency.php b/src/Models/BaseCurrency.php deleted file mode 100644 index ef8b28c7..00000000 --- a/src/Models/BaseCurrency.php +++ /dev/null @@ -1,102 +0,0 @@ -id - * @param string $code Initialization value for $this->code - * @param string $name Initialization value for $this->name - * @param integer $decimalPoints Initialization value for $this->decimalPoints - * @param string $symbol Initialization value for $this->symbol - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param bool $isCustomFlag Initialization value for $this->isCustomFlag - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->id = func_get_arg(0); - $this->code = func_get_arg(1); - $this->name = func_get_arg(2); - $this->decimalPoints = func_get_arg(3); - $this->symbol = func_get_arg(4); - $this->activeFlag = func_get_arg(5); - $this->isCustomFlag = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['code'] = $this->code; - $json['name'] = $this->name; - $json['decimal_points'] = $this->decimalPoints; - $json['symbol'] = $this->symbol; - $json['active_flag'] = $this->activeFlag; - $json['is_custom_flag'] = $this->isCustomFlag; - - return $json; - } -} diff --git a/src/Models/BaseDeal.php b/src/Models/BaseDeal.php deleted file mode 100644 index 2f361647..00000000 --- a/src/Models/BaseDeal.php +++ /dev/null @@ -1,559 +0,0 @@ -stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - */ - public function __construct() - { - if (53 == func_num_args()) { - $this->stageId = func_get_arg(0); - $this->title = func_get_arg(1); - $this->value = func_get_arg(2); - $this->currency = func_get_arg(3); - $this->addTime = func_get_arg(4); - $this->updateTime = func_get_arg(5); - $this->stageChangeTime = func_get_arg(6); - $this->active = func_get_arg(7); - $this->deleted = func_get_arg(8); - $this->status = func_get_arg(9); - $this->probability = func_get_arg(10); - $this->nextActivityDate = func_get_arg(11); - $this->nextActivityTime = func_get_arg(12); - $this->nextActivityId = func_get_arg(13); - $this->lastActivityId = func_get_arg(14); - $this->lastActivityDate = func_get_arg(15); - $this->lostReason = func_get_arg(16); - $this->visibleTo = func_get_arg(17); - $this->closeTime = func_get_arg(18); - $this->pipelineId = func_get_arg(19); - $this->wonTime = func_get_arg(20); - $this->firstWonTime = func_get_arg(21); - $this->lostTime = func_get_arg(22); - $this->productsCount = func_get_arg(23); - $this->filesCount = func_get_arg(24); - $this->notesCount = func_get_arg(25); - $this->followersCount = func_get_arg(26); - $this->emailMessagesCount = func_get_arg(27); - $this->activitiesCount = func_get_arg(28); - $this->doneActivitiesCount = func_get_arg(29); - $this->undoneActivitiesCount = func_get_arg(30); - $this->referenceActivitiesCount = func_get_arg(31); - $this->participantsCount = func_get_arg(32); - $this->expectedCloseDate = func_get_arg(33); - $this->lastIncomingMailTime = func_get_arg(34); - $this->lastOutgoingMailTime = func_get_arg(35); - $this->label = func_get_arg(36); - $this->stageOrderNr = func_get_arg(37); - $this->personName = func_get_arg(38); - $this->orgName = func_get_arg(39); - $this->nextActivitySubject = func_get_arg(40); - $this->nextActivityType = func_get_arg(41); - $this->nextActivityDuration = func_get_arg(42); - $this->nextActivityNote = func_get_arg(43); - $this->formattedValue = func_get_arg(44); - $this->weightedValue = func_get_arg(45); - $this->formattedWeightedValue = func_get_arg(46); - $this->weightedValueCurrency = func_get_arg(47); - $this->rottenTime = func_get_arg(48); - $this->ownerName = func_get_arg(49); - $this->ccEmail = func_get_arg(50); - $this->orgHidden = func_get_arg(51); - $this->personHidden = func_get_arg(52); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - - return $json; - } -} diff --git a/src/Models/BaseMailThread.php b/src/Models/BaseMailThread.php deleted file mode 100644 index 4749a239..00000000 --- a/src/Models/BaseMailThread.php +++ /dev/null @@ -1,413 +0,0 @@ -id - * @param string $accountId Initialization value for $this->accountId - * @param integer $userId Initialization value for $this->userId - * @param string $subject Initialization value for $this->subject - * @param string $snippet Initialization value for $this->snippet - * @param int $readFlag Initialization value for $this->readFlag - * @param string $mailTrackingStatus Initialization value for $this->mailTrackingStatus - * @param int $hasAttachmentsFlag Initialization value for $this->hasAttachmentsFlag - * @param int $hasInlineAttachmentsFlag Initialization value for $this->hasInlineAttachmentsFlag - * @param int $hasRealAttachmentsFlag Initialization value for $this->hasRealAttachmentsFlag - * @param int $deletedFlag Initialization value for $this->deletedFlag - * @param int $syncedFlag Initialization value for $this->syncedFlag - * @param int $smartBccFlag Initialization value for $this->smartBccFlag - * @param int $mailLinkTrackingEnabledFlag Initialization value for $this->mailLinkTrackingEnabledFlag - * @param bool $writeFlag Initialization value for $this->writeFlag - * @param Parties $parties Initialization value for $this->parties - * @param array $draftsParties Initialization value for $this->draftsParties - * @param array $folders Initialization value for $this->folders - * @param double $version Initialization value for $this->version - * @param string $snippetDraft Initialization value for $this->snippetDraft - * @param string $snippetSent Initialization value for $this->snippetSent - * @param integer $messageCount Initialization value for $this->messageCount - * @param int $hasDraftFlag Initialization value for $this->hasDraftFlag - * @param int $hasSentFlag Initialization value for $this->hasSentFlag - * @param int $archivedFlag Initialization value for $this->archivedFlag - * @param int $sharedFlag Initialization value for $this->sharedFlag - * @param int $externalDeletedFlag Initialization value for $this->externalDeletedFlag - * @param int $firstMessageToMeFlag Initialization value for $this->firstMessageToMeFlag - * @param \DateTime $lastMessageTimestamp Initialization value for $this->lastMessageTimestamp - * @param \DateTime $firstMessageTimestamp Initialization value for $this->firstMessageTimestamp - * @param \DateTime $lastMessageSentTimestamp Initialization value for $this->lastMessageSentTimestamp - * @param \DateTime $lastMessageReceivedTimestamp Initialization value for $this->lastMessageReceivedTimestamp - * @param \DateTime $addTime Initialization value for $this->addTime - * @param \DateTime $updateTime Initialization value for $this->updateTime - * @param integer $dealId Initialization value for $this->dealId - * @param string $dealStatus Initialization value for $this->dealStatus - * @param int $allMessagesSentFlag Initialization value for $this->allMessagesSentFlag - */ - public function __construct() - { - if (37 == func_num_args()) { - $this->id = func_get_arg(0); - $this->accountId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->subject = func_get_arg(3); - $this->snippet = func_get_arg(4); - $this->readFlag = func_get_arg(5); - $this->mailTrackingStatus = func_get_arg(6); - $this->hasAttachmentsFlag = func_get_arg(7); - $this->hasInlineAttachmentsFlag = func_get_arg(8); - $this->hasRealAttachmentsFlag = func_get_arg(9); - $this->deletedFlag = func_get_arg(10); - $this->syncedFlag = func_get_arg(11); - $this->smartBccFlag = func_get_arg(12); - $this->mailLinkTrackingEnabledFlag = func_get_arg(13); - $this->writeFlag = func_get_arg(14); - $this->parties = func_get_arg(15); - $this->draftsParties = func_get_arg(16); - $this->folders = func_get_arg(17); - $this->version = func_get_arg(18); - $this->snippetDraft = func_get_arg(19); - $this->snippetSent = func_get_arg(20); - $this->messageCount = func_get_arg(21); - $this->hasDraftFlag = func_get_arg(22); - $this->hasSentFlag = func_get_arg(23); - $this->archivedFlag = func_get_arg(24); - $this->sharedFlag = func_get_arg(25); - $this->externalDeletedFlag = func_get_arg(26); - $this->firstMessageToMeFlag = func_get_arg(27); - $this->lastMessageTimestamp = func_get_arg(28); - $this->firstMessageTimestamp = func_get_arg(29); - $this->lastMessageSentTimestamp = func_get_arg(30); - $this->lastMessageReceivedTimestamp = func_get_arg(31); - $this->addTime = func_get_arg(32); - $this->updateTime = func_get_arg(33); - $this->dealId = func_get_arg(34); - $this->dealStatus = func_get_arg(35); - $this->allMessagesSentFlag = func_get_arg(36); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['account_id'] = $this->accountId; - $json['user_id'] = $this->userId; - $json['subject'] = $this->subject; - $json['snippet'] = $this->snippet; - $json['read_flag'] = $this->readFlag; - $json['mail_tracking_status'] = $this->mailTrackingStatus; - $json['has_attachments_flag'] = $this->hasAttachmentsFlag; - $json['has_inline_attachments_flag'] = $this->hasInlineAttachmentsFlag; - $json['has_real_attachments_flag'] = $this->hasRealAttachmentsFlag; - $json['deleted_flag'] = $this->deletedFlag; - $json['synced_flag'] = $this->syncedFlag; - $json['smart_bcc_flag'] = $this->smartBccFlag; - $json['mail_link_tracking_enabled_flag'] = $this->mailLinkTrackingEnabledFlag; - $json['write_flag'] = $this->writeFlag; - $json['parties'] = $this->parties; - $json['drafts_parties'] = $this->draftsParties; - $json['folders'] = $this->folders; - $json['version'] = $this->version; - $json['snippet_draft'] = $this->snippetDraft; - $json['snippet_sent'] = $this->snippetSent; - $json['message_count'] = $this->messageCount; - $json['has_draft_flag'] = $this->hasDraftFlag; - $json['has_sent_flag'] = $this->hasSentFlag; - $json['archived_flag'] = $this->archivedFlag; - $json['shared_flag'] = $this->sharedFlag; - $json['external_deleted_flag'] = $this->externalDeletedFlag; - $json['first_message_to_me_flag'] = $this->firstMessageToMeFlag; - $json['last_message_timestamp'] = isset($this->lastMessageTimestamp) ? - DateTimeHelper::toRfc3339DateTime($this->lastMessageTimestamp) : null; - $json['first_message_timestamp'] = isset($this->firstMessageTimestamp) ? - DateTimeHelper::toRfc3339DateTime($this->firstMessageTimestamp) : null; - $json['last_message_sent_timestamp'] = isset($this->lastMessageSentTimestamp) ? - DateTimeHelper::toRfc3339DateTime($this->lastMessageSentTimestamp) : null; - $json['last_message_received_timestamp'] = isset($this->lastMessageReceivedTimestamp) ? - DateTimeHelper::toRfc3339DateTime($this->lastMessageReceivedTimestamp) : null; - $json['add_time'] = isset($this->addTime) ? - DateTimeHelper::toRfc3339DateTime($this->addTime) : null; - $json['update_time'] = isset($this->updateTime) ? - DateTimeHelper::toRfc3339DateTime($this->updateTime) : null; - $json['deal_id'] = $this->dealId; - $json['deal_status'] = $this->dealStatus; - $json['all_messages_sent_flag'] = $this->allMessagesSentFlag; - - return $json; - } -} diff --git a/src/Models/BaseMailThreadMessages.php b/src/Models/BaseMailThreadMessages.php deleted file mode 100644 index c815d5ea..00000000 --- a/src/Models/BaseMailThreadMessages.php +++ /dev/null @@ -1,316 +0,0 @@ -id - * @param string $accountId Initialization value for $this->accountId - * @param integer $userId Initialization value for $this->userId - * @param string $subject Initialization value for $this->subject - * @param string $snippet Initialization value for $this->snippet - * @param int $readFlag Initialization value for $this->readFlag - * @param string $mailTrackingStatus Initialization value for $this->mailTrackingStatus - * @param int $hasAttachmentsFlag Initialization value for $this->hasAttachmentsFlag - * @param int $hasInlineAttachmentsFlag Initialization value for $this->hasInlineAttachmentsFlag - * @param int $hasRealAttachmentsFlag Initialization value for $this->hasRealAttachmentsFlag - * @param int $deletedFlag Initialization value for $this->deletedFlag - * @param int $syncedFlag Initialization value for $this->syncedFlag - * @param int $smartBccFlag Initialization value for $this->smartBccFlag - * @param int $mailLinkTrackingEnabledFlag Initialization value for $this->mailLinkTrackingEnabledFlag - * @param bool $writeFlag Initialization value for $this->writeFlag - * @param array $from Initialization value for $this->from - * @param array $to Initialization value for $this->to - * @param array $cc Initialization value for $this->cc - * @param array $bcc Initialization value for $this->bcc - * @param string $bodyUrl Initialization value for $this->bodyUrl - * @param integer $mailThreadId Initialization value for $this->mailThreadId - * @param string $draft Initialization value for $this->draft - * @param int $hasBodyFlag Initialization value for $this->hasBodyFlag - * @param int $sentFlag Initialization value for $this->sentFlag - * @param int $sentFromPipedriveFlag Initialization value for $this->sentFromPipedriveFlag - * @param \DateTime $messageTime Initialization value for $this->messageTime - * @param \DateTime $addTime Initialization value for $this->addTime - * @param \DateTime $updateTime Initialization value for $this->updateTime - */ - public function __construct() - { - if (28 == func_num_args()) { - $this->id = func_get_arg(0); - $this->accountId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->subject = func_get_arg(3); - $this->snippet = func_get_arg(4); - $this->readFlag = func_get_arg(5); - $this->mailTrackingStatus = func_get_arg(6); - $this->hasAttachmentsFlag = func_get_arg(7); - $this->hasInlineAttachmentsFlag = func_get_arg(8); - $this->hasRealAttachmentsFlag = func_get_arg(9); - $this->deletedFlag = func_get_arg(10); - $this->syncedFlag = func_get_arg(11); - $this->smartBccFlag = func_get_arg(12); - $this->mailLinkTrackingEnabledFlag = func_get_arg(13); - $this->writeFlag = func_get_arg(14); - $this->from = func_get_arg(15); - $this->to = func_get_arg(16); - $this->cc = func_get_arg(17); - $this->bcc = func_get_arg(18); - $this->bodyUrl = func_get_arg(19); - $this->mailThreadId = func_get_arg(20); - $this->draft = func_get_arg(21); - $this->hasBodyFlag = func_get_arg(22); - $this->sentFlag = func_get_arg(23); - $this->sentFromPipedriveFlag = func_get_arg(24); - $this->messageTime = func_get_arg(25); - $this->addTime = func_get_arg(26); - $this->updateTime = func_get_arg(27); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['account_id'] = $this->accountId; - $json['user_id'] = $this->userId; - $json['subject'] = $this->subject; - $json['snippet'] = $this->snippet; - $json['read_flag'] = $this->readFlag; - $json['mail_tracking_status'] = $this->mailTrackingStatus; - $json['has_attachments_flag'] = $this->hasAttachmentsFlag; - $json['has_inline_attachments_flag'] = $this->hasInlineAttachmentsFlag; - $json['has_real_attachments_flag'] = $this->hasRealAttachmentsFlag; - $json['deleted_flag'] = $this->deletedFlag; - $json['synced_flag'] = $this->syncedFlag; - $json['smart_bcc_flag'] = $this->smartBccFlag; - $json['mail_link_tracking_enabled_flag'] = $this->mailLinkTrackingEnabledFlag; - $json['write_flag'] = $this->writeFlag; - $json['from'] = $this->from; - $json['to'] = $this->to; - $json['cc'] = $this->cc; - $json['bcc'] = $this->bcc; - $json['body_url'] = $this->bodyUrl; - $json['mail_thread_id'] = $this->mailThreadId; - $json['draft'] = $this->draft; - $json['has_body_flag'] = $this->hasBodyFlag; - $json['sent_flag'] = $this->sentFlag; - $json['sent_from_pipedrive_flag'] = $this->sentFromPipedriveFlag; - $json['message_time'] = isset($this->messageTime) ? - DateTimeHelper::toRfc3339DateTime($this->messageTime) : null; - $json['add_time'] = isset($this->addTime) ? - DateTimeHelper::toRfc3339DateTime($this->addTime) : null; - $json['update_time'] = isset($this->updateTime) ? - DateTimeHelper::toRfc3339DateTime($this->updateTime) : null; - - return $json; - } -} diff --git a/src/Models/BaseNote.php b/src/Models/BaseNote.php deleted file mode 100644 index 02b9e7ea..00000000 --- a/src/Models/BaseNote.php +++ /dev/null @@ -1,220 +0,0 @@ -id - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $addTime Initialization value for $this->addTime - * @param string $content Initialization value for $this->content - * @param BaseNoteDealTitle $deal Initialization value for $this->deal - * @param string $leadId Initialization value for $this->leadId - * @param integer $dealId Initialization value for $this->dealId - * @param integer $lastUpdateUserId Initialization value for $this->lastUpdateUserId - * @param integer $orgId Initialization value for $this->orgId - * @param Organization $organization Initialization value for $this->organization - * @param Person $person Initialization value for $this->person - * @param integer $personId Initialization value for $this->personId - * @param bool $pinnedToLeadFlag Initialization value for $this->pinnedToLeadFlag - * @param bool $pinnedToDealFlag Initialization value for $this->pinnedToDealFlag - * @param bool $pinnedToOrganizationFlag Initialization value for $this->pinnedToOrganizationFlag - * @param bool $pinnedToPersonFlag Initialization value for $this->pinnedToPersonFlag - * @param string $updateTime Initialization value for $this->updateTime - * @param NoteCreatorUser $user Initialization value for $this->user - * @param integer $userId Initialization value for $this->userId - */ - public function __construct() - { - if (19 == func_num_args()) { - $this->id = func_get_arg(0); - $this->activeFlag = func_get_arg(1); - $this->addTime = func_get_arg(2); - $this->content = func_get_arg(3); - $this->deal = func_get_arg(4); - $this->leadId = func_get_arg(5); - $this->dealId = func_get_arg(6); - $this->lastUpdateUserId = func_get_arg(7); - $this->orgId = func_get_arg(8); - $this->organization = func_get_arg(9); - $this->person = func_get_arg(10); - $this->personId = func_get_arg(11); - $this->pinnedToLeadFlag = func_get_arg(12); - $this->pinnedToDealFlag = func_get_arg(13); - $this->pinnedToOrganizationFlag = func_get_arg(14); - $this->pinnedToPersonFlag = func_get_arg(15); - $this->updateTime = func_get_arg(16); - $this->user = func_get_arg(17); - $this->userId = func_get_arg(18); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['active_flag'] = $this->activeFlag; - $json['add_time'] = $this->addTime; - $json['content'] = $this->content; - $json['deal'] = $this->deal; - $json['lead_id'] = $this->leadId; - $json['deal_id'] = $this->dealId; - $json['last_update_user_id'] = $this->lastUpdateUserId; - $json['org_id'] = $this->orgId; - $json['organization'] = $this->organization; - $json['person'] = $this->person; - $json['person_id'] = $this->personId; - $json['pinned_to_lead_flag'] = $this->pinnedToLeadFlag; - $json['pinned_to_deal_flag'] = $this->pinnedToDealFlag; - $json['pinned_to_organization_flag'] = $this->pinnedToOrganizationFlag; - $json['pinned_to_person_flag'] = $this->pinnedToPersonFlag; - $json['update_time'] = $this->updateTime; - $json['user'] = $this->user; - $json['user_id'] = $this->userId; - - return $json; - } -} diff --git a/src/Models/BaseNoteDealTitle.php b/src/Models/BaseNoteDealTitle.php deleted file mode 100644 index 278c564a..00000000 --- a/src/Models/BaseNoteDealTitle.php +++ /dev/null @@ -1,45 +0,0 @@ -title - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->title = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['title'] = $this->title; - - return $json; - } -} diff --git a/src/Models/BaseResponse.php b/src/Models/BaseResponse.php deleted file mode 100644 index 68161ed3..00000000 --- a/src/Models/BaseResponse.php +++ /dev/null @@ -1,45 +0,0 @@ -success - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->success = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - - return $json; - } -} diff --git a/src/Models/BaseRole.php b/src/Models/BaseRole.php deleted file mode 100644 index 3ba38ba3..00000000 --- a/src/Models/BaseRole.php +++ /dev/null @@ -1,55 +0,0 @@ -parentRoleId - * @param string $name Initialization value for $this->name - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->parentRoleId = func_get_arg(0); - $this->name = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['parent_role_id'] = $this->parentRoleId; - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/BaseTeam.php b/src/Models/BaseTeam.php deleted file mode 100644 index a09a5662..00000000 --- a/src/Models/BaseTeam.php +++ /dev/null @@ -1,124 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param string $description Initialization value for $this->description - * @param integer $managerId Initialization value for $this->managerId - * @param array $users Initialization value for $this->users - * @param int $activeFlag Initialization value for $this->activeFlag - * @param int $deletedFlag Initialization value for $this->deletedFlag - * @param string $addTime Initialization value for $this->addTime - * @param integer $createdByUserId Initialization value for $this->createdByUserId - */ - public function __construct() - { - if (9 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->description = func_get_arg(2); - $this->managerId = func_get_arg(3); - $this->users = func_get_arg(4); - $this->activeFlag = func_get_arg(5); - $this->deletedFlag = func_get_arg(6); - $this->addTime = func_get_arg(7); - $this->createdByUserId = func_get_arg(8); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['description'] = $this->description; - $json['manager_id'] = $this->managerId; - $json['users'] = $this->users; - $json['active_flag'] = $this->activeFlag; - $json['deleted_flag'] = $this->deletedFlag; - $json['add_time'] = $this->addTime; - $json['created_by_user_id'] = $this->createdByUserId; - - return $json; - } -} diff --git a/src/Models/BaseUser.php b/src/Models/BaseUser.php deleted file mode 100644 index 71f64574..00000000 --- a/src/Models/BaseUser.php +++ /dev/null @@ -1,228 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param string $defaultCurrency Initialization value for $this->defaultCurrency - * @param string $locale Initialization value for $this->locale - * @param integer $lang Initialization value for $this->lang - * @param string $email Initialization value for $this->email - * @param string $phone Initialization value for $this->phone - * @param bool $activated Initialization value for $this->activated - * @param string $lastLogin Initialization value for $this->lastLogin - * @param string $created Initialization value for $this->created - * @param string $modified Initialization value for $this->modified - * @param string $signupFlowVariation Initialization value for $this->signupFlowVariation - * @param bool $hasCreatedCompany Initialization value for $this->hasCreatedCompany - * @param int $isAdmin Initialization value for $this->isAdmin - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $timezoneName Initialization value for $this->timezoneName - * @param string $timezoneOffset Initialization value for $this->timezoneOffset - * @param integer $roleId Initialization value for $this->roleId - * @param string $iconUrl Initialization value for $this->iconUrl - * @param bool $isYou Initialization value for $this->isYou - */ - public function __construct() - { - if (20 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->defaultCurrency = func_get_arg(2); - $this->locale = func_get_arg(3); - $this->lang = func_get_arg(4); - $this->email = func_get_arg(5); - $this->phone = func_get_arg(6); - $this->activated = func_get_arg(7); - $this->lastLogin = func_get_arg(8); - $this->created = func_get_arg(9); - $this->modified = func_get_arg(10); - $this->signupFlowVariation = func_get_arg(11); - $this->hasCreatedCompany = func_get_arg(12); - $this->isAdmin = func_get_arg(13); - $this->activeFlag = func_get_arg(14); - $this->timezoneName = func_get_arg(15); - $this->timezoneOffset = func_get_arg(16); - $this->roleId = func_get_arg(17); - $this->iconUrl = func_get_arg(18); - $this->isYou = func_get_arg(19); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['default_currency'] = $this->defaultCurrency; - $json['locale'] = $this->locale; - $json['lang'] = $this->lang; - $json['email'] = $this->email; - $json['phone'] = $this->phone; - $json['activated'] = $this->activated; - $json['last_login'] = $this->lastLogin; - $json['created'] = $this->created; - $json['modified'] = $this->modified; - $json['signup_flow_variation'] = $this->signupFlowVariation; - $json['has_created_company'] = $this->hasCreatedCompany; - $json['is_admin'] = $this->isAdmin; - $json['active_flag'] = $this->activeFlag; - $json['timezone_name'] = $this->timezoneName; - $json['timezone_offset'] = $this->timezoneOffset; - $json['role_id'] = $this->roleId; - $json['icon_url'] = $this->iconUrl; - $json['is_you'] = $this->isYou; - - return $json; - } -} diff --git a/src/Models/BaseUserMe.php b/src/Models/BaseUserMe.php deleted file mode 100644 index ff72da82..00000000 --- a/src/Models/BaseUserMe.php +++ /dev/null @@ -1,267 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param string $defaultCurrency Initialization value for $this->defaultCurrency - * @param string $locale Initialization value for $this->locale - * @param integer $lang Initialization value for $this->lang - * @param string $email Initialization value for $this->email - * @param string $phone Initialization value for $this->phone - * @param bool $activated Initialization value for $this->activated - * @param string $lastLogin Initialization value for $this->lastLogin - * @param string $created Initialization value for $this->created - * @param string $modified Initialization value for $this->modified - * @param string $signupFlowVariation Initialization value for $this->signupFlowVariation - * @param bool $hasCreatedCompany Initialization value for $this->hasCreatedCompany - * @param int $isAdmin Initialization value for $this->isAdmin - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $timezoneName Initialization value for $this->timezoneName - * @param string $timezoneOffset Initialization value for $this->timezoneOffset - * @param integer $roleId Initialization value for $this->roleId - * @param string $iconUrl Initialization value for $this->iconUrl - * @param bool $isYou Initialization value for $this->isYou - * @param integer $companyId Initialization value for $this->companyId - * @param string $companyName Initialization value for $this->companyName - * @param string $companyDomain Initialization value for $this->companyDomain - * @param Language $language Initialization value for $this->language - */ - public function __construct() - { - if (24 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->defaultCurrency = func_get_arg(2); - $this->locale = func_get_arg(3); - $this->lang = func_get_arg(4); - $this->email = func_get_arg(5); - $this->phone = func_get_arg(6); - $this->activated = func_get_arg(7); - $this->lastLogin = func_get_arg(8); - $this->created = func_get_arg(9); - $this->modified = func_get_arg(10); - $this->signupFlowVariation = func_get_arg(11); - $this->hasCreatedCompany = func_get_arg(12); - $this->isAdmin = func_get_arg(13); - $this->activeFlag = func_get_arg(14); - $this->timezoneName = func_get_arg(15); - $this->timezoneOffset = func_get_arg(16); - $this->roleId = func_get_arg(17); - $this->iconUrl = func_get_arg(18); - $this->isYou = func_get_arg(19); - $this->companyId = func_get_arg(20); - $this->companyName = func_get_arg(21); - $this->companyDomain = func_get_arg(22); - $this->language = func_get_arg(23); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['default_currency'] = $this->defaultCurrency; - $json['locale'] = $this->locale; - $json['lang'] = $this->lang; - $json['email'] = $this->email; - $json['phone'] = $this->phone; - $json['activated'] = $this->activated; - $json['last_login'] = $this->lastLogin; - $json['created'] = $this->created; - $json['modified'] = $this->modified; - $json['signup_flow_variation'] = $this->signupFlowVariation; - $json['has_created_company'] = $this->hasCreatedCompany; - $json['is_admin'] = $this->isAdmin; - $json['active_flag'] = $this->activeFlag; - $json['timezone_name'] = $this->timezoneName; - $json['timezone_offset'] = $this->timezoneOffset; - $json['role_id'] = $this->roleId; - $json['icon_url'] = $this->iconUrl; - $json['is_you'] = $this->isYou; - $json['company_id'] = $this->companyId; - $json['company_name'] = $this->companyName; - $json['company_domain'] = $this->companyDomain; - $json['language'] = $this->language; - - return $json; - } -} diff --git a/src/Models/BasicDeal.php b/src/Models/BasicDeal.php deleted file mode 100644 index e765323b..00000000 --- a/src/Models/BasicDeal.php +++ /dev/null @@ -1,148 +0,0 @@ -
1
Owner & followers - * (private)
3
Entire company (shared)
- * @maps visible_to - * @var int|null $visibleTo public property - */ - public $visibleTo; - - /** - * Constructor to set initial or default values of member properties - * @param string $title Initialization value for $this->title - * @param string $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param integer $userId Initialization value for $this->userId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $lostReason Initialization value for $this->lostReason - * @param int $visibleTo Initialization value for $this->visibleTo - */ - public function __construct() - { - if (11 == func_num_args()) { - $this->title = func_get_arg(0); - $this->value = func_get_arg(1); - $this->currency = func_get_arg(2); - $this->userId = func_get_arg(3); - $this->personId = func_get_arg(4); - $this->orgId = func_get_arg(5); - $this->stageId = func_get_arg(6); - $this->status = func_get_arg(7); - $this->probability = func_get_arg(8); - $this->lostReason = func_get_arg(9); - $this->visibleTo = func_get_arg(10); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - - return $json; - } -} diff --git a/src/Models/BasicDealProduct.php b/src/Models/BasicDealProduct.php deleted file mode 100644 index 97812249..00000000 --- a/src/Models/BasicDealProduct.php +++ /dev/null @@ -1,114 +0,0 @@ -itemPrice - * @param integer $quantity Initialization value for $this->quantity - * @param double $discountPercentage Initialization value for $this->discountPercentage - * @param double $duration Initialization value for $this->duration - * @param integer $productVariationId Initialization value for $this->productVariationId - * @param string $comments Initialization value for $this->comments - * @param int $enabledFlag Initialization value for $this->enabledFlag - */ - public function __construct() - { - switch (func_num_args()) { - case 7: - $this->itemPrice = func_get_arg(0); - $this->quantity = func_get_arg(1); - $this->discountPercentage = func_get_arg(2); - $this->duration = func_get_arg(3); - $this->productVariationId = func_get_arg(4); - $this->comments = func_get_arg(5); - $this->enabledFlag = func_get_arg(6); - break; - - default: - $this->discountPercentage = 0; - $this->duration = 1; - break; - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['item_price'] = $this->itemPrice; - $json['quantity'] = $this->quantity; - $json['discount_percentage'] = $this->discountPercentage; - $json['duration'] = $this->duration; - $json['product_variation_id'] = $this->productVariationId; - $json['comments'] = $this->comments; - $json['enabled_flag'] = $this->enabledFlag; - - return $json; - } -} diff --git a/src/Models/BasicGoal.php b/src/Models/BasicGoal.php deleted file mode 100644 index 2299442e..00000000 --- a/src/Models/BasicGoal.php +++ /dev/null @@ -1,103 +0,0 @@ -title - * @param object $assignee Initialization value for $this->assignee - * @param object $type Initialization value for $this->type - * @param object $expectedOutcome Initialization value for $this->expectedOutcome - * @param object $duration Initialization value for $this->duration - * @param string $interval Initialization value for $this->interval - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->title = func_get_arg(0); - $this->assignee = func_get_arg(1); - $this->type = func_get_arg(2); - $this->expectedOutcome = func_get_arg(3); - $this->duration = func_get_arg(4); - $this->interval = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['title'] = $this->title; - $json['assignee'] = $this->assignee; - $json['type'] = $this->type; - $json['expected_outcome'] = $this->expectedOutcome; - $json['duration'] = $this->duration; - $json['interval'] = $this->interval; - - return $json; - } -} diff --git a/src/Models/BasicOrganization.php b/src/Models/BasicOrganization.php deleted file mode 100644 index 25a20f93..00000000 --- a/src/Models/BasicOrganization.php +++ /dev/null @@ -1,68 +0,0 @@ -
1
Owner & - * followers (private)
3
Entire company (shared)
- * @maps visible_to - * @var int|null $visibleTo public property - */ - public $visibleTo; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param integer $ownerId Initialization value for $this->ownerId - * @param int $visibleTo Initialization value for $this->visibleTo - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->name = func_get_arg(0); - $this->ownerId = func_get_arg(1); - $this->visibleTo = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['owner_id'] = $this->ownerId; - $json['visible_to'] = $this->visibleTo; - - return $json; - } -} diff --git a/src/Models/BasicPerson.php b/src/Models/BasicPerson.php deleted file mode 100644 index 65653faf..00000000 --- a/src/Models/BasicPerson.php +++ /dev/null @@ -1,98 +0,0 @@ -
1
Owner & followers - * (private)
3
Entire company (shared)
- * @maps visible_to - * @var int|null $visibleTo public property - */ - public $visibleTo; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param integer $ownerId Initialization value for $this->ownerId - * @param integer $orgId Initialization value for $this->orgId - * @param array $email Initialization value for $this->email - * @param array $phone Initialization value for $this->phone - * @param int $visibleTo Initialization value for $this->visibleTo - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->name = func_get_arg(0); - $this->ownerId = func_get_arg(1); - $this->orgId = func_get_arg(2); - $this->email = func_get_arg(3); - $this->phone = func_get_arg(4); - $this->visibleTo = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['owner_id'] = $this->ownerId; - $json['org_id'] = $this->orgId; - $json['email'] = $this->email; - $json['phone'] = $this->phone; - $json['visible_to'] = $this->visibleTo; - - return $json; - } -} diff --git a/src/Models/BasicPersonField.php b/src/Models/BasicPersonField.php deleted file mode 100644 index 800d529e..00000000 --- a/src/Models/BasicPersonField.php +++ /dev/null @@ -1,58 +0,0 @@ -name - * @param string $options Initialization value for $this->options - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->name = func_get_arg(0); - $this->options = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['options'] = $this->options; - - return $json; - } -} diff --git a/src/Models/BasicProductField.php b/src/Models/BasicProductField.php deleted file mode 100644 index 5e9b2157..00000000 --- a/src/Models/BasicProductField.php +++ /dev/null @@ -1,56 +0,0 @@ -name - * @param string $options Initialization value for $this->options - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->name = func_get_arg(0); - $this->options = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['options'] = $this->options; - - return $json; - } -} diff --git a/src/Models/CommonMailThread.php b/src/Models/CommonMailThread.php deleted file mode 100644 index fd278621..00000000 --- a/src/Models/CommonMailThread.php +++ /dev/null @@ -1,183 +0,0 @@ -id - * @param string $accountId Initialization value for $this->accountId - * @param integer $userId Initialization value for $this->userId - * @param string $subject Initialization value for $this->subject - * @param string $snippet Initialization value for $this->snippet - * @param int $readFlag Initialization value for $this->readFlag - * @param string $mailTrackingStatus Initialization value for $this->mailTrackingStatus - * @param int $hasAttachmentsFlag Initialization value for $this->hasAttachmentsFlag - * @param int $hasInlineAttachmentsFlag Initialization value for $this->hasInlineAttachmentsFlag - * @param int $hasRealAttachmentsFlag Initialization value for $this->hasRealAttachmentsFlag - * @param int $deletedFlag Initialization value for $this->deletedFlag - * @param int $syncedFlag Initialization value for $this->syncedFlag - * @param int $smartBccFlag Initialization value for $this->smartBccFlag - * @param int $mailLinkTrackingEnabledFlag Initialization value for $this->mailLinkTrackingEnabledFlag - * @param bool $writeFlag Initialization value for $this->writeFlag - */ - public function __construct() - { - if (15 == func_num_args()) { - $this->id = func_get_arg(0); - $this->accountId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->subject = func_get_arg(3); - $this->snippet = func_get_arg(4); - $this->readFlag = func_get_arg(5); - $this->mailTrackingStatus = func_get_arg(6); - $this->hasAttachmentsFlag = func_get_arg(7); - $this->hasInlineAttachmentsFlag = func_get_arg(8); - $this->hasRealAttachmentsFlag = func_get_arg(9); - $this->deletedFlag = func_get_arg(10); - $this->syncedFlag = func_get_arg(11); - $this->smartBccFlag = func_get_arg(12); - $this->mailLinkTrackingEnabledFlag = func_get_arg(13); - $this->writeFlag = func_get_arg(14); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['account_id'] = $this->accountId; - $json['user_id'] = $this->userId; - $json['subject'] = $this->subject; - $json['snippet'] = $this->snippet; - $json['read_flag'] = $this->readFlag; - $json['mail_tracking_status'] = $this->mailTrackingStatus; - $json['has_attachments_flag'] = $this->hasAttachmentsFlag; - $json['has_inline_attachments_flag'] = $this->hasInlineAttachmentsFlag; - $json['has_real_attachments_flag'] = $this->hasRealAttachmentsFlag; - $json['deleted_flag'] = $this->deletedFlag; - $json['synced_flag'] = $this->syncedFlag; - $json['smart_bcc_flag'] = $this->smartBccFlag; - $json['mail_link_tracking_enabled_flag'] = $this->mailLinkTrackingEnabledFlag; - $json['write_flag'] = $this->writeFlag; - - return $json; - } -} diff --git a/src/Models/CreateTeam.php b/src/Models/CreateTeam.php deleted file mode 100644 index 9d7497fe..00000000 --- a/src/Models/CreateTeam.php +++ /dev/null @@ -1,75 +0,0 @@ -name - * @param string $description Initialization value for $this->description - * @param integer $managerId Initialization value for $this->managerId - * @param array $users Initialization value for $this->users - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->name = func_get_arg(0); - $this->description = func_get_arg(1); - $this->managerId = func_get_arg(2); - $this->users = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['description'] = $this->description; - $json['manager_id'] = $this->managerId; - $json['users'] = $this->users; - - return $json; - } -} diff --git a/src/Models/CreatorUserId.php b/src/Models/CreatorUserId.php deleted file mode 100644 index 8f08c1c2..00000000 --- a/src/Models/CreatorUserId.php +++ /dev/null @@ -1,102 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param string $email Initialization value for $this->email - * @param bool $hasPic Initialization value for $this->hasPic - * @param string $picHash Initialization value for $this->picHash - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param integer $value Initialization value for $this->value - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->email = func_get_arg(2); - $this->hasPic = func_get_arg(3); - $this->picHash = func_get_arg(4); - $this->activeFlag = func_get_arg(5); - $this->value = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['email'] = $this->email; - $json['has_pic'] = $this->hasPic; - $json['pic_hash'] = $this->picHash; - $json['active_flag'] = $this->activeFlag; - $json['value'] = $this->value; - - return $json; - } -} diff --git a/src/Models/Currencies.php b/src/Models/Currencies.php deleted file mode 100644 index 4f279565..00000000 --- a/src/Models/Currencies.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/Data.php b/src/Models/Data.php deleted file mode 100644 index c3440f03..00000000 --- a/src/Models/Data.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data1.php b/src/Models/Data1.php deleted file mode 100644 index 9e9ce9aa..00000000 --- a/src/Models/Data1.php +++ /dev/null @@ -1,608 +0,0 @@ -id - * @param CreatorUserId $creatorUserId Initialization value for $this->creatorUserId - * @param UserId $userId Initialization value for $this->userId - * @param PersonId $personId Initialization value for $this->personId - * @param OrgId $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - */ - public function __construct() - { - if (58 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - $this->stageId = func_get_arg(5); - $this->title = func_get_arg(6); - $this->value = func_get_arg(7); - $this->currency = func_get_arg(8); - $this->addTime = func_get_arg(9); - $this->updateTime = func_get_arg(10); - $this->stageChangeTime = func_get_arg(11); - $this->active = func_get_arg(12); - $this->deleted = func_get_arg(13); - $this->status = func_get_arg(14); - $this->probability = func_get_arg(15); - $this->nextActivityDate = func_get_arg(16); - $this->nextActivityTime = func_get_arg(17); - $this->nextActivityId = func_get_arg(18); - $this->lastActivityId = func_get_arg(19); - $this->lastActivityDate = func_get_arg(20); - $this->lostReason = func_get_arg(21); - $this->visibleTo = func_get_arg(22); - $this->closeTime = func_get_arg(23); - $this->pipelineId = func_get_arg(24); - $this->wonTime = func_get_arg(25); - $this->firstWonTime = func_get_arg(26); - $this->lostTime = func_get_arg(27); - $this->productsCount = func_get_arg(28); - $this->filesCount = func_get_arg(29); - $this->notesCount = func_get_arg(30); - $this->followersCount = func_get_arg(31); - $this->emailMessagesCount = func_get_arg(32); - $this->activitiesCount = func_get_arg(33); - $this->doneActivitiesCount = func_get_arg(34); - $this->undoneActivitiesCount = func_get_arg(35); - $this->referenceActivitiesCount = func_get_arg(36); - $this->participantsCount = func_get_arg(37); - $this->expectedCloseDate = func_get_arg(38); - $this->lastIncomingMailTime = func_get_arg(39); - $this->lastOutgoingMailTime = func_get_arg(40); - $this->label = func_get_arg(41); - $this->stageOrderNr = func_get_arg(42); - $this->personName = func_get_arg(43); - $this->orgName = func_get_arg(44); - $this->nextActivitySubject = func_get_arg(45); - $this->nextActivityType = func_get_arg(46); - $this->nextActivityDuration = func_get_arg(47); - $this->nextActivityNote = func_get_arg(48); - $this->formattedValue = func_get_arg(49); - $this->weightedValue = func_get_arg(50); - $this->formattedWeightedValue = func_get_arg(51); - $this->weightedValueCurrency = func_get_arg(52); - $this->rottenTime = func_get_arg(53); - $this->ownerName = func_get_arg(54); - $this->ccEmail = func_get_arg(55); - $this->orgHidden = func_get_arg(56); - $this->personHidden = func_get_arg(57); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - - return $json; - } -} diff --git a/src/Models/Data10.php b/src/Models/Data10.php deleted file mode 100644 index f6deef6f..00000000 --- a/src/Models/Data10.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data11.php b/src/Models/Data11.php deleted file mode 100644 index e422c1f2..00000000 --- a/src/Models/Data11.php +++ /dev/null @@ -1,102 +0,0 @@ -id - * @param string $variationId Initialization value for $this->variationId - * @param string $name Initialization value for $this->name - * @param string $title Initialization value for $this->title - * @param string $variationName Initialization value for $this->variationName - * @param double $price Initialization value for $this->price - * @param string $priceFormatted Initialization value for $this->priceFormatted - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->id = func_get_arg(0); - $this->variationId = func_get_arg(1); - $this->name = func_get_arg(2); - $this->title = func_get_arg(3); - $this->variationName = func_get_arg(4); - $this->price = func_get_arg(5); - $this->priceFormatted = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['variation_id'] = $this->variationId; - $json['name'] = $this->name; - $json['title'] = $this->title; - $json['variation_name'] = $this->variationName; - $json['price'] = $this->price; - $json['price_formatted'] = $this->priceFormatted; - - return $json; - } -} diff --git a/src/Models/Data12.php b/src/Models/Data12.php deleted file mode 100644 index db6ce056..00000000 --- a/src/Models/Data12.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data13.php b/src/Models/Data13.php deleted file mode 100644 index b9258f6e..00000000 --- a/src/Models/Data13.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data14.php b/src/Models/Data14.php deleted file mode 100644 index 7236a2b7..00000000 --- a/src/Models/Data14.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data15.php b/src/Models/Data15.php deleted file mode 100644 index 7bdc7ece..00000000 --- a/src/Models/Data15.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data16.php b/src/Models/Data16.php deleted file mode 100644 index a6df5e7a..00000000 --- a/src/Models/Data16.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data17.php b/src/Models/Data17.php deleted file mode 100644 index 43c622f3..00000000 --- a/src/Models/Data17.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data18.php b/src/Models/Data18.php deleted file mode 100644 index d8a97bc0..00000000 --- a/src/Models/Data18.php +++ /dev/null @@ -1,56 +0,0 @@ -userId - * @param integer $roleId Initialization value for $this->roleId - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->userId = func_get_arg(0); - $this->roleId = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['user_id'] = $this->userId; - $json['role_id'] = $this->roleId; - - return $json; - } -} diff --git a/src/Models/Data19.php b/src/Models/Data19.php deleted file mode 100644 index d14cfd60..00000000 --- a/src/Models/Data19.php +++ /dev/null @@ -1,55 +0,0 @@ -id - * @param string $dealDefaultVisibility Initialization value for $this->dealDefaultVisibility - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->id = func_get_arg(0); - $this->dealDefaultVisibility = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['deal_default_visibility'] = $this->dealDefaultVisibility; - - return $json; - } -} diff --git a/src/Models/Data2.php b/src/Models/Data2.php deleted file mode 100644 index a820e5fb..00000000 --- a/src/Models/Data2.php +++ /dev/null @@ -1,608 +0,0 @@ -id - * @param integer $creatorUserId Initialization value for $this->creatorUserId - * @param integer $userId Initialization value for $this->userId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - */ - public function __construct() - { - if (58 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - $this->stageId = func_get_arg(5); - $this->title = func_get_arg(6); - $this->value = func_get_arg(7); - $this->currency = func_get_arg(8); - $this->addTime = func_get_arg(9); - $this->updateTime = func_get_arg(10); - $this->stageChangeTime = func_get_arg(11); - $this->active = func_get_arg(12); - $this->deleted = func_get_arg(13); - $this->status = func_get_arg(14); - $this->probability = func_get_arg(15); - $this->nextActivityDate = func_get_arg(16); - $this->nextActivityTime = func_get_arg(17); - $this->nextActivityId = func_get_arg(18); - $this->lastActivityId = func_get_arg(19); - $this->lastActivityDate = func_get_arg(20); - $this->lostReason = func_get_arg(21); - $this->visibleTo = func_get_arg(22); - $this->closeTime = func_get_arg(23); - $this->pipelineId = func_get_arg(24); - $this->wonTime = func_get_arg(25); - $this->firstWonTime = func_get_arg(26); - $this->lostTime = func_get_arg(27); - $this->productsCount = func_get_arg(28); - $this->filesCount = func_get_arg(29); - $this->notesCount = func_get_arg(30); - $this->followersCount = func_get_arg(31); - $this->emailMessagesCount = func_get_arg(32); - $this->activitiesCount = func_get_arg(33); - $this->doneActivitiesCount = func_get_arg(34); - $this->undoneActivitiesCount = func_get_arg(35); - $this->referenceActivitiesCount = func_get_arg(36); - $this->participantsCount = func_get_arg(37); - $this->expectedCloseDate = func_get_arg(38); - $this->lastIncomingMailTime = func_get_arg(39); - $this->lastOutgoingMailTime = func_get_arg(40); - $this->label = func_get_arg(41); - $this->stageOrderNr = func_get_arg(42); - $this->personName = func_get_arg(43); - $this->orgName = func_get_arg(44); - $this->nextActivitySubject = func_get_arg(45); - $this->nextActivityType = func_get_arg(46); - $this->nextActivityDuration = func_get_arg(47); - $this->nextActivityNote = func_get_arg(48); - $this->formattedValue = func_get_arg(49); - $this->weightedValue = func_get_arg(50); - $this->formattedWeightedValue = func_get_arg(51); - $this->weightedValueCurrency = func_get_arg(52); - $this->rottenTime = func_get_arg(53); - $this->ownerName = func_get_arg(54); - $this->ccEmail = func_get_arg(55); - $this->orgHidden = func_get_arg(56); - $this->personHidden = func_get_arg(57); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - - return $json; - } -} diff --git a/src/Models/Data20.php b/src/Models/Data20.php deleted file mode 100644 index 53675961..00000000 --- a/src/Models/Data20.php +++ /dev/null @@ -1,45 +0,0 @@ -google - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->google = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['google'] = $this->google; - - return $json; - } -} diff --git a/src/Models/Data21.php b/src/Models/Data21.php deleted file mode 100644 index f2d3a105..00000000 --- a/src/Models/Data21.php +++ /dev/null @@ -1,667 +0,0 @@ -id - * @param CreatorUserId $creatorUserId Initialization value for $this->creatorUserId - * @param UserId $userId Initialization value for $this->userId - * @param PersonId $personId Initialization value for $this->personId - * @param OrgId $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - * @param AverageTimeToWon $averageTimeToWon Initialization value for $this->averageTimeToWon - * @param double $averageStageProgress Initialization value for $this->averageStageProgress - * @param Age $age Initialization value for $this->age - * @param StayInPipelineStages $stayInPipelineStages Initialization value for $this->stayInPipelineStages - * @param object $lastActivity Initialization value for $this->lastActivity - * @param object $nextActivity Initialization value for $this->nextActivity - */ - public function __construct() - { - if (64 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - $this->stageId = func_get_arg(5); - $this->title = func_get_arg(6); - $this->value = func_get_arg(7); - $this->currency = func_get_arg(8); - $this->addTime = func_get_arg(9); - $this->updateTime = func_get_arg(10); - $this->stageChangeTime = func_get_arg(11); - $this->active = func_get_arg(12); - $this->deleted = func_get_arg(13); - $this->status = func_get_arg(14); - $this->probability = func_get_arg(15); - $this->nextActivityDate = func_get_arg(16); - $this->nextActivityTime = func_get_arg(17); - $this->nextActivityId = func_get_arg(18); - $this->lastActivityId = func_get_arg(19); - $this->lastActivityDate = func_get_arg(20); - $this->lostReason = func_get_arg(21); - $this->visibleTo = func_get_arg(22); - $this->closeTime = func_get_arg(23); - $this->pipelineId = func_get_arg(24); - $this->wonTime = func_get_arg(25); - $this->firstWonTime = func_get_arg(26); - $this->lostTime = func_get_arg(27); - $this->productsCount = func_get_arg(28); - $this->filesCount = func_get_arg(29); - $this->notesCount = func_get_arg(30); - $this->followersCount = func_get_arg(31); - $this->emailMessagesCount = func_get_arg(32); - $this->activitiesCount = func_get_arg(33); - $this->doneActivitiesCount = func_get_arg(34); - $this->undoneActivitiesCount = func_get_arg(35); - $this->referenceActivitiesCount = func_get_arg(36); - $this->participantsCount = func_get_arg(37); - $this->expectedCloseDate = func_get_arg(38); - $this->lastIncomingMailTime = func_get_arg(39); - $this->lastOutgoingMailTime = func_get_arg(40); - $this->label = func_get_arg(41); - $this->stageOrderNr = func_get_arg(42); - $this->personName = func_get_arg(43); - $this->orgName = func_get_arg(44); - $this->nextActivitySubject = func_get_arg(45); - $this->nextActivityType = func_get_arg(46); - $this->nextActivityDuration = func_get_arg(47); - $this->nextActivityNote = func_get_arg(48); - $this->formattedValue = func_get_arg(49); - $this->weightedValue = func_get_arg(50); - $this->formattedWeightedValue = func_get_arg(51); - $this->weightedValueCurrency = func_get_arg(52); - $this->rottenTime = func_get_arg(53); - $this->ownerName = func_get_arg(54); - $this->ccEmail = func_get_arg(55); - $this->orgHidden = func_get_arg(56); - $this->personHidden = func_get_arg(57); - $this->averageTimeToWon = func_get_arg(58); - $this->averageStageProgress = func_get_arg(59); - $this->age = func_get_arg(60); - $this->stayInPipelineStages = func_get_arg(61); - $this->lastActivity = func_get_arg(62); - $this->nextActivity = func_get_arg(63); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - $json['average_time_to_won'] = $this->averageTimeToWon; - $json['average_stage_progress'] = $this->averageStageProgress; - $json['age'] = $this->age; - $json['stay_in_pipeline_stages'] = $this->stayInPipelineStages; - $json['last_activity'] = $this->lastActivity; - $json['next_activity'] = $this->nextActivity; - - return $json; - } -} diff --git a/src/Models/Data22.php b/src/Models/Data22.php deleted file mode 100644 index 34457049..00000000 --- a/src/Models/Data22.php +++ /dev/null @@ -1,608 +0,0 @@ -id - * @param CreatorUserId $creatorUserId Initialization value for $this->creatorUserId - * @param UserId $userId Initialization value for $this->userId - * @param PersonId $personId Initialization value for $this->personId - * @param OrgId $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - */ - public function __construct() - { - if (58 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - $this->stageId = func_get_arg(5); - $this->title = func_get_arg(6); - $this->value = func_get_arg(7); - $this->currency = func_get_arg(8); - $this->addTime = func_get_arg(9); - $this->updateTime = func_get_arg(10); - $this->stageChangeTime = func_get_arg(11); - $this->active = func_get_arg(12); - $this->deleted = func_get_arg(13); - $this->status = func_get_arg(14); - $this->probability = func_get_arg(15); - $this->nextActivityDate = func_get_arg(16); - $this->nextActivityTime = func_get_arg(17); - $this->nextActivityId = func_get_arg(18); - $this->lastActivityId = func_get_arg(19); - $this->lastActivityDate = func_get_arg(20); - $this->lostReason = func_get_arg(21); - $this->visibleTo = func_get_arg(22); - $this->closeTime = func_get_arg(23); - $this->pipelineId = func_get_arg(24); - $this->wonTime = func_get_arg(25); - $this->firstWonTime = func_get_arg(26); - $this->lostTime = func_get_arg(27); - $this->productsCount = func_get_arg(28); - $this->filesCount = func_get_arg(29); - $this->notesCount = func_get_arg(30); - $this->followersCount = func_get_arg(31); - $this->emailMessagesCount = func_get_arg(32); - $this->activitiesCount = func_get_arg(33); - $this->doneActivitiesCount = func_get_arg(34); - $this->undoneActivitiesCount = func_get_arg(35); - $this->referenceActivitiesCount = func_get_arg(36); - $this->participantsCount = func_get_arg(37); - $this->expectedCloseDate = func_get_arg(38); - $this->lastIncomingMailTime = func_get_arg(39); - $this->lastOutgoingMailTime = func_get_arg(40); - $this->label = func_get_arg(41); - $this->stageOrderNr = func_get_arg(42); - $this->personName = func_get_arg(43); - $this->orgName = func_get_arg(44); - $this->nextActivitySubject = func_get_arg(45); - $this->nextActivityType = func_get_arg(46); - $this->nextActivityDuration = func_get_arg(47); - $this->nextActivityNote = func_get_arg(48); - $this->formattedValue = func_get_arg(49); - $this->weightedValue = func_get_arg(50); - $this->formattedWeightedValue = func_get_arg(51); - $this->weightedValueCurrency = func_get_arg(52); - $this->rottenTime = func_get_arg(53); - $this->ownerName = func_get_arg(54); - $this->ccEmail = func_get_arg(55); - $this->orgHidden = func_get_arg(56); - $this->personHidden = func_get_arg(57); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - - return $json; - } -} diff --git a/src/Models/Data23.php b/src/Models/Data23.php deleted file mode 100644 index 2b4b35d4..00000000 --- a/src/Models/Data23.php +++ /dev/null @@ -1,161 +0,0 @@ -id - * @param string $title Initialization value for $this->title - * @param integer $userId Initialization value for $this->userId - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $status Initialization value for $this->status - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $personName Initialization value for $this->personName - * @param integer $personId Initialization value for $this->personId - * @param string $organizationName Initialization value for $this->organizationName - * @param integer $organizationId Initialization value for $this->organizationId - * @param string $formattedValue Initialization value for $this->formattedValue - * @param string $ccEmail Initialization value for $this->ccEmail - */ - public function __construct() - { - if (13 == func_num_args()) { - $this->id = func_get_arg(0); - $this->title = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->visibleTo = func_get_arg(3); - $this->status = func_get_arg(4); - $this->value = func_get_arg(5); - $this->currency = func_get_arg(6); - $this->personName = func_get_arg(7); - $this->personId = func_get_arg(8); - $this->organizationName = func_get_arg(9); - $this->organizationId = func_get_arg(10); - $this->formattedValue = func_get_arg(11); - $this->ccEmail = func_get_arg(12); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['title'] = $this->title; - $json['user_id'] = $this->userId; - $json['visible_to'] = $this->visibleTo; - $json['status'] = $this->status; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['person_name'] = $this->personName; - $json['person_id'] = $this->personId; - $json['organization_name'] = $this->organizationName; - $json['organization_id'] = $this->organizationId; - $json['formatted_value'] = $this->formattedValue; - $json['cc_email'] = $this->ccEmail; - - return $json; - } -} diff --git a/src/Models/Data24.php b/src/Models/Data24.php deleted file mode 100644 index a03fd31f..00000000 --- a/src/Models/Data24.php +++ /dev/null @@ -1,115 +0,0 @@ -valuesTotal - * @param WeightedValuesTotal $weightedValuesTotal Initialization value for $this- - * >weightedValuesTotal - * @param integer $totalCount Initialization value for $this- - * >totalCount - * @param double $totalCurrencyConvertedValue Initialization value for $this- - * >totalCurrencyConvertedValue - * @param double $totalWeightedCurrencyConvertedValue Initialization value for $this- - * >totalWeightedCurrencyConvertedValue - * @param string $totalCurrencyConvertedValueFormatted Initialization value for $this- - * >totalCurrencyConvertedValueFormatted - * @param string $totalWeightedCurrencyConvertedValueFormatted Initialization value for $this- - * >totalWeightedCurrencyConvertedValueFo - * rmatted - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->valuesTotal = func_get_arg(0); - $this->weightedValuesTotal = func_get_arg(1); - $this->totalCount = func_get_arg(2); - $this->totalCurrencyConvertedValue = func_get_arg(3); - $this->totalWeightedCurrencyConvertedValue = func_get_arg(4); - $this->totalCurrencyConvertedValueFormatted = func_get_arg(5); - $this->totalWeightedCurrencyConvertedValueFormatted = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['values_total'] = $this->valuesTotal; - $json['weighted_values_total'] = $this->weightedValuesTotal; - $json['total_count'] = $this->totalCount; - $json['total_currency_converted_value'] = $this->totalCurrencyConvertedValue; - $json['total_weighted_currency_converted_value'] = $this->totalWeightedCurrencyConvertedValue; - $json['total_currency_converted_value_formatted'] = $this->totalCurrencyConvertedValueFormatted; - $json['total_weighted_currency_converted_value_formatted'] = $this->totalWeightedCurrencyConvertedValueFormatted; - - return $json; - } -} diff --git a/src/Models/Data25.php b/src/Models/Data25.php deleted file mode 100644 index fd1507c8..00000000 --- a/src/Models/Data25.php +++ /dev/null @@ -1,75 +0,0 @@ -periodStart - * @param string $periodEnd Initialization value for $this->periodEnd - * @param array $deals Initialization value for $this->deals - * @param Totals $totals Initialization value for $this->totals - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->periodStart = func_get_arg(0); - $this->periodEnd = func_get_arg(1); - $this->deals = func_get_arg(2); - $this->totals = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['period_start'] = $this->periodStart; - $json['period_end'] = $this->periodEnd; - $json['deals'] = $this->deals; - $json['totals'] = $this->totals; - - return $json; - } -} diff --git a/src/Models/Data26.php b/src/Models/Data26.php deleted file mode 100644 index d5ca6822..00000000 --- a/src/Models/Data26.php +++ /dev/null @@ -1,239 +0,0 @@ -itemPrice - * @param integer $quantity Initialization value for $this->quantity - * @param double $discountPercentage Initialization value for $this->discountPercentage - * @param double $duration Initialization value for $this->duration - * @param integer $productVariationId Initialization value for $this->productVariationId - * @param string $comments Initialization value for $this->comments - * @param int $enabledFlag Initialization value for $this->enabledFlag - * @param integer $id Initialization value for $this->id - * @param integer $companyId Initialization value for $this->companyId - * @param integer $dealId Initialization value for $this->dealId - * @param integer $productId Initialization value for $this->productId - * @param string $durationUnit Initialization value for $this->durationUnit - * @param double $sumNoDiscount Initialization value for $this->sumNoDiscount - * @param double $sum Initialization value for $this->sum - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $lastEdit Initialization value for $this->lastEdit - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param double $tax Initialization value for $this->tax - * @param string $name Initialization value for $this->name - */ - public function __construct() - { - switch (func_num_args()) { - case 20: - $this->itemPrice = func_get_arg(0); - $this->quantity = func_get_arg(1); - $this->discountPercentage = func_get_arg(2); - $this->duration = func_get_arg(3); - $this->productVariationId = func_get_arg(4); - $this->comments = func_get_arg(5); - $this->enabledFlag = func_get_arg(6); - $this->id = func_get_arg(7); - $this->companyId = func_get_arg(8); - $this->dealId = func_get_arg(9); - $this->productId = func_get_arg(10); - $this->durationUnit = func_get_arg(11); - $this->sumNoDiscount = func_get_arg(12); - $this->sum = func_get_arg(13); - $this->currency = func_get_arg(14); - $this->addTime = func_get_arg(15); - $this->lastEdit = func_get_arg(16); - $this->activeFlag = func_get_arg(17); - $this->tax = func_get_arg(18); - $this->name = func_get_arg(19); - break; - - default: - $this->discountPercentage = 0; - $this->duration = 1; - break; - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['item_price'] = $this->itemPrice; - $json['quantity'] = $this->quantity; - $json['discount_percentage'] = $this->discountPercentage; - $json['duration'] = $this->duration; - $json['product_variation_id'] = $this->productVariationId; - $json['comments'] = $this->comments; - $json['enabled_flag'] = $this->enabledFlag; - $json['id'] = $this->id; - $json['company_id'] = $this->companyId; - $json['deal_id'] = $this->dealId; - $json['product_id'] = $this->productId; - $json['duration_unit'] = $this->durationUnit; - $json['sum_no_discount'] = $this->sumNoDiscount; - $json['sum'] = $this->sum; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['last_edit'] = $this->lastEdit; - $json['active_flag'] = $this->activeFlag; - $json['tax'] = $this->tax; - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/Data27.php b/src/Models/Data27.php deleted file mode 100644 index d1ed476f..00000000 --- a/src/Models/Data27.php +++ /dev/null @@ -1,249 +0,0 @@ -itemPrice - * @param integer $quantity Initialization value for $this->quantity - * @param double $discountPercentage Initialization value for $this->discountPercentage - * @param double $duration Initialization value for $this->duration - * @param integer $productVariationId Initialization value for $this->productVariationId - * @param string $comments Initialization value for $this->comments - * @param int $enabledFlag Initialization value for $this->enabledFlag - * @param integer $id Initialization value for $this->id - * @param integer $companyId Initialization value for $this->companyId - * @param integer $dealId Initialization value for $this->dealId - * @param integer $productId Initialization value for $this->productId - * @param string $durationUnit Initialization value for $this->durationUnit - * @param double $sumNoDiscount Initialization value for $this->sumNoDiscount - * @param double $sum Initialization value for $this->sum - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $lastEdit Initialization value for $this->lastEdit - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param double $tax Initialization value for $this->tax - * @param string $name Initialization value for $this->name - * @param integer $productAttachmentId Initialization value for $this->productAttachmentId - */ - public function __construct() - { - switch (func_num_args()) { - case 21: - $this->itemPrice = func_get_arg(0); - $this->quantity = func_get_arg(1); - $this->discountPercentage = func_get_arg(2); - $this->duration = func_get_arg(3); - $this->productVariationId = func_get_arg(4); - $this->comments = func_get_arg(5); - $this->enabledFlag = func_get_arg(6); - $this->id = func_get_arg(7); - $this->companyId = func_get_arg(8); - $this->dealId = func_get_arg(9); - $this->productId = func_get_arg(10); - $this->durationUnit = func_get_arg(11); - $this->sumNoDiscount = func_get_arg(12); - $this->sum = func_get_arg(13); - $this->currency = func_get_arg(14); - $this->addTime = func_get_arg(15); - $this->lastEdit = func_get_arg(16); - $this->activeFlag = func_get_arg(17); - $this->tax = func_get_arg(18); - $this->name = func_get_arg(19); - $this->productAttachmentId = func_get_arg(20); - break; - - default: - $this->discountPercentage = 0; - $this->duration = 1; - break; - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['item_price'] = $this->itemPrice; - $json['quantity'] = $this->quantity; - $json['discount_percentage'] = $this->discountPercentage; - $json['duration'] = $this->duration; - $json['product_variation_id'] = $this->productVariationId; - $json['comments'] = $this->comments; - $json['enabled_flag'] = $this->enabledFlag; - $json['id'] = $this->id; - $json['company_id'] = $this->companyId; - $json['deal_id'] = $this->dealId; - $json['product_id'] = $this->productId; - $json['duration_unit'] = $this->durationUnit; - $json['sum_no_discount'] = $this->sumNoDiscount; - $json['sum'] = $this->sum; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['last_edit'] = $this->lastEdit; - $json['active_flag'] = $this->activeFlag; - $json['tax'] = $this->tax; - $json['name'] = $this->name; - $json['product_attachment_id'] = $this->productAttachmentId; - - return $json; - } -} diff --git a/src/Models/Data29.php b/src/Models/Data29.php deleted file mode 100644 index 3952d464..00000000 --- a/src/Models/Data29.php +++ /dev/null @@ -1,221 +0,0 @@ -id - * @param integer $companyId Initialization value for $this->companyId - * @param integer $ownerId Initialization value for $this->ownerId - * @param integer $userId Initialization value for $this->userId - * @param string $eventAction Initialization value for $this->eventAction - * @param string $eventObject Initialization value for $this->eventObject - * @param string $subscriptionUrl Initialization value for $this->subscriptionUrl - * @param int $isActive Initialization value for $this->isActive - * @param \DateTime $addTime Initialization value for $this->addTime - * @param \DateTime $removeTime Initialization value for $this->removeTime - * @param string $type Initialization value for $this->type - * @param string $httpAuthUser Initialization value for $this->httpAuthUser - * @param string $httpAuthPassword Initialization value for $this->httpAuthPassword - * @param object $additionalData Initialization value for $this->additionalData - * @param string $removeReason Initialization value for $this->removeReason - * @param \DateTime $lastDeliveryTime Initialization value for $this->lastDeliveryTime - * @param integer $lastHttpStatus Initialization value for $this->lastHttpStatus - * @param integer $adminId Initialization value for $this->adminId - */ - public function __construct() - { - if (18 == func_num_args()) { - $this->id = func_get_arg(0); - $this->companyId = func_get_arg(1); - $this->ownerId = func_get_arg(2); - $this->userId = func_get_arg(3); - $this->eventAction = func_get_arg(4); - $this->eventObject = func_get_arg(5); - $this->subscriptionUrl = func_get_arg(6); - $this->isActive = func_get_arg(7); - $this->addTime = func_get_arg(8); - $this->removeTime = func_get_arg(9); - $this->type = func_get_arg(10); - $this->httpAuthUser = func_get_arg(11); - $this->httpAuthPassword = func_get_arg(12); - $this->additionalData = func_get_arg(13); - $this->removeReason = func_get_arg(14); - $this->lastDeliveryTime = func_get_arg(15); - $this->lastHttpStatus = func_get_arg(16); - $this->adminId = func_get_arg(17); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['company_id'] = $this->companyId; - $json['owner_id'] = $this->ownerId; - $json['user_id'] = $this->userId; - $json['event_action'] = $this->eventAction; - $json['event_object'] = $this->eventObject; - $json['subscription_url'] = $this->subscriptionUrl; - $json['is_active'] = $this->isActive; - $json['add_time'] = isset($this->addTime) ? - DateTimeHelper::toRfc3339DateTime($this->addTime) : null; - $json['remove_time'] = isset($this->removeTime) ? - DateTimeHelper::toRfc3339DateTime($this->removeTime) : null; - $json['type'] = $this->type; - $json['http_auth_user'] = $this->httpAuthUser; - $json['http_auth_password'] = $this->httpAuthPassword; - $json['additional_data'] = $this->additionalData; - $json['remove_reason'] = $this->removeReason; - $json['last_delivery_time'] = isset($this->lastDeliveryTime) ? - DateTimeHelper::toRfc3339DateTime($this->lastDeliveryTime) : null; - $json['last_http_status'] = $this->lastHttpStatus; - $json['admin_id'] = $this->adminId; - - return $json; - } -} diff --git a/src/Models/Data3.php b/src/Models/Data3.php deleted file mode 100644 index 4facf030..00000000 --- a/src/Models/Data3.php +++ /dev/null @@ -1,618 +0,0 @@ -id - * @param integer $creatorUserId Initialization value for $this->creatorUserId - * @param integer $userId Initialization value for $this->userId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - * @param integer $mergeWhatId Initialization value for $this->mergeWhatId - */ - public function __construct() - { - if (59 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - $this->stageId = func_get_arg(5); - $this->title = func_get_arg(6); - $this->value = func_get_arg(7); - $this->currency = func_get_arg(8); - $this->addTime = func_get_arg(9); - $this->updateTime = func_get_arg(10); - $this->stageChangeTime = func_get_arg(11); - $this->active = func_get_arg(12); - $this->deleted = func_get_arg(13); - $this->status = func_get_arg(14); - $this->probability = func_get_arg(15); - $this->nextActivityDate = func_get_arg(16); - $this->nextActivityTime = func_get_arg(17); - $this->nextActivityId = func_get_arg(18); - $this->lastActivityId = func_get_arg(19); - $this->lastActivityDate = func_get_arg(20); - $this->lostReason = func_get_arg(21); - $this->visibleTo = func_get_arg(22); - $this->closeTime = func_get_arg(23); - $this->pipelineId = func_get_arg(24); - $this->wonTime = func_get_arg(25); - $this->firstWonTime = func_get_arg(26); - $this->lostTime = func_get_arg(27); - $this->productsCount = func_get_arg(28); - $this->filesCount = func_get_arg(29); - $this->notesCount = func_get_arg(30); - $this->followersCount = func_get_arg(31); - $this->emailMessagesCount = func_get_arg(32); - $this->activitiesCount = func_get_arg(33); - $this->doneActivitiesCount = func_get_arg(34); - $this->undoneActivitiesCount = func_get_arg(35); - $this->referenceActivitiesCount = func_get_arg(36); - $this->participantsCount = func_get_arg(37); - $this->expectedCloseDate = func_get_arg(38); - $this->lastIncomingMailTime = func_get_arg(39); - $this->lastOutgoingMailTime = func_get_arg(40); - $this->label = func_get_arg(41); - $this->stageOrderNr = func_get_arg(42); - $this->personName = func_get_arg(43); - $this->orgName = func_get_arg(44); - $this->nextActivitySubject = func_get_arg(45); - $this->nextActivityType = func_get_arg(46); - $this->nextActivityDuration = func_get_arg(47); - $this->nextActivityNote = func_get_arg(48); - $this->formattedValue = func_get_arg(49); - $this->weightedValue = func_get_arg(50); - $this->formattedWeightedValue = func_get_arg(51); - $this->weightedValueCurrency = func_get_arg(52); - $this->rottenTime = func_get_arg(53); - $this->ownerName = func_get_arg(54); - $this->ccEmail = func_get_arg(55); - $this->orgHidden = func_get_arg(56); - $this->personHidden = func_get_arg(57); - $this->mergeWhatId = func_get_arg(58); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - $json['merge_what_id'] = $this->mergeWhatId; - - return $json; - } -} diff --git a/src/Models/Data4.php b/src/Models/Data4.php deleted file mode 100644 index 7d69cab6..00000000 --- a/src/Models/Data4.php +++ /dev/null @@ -1,75 +0,0 @@ -userId - * @param integer $id Initialization value for $this->id - * @param integer $dealId Initialization value for $this->dealId - * @param string $addTime Initialization value for $this->addTime - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->userId = func_get_arg(0); - $this->id = func_get_arg(1); - $this->dealId = func_get_arg(2); - $this->addTime = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['user_id'] = $this->userId; - $json['id'] = $this->id; - $json['deal_id'] = $this->dealId; - $json['add_time'] = $this->addTime; - - return $json; - } -} diff --git a/src/Models/Data5.php b/src/Models/Data5.php deleted file mode 100644 index 956d5f55..00000000 --- a/src/Models/Data5.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data6.php b/src/Models/Data6.php deleted file mode 100644 index 26d466ef..00000000 --- a/src/Models/Data6.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data7.php b/src/Models/Data7.php deleted file mode 100644 index 1816dbf1..00000000 --- a/src/Models/Data7.php +++ /dev/null @@ -1,45 +0,0 @@ -id - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->id = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - - return $json; - } -} diff --git a/src/Models/Data8.php b/src/Models/Data8.php deleted file mode 100644 index ac76136c..00000000 --- a/src/Models/Data8.php +++ /dev/null @@ -1,55 +0,0 @@ -id - * @param integer $productAttachmentId Initialization value for $this->productAttachmentId - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->id = func_get_arg(0); - $this->productAttachmentId = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['product_attachment_id'] = $this->productAttachmentId; - - return $json; - } -} diff --git a/src/Models/Data9.php b/src/Models/Data9.php deleted file mode 100644 index 8928b2ae..00000000 --- a/src/Models/Data9.php +++ /dev/null @@ -1,75 +0,0 @@ -userId - * @param integer $id Initialization value for $this->id - * @param integer $productId Initialization value for $this->productId - * @param string $addTime Initialization value for $this->addTime - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->userId = func_get_arg(0); - $this->id = func_get_arg(1); - $this->productId = func_get_arg(2); - $this->addTime = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['user_id'] = $this->userId; - $json['id'] = $this->id; - $json['product_id'] = $this->productId; - $json['add_time'] = $this->addTime; - - return $json; - } -} diff --git a/src/Models/Deal.php b/src/Models/Deal.php deleted file mode 100644 index 055760ed..00000000 --- a/src/Models/Deal.php +++ /dev/null @@ -1,608 +0,0 @@ -id - * @param integer $creatorUserId Initialization value for $this->creatorUserId - * @param integer $userId Initialization value for $this->userId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $title Initialization value for $this->title - * @param double $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param string $stageChangeTime Initialization value for $this->stageChangeTime - * @param bool $active Initialization value for $this->active - * @param bool $deleted Initialization value for $this->deleted - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $nextActivityDate Initialization value for $this->nextActivityDate - * @param string $nextActivityTime Initialization value for $this->nextActivityTime - * @param integer $nextActivityId Initialization value for $this->nextActivityId - * @param integer $lastActivityId Initialization value for $this->lastActivityId - * @param string $lastActivityDate Initialization value for $this->lastActivityDate - * @param string $lostReason Initialization value for $this->lostReason - * @param string $visibleTo Initialization value for $this->visibleTo - * @param string $closeTime Initialization value for $this->closeTime - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param string $wonTime Initialization value for $this->wonTime - * @param string $firstWonTime Initialization value for $this->firstWonTime - * @param string $lostTime Initialization value for $this->lostTime - * @param integer $productsCount Initialization value for $this->productsCount - * @param integer $filesCount Initialization value for $this->filesCount - * @param integer $notesCount Initialization value for $this->notesCount - * @param integer $followersCount Initialization value for $this->followersCount - * @param integer $emailMessagesCount Initialization value for $this->emailMessagesCount - * @param integer $activitiesCount Initialization value for $this->activitiesCount - * @param integer $doneActivitiesCount Initialization value for $this->doneActivitiesCount - * @param integer $undoneActivitiesCount Initialization value for $this->undoneActivitiesCount - * @param integer $referenceActivitiesCount Initialization value for $this->referenceActivitiesCount - * @param integer $participantsCount Initialization value for $this->participantsCount - * @param string $expectedCloseDate Initialization value for $this->expectedCloseDate - * @param string $lastIncomingMailTime Initialization value for $this->lastIncomingMailTime - * @param string $lastOutgoingMailTime Initialization value for $this->lastOutgoingMailTime - * @param string $label Initialization value for $this->label - * @param integer $stageOrderNr Initialization value for $this->stageOrderNr - * @param string $personName Initialization value for $this->personName - * @param string $orgName Initialization value for $this->orgName - * @param string $nextActivitySubject Initialization value for $this->nextActivitySubject - * @param string $nextActivityType Initialization value for $this->nextActivityType - * @param string $nextActivityDuration Initialization value for $this->nextActivityDuration - * @param string $nextActivityNote Initialization value for $this->nextActivityNote - * @param string $formattedValue Initialization value for $this->formattedValue - * @param double $weightedValue Initialization value for $this->weightedValue - * @param string $formattedWeightedValue Initialization value for $this->formattedWeightedValue - * @param string $weightedValueCurrency Initialization value for $this->weightedValueCurrency - * @param string $rottenTime Initialization value for $this->rottenTime - * @param string $ownerName Initialization value for $this->ownerName - * @param string $ccEmail Initialization value for $this->ccEmail - * @param bool $orgHidden Initialization value for $this->orgHidden - * @param bool $personHidden Initialization value for $this->personHidden - */ - public function __construct() - { - if (58 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - $this->stageId = func_get_arg(5); - $this->title = func_get_arg(6); - $this->value = func_get_arg(7); - $this->currency = func_get_arg(8); - $this->addTime = func_get_arg(9); - $this->updateTime = func_get_arg(10); - $this->stageChangeTime = func_get_arg(11); - $this->active = func_get_arg(12); - $this->deleted = func_get_arg(13); - $this->status = func_get_arg(14); - $this->probability = func_get_arg(15); - $this->nextActivityDate = func_get_arg(16); - $this->nextActivityTime = func_get_arg(17); - $this->nextActivityId = func_get_arg(18); - $this->lastActivityId = func_get_arg(19); - $this->lastActivityDate = func_get_arg(20); - $this->lostReason = func_get_arg(21); - $this->visibleTo = func_get_arg(22); - $this->closeTime = func_get_arg(23); - $this->pipelineId = func_get_arg(24); - $this->wonTime = func_get_arg(25); - $this->firstWonTime = func_get_arg(26); - $this->lostTime = func_get_arg(27); - $this->productsCount = func_get_arg(28); - $this->filesCount = func_get_arg(29); - $this->notesCount = func_get_arg(30); - $this->followersCount = func_get_arg(31); - $this->emailMessagesCount = func_get_arg(32); - $this->activitiesCount = func_get_arg(33); - $this->doneActivitiesCount = func_get_arg(34); - $this->undoneActivitiesCount = func_get_arg(35); - $this->referenceActivitiesCount = func_get_arg(36); - $this->participantsCount = func_get_arg(37); - $this->expectedCloseDate = func_get_arg(38); - $this->lastIncomingMailTime = func_get_arg(39); - $this->lastOutgoingMailTime = func_get_arg(40); - $this->label = func_get_arg(41); - $this->stageOrderNr = func_get_arg(42); - $this->personName = func_get_arg(43); - $this->orgName = func_get_arg(44); - $this->nextActivitySubject = func_get_arg(45); - $this->nextActivityType = func_get_arg(46); - $this->nextActivityDuration = func_get_arg(47); - $this->nextActivityNote = func_get_arg(48); - $this->formattedValue = func_get_arg(49); - $this->weightedValue = func_get_arg(50); - $this->formattedWeightedValue = func_get_arg(51); - $this->weightedValueCurrency = func_get_arg(52); - $this->rottenTime = func_get_arg(53); - $this->ownerName = func_get_arg(54); - $this->ccEmail = func_get_arg(55); - $this->orgHidden = func_get_arg(56); - $this->personHidden = func_get_arg(57); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['stage_change_time'] = $this->stageChangeTime; - $json['active'] = $this->active; - $json['deleted'] = $this->deleted; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['next_activity_date'] = $this->nextActivityDate; - $json['next_activity_time'] = $this->nextActivityTime; - $json['next_activity_id'] = $this->nextActivityId; - $json['last_activity_id'] = $this->lastActivityId; - $json['last_activity_date'] = $this->lastActivityDate; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['close_time'] = $this->closeTime; - $json['pipeline_id'] = $this->pipelineId; - $json['won_time'] = $this->wonTime; - $json['first_won_time'] = $this->firstWonTime; - $json['lost_time'] = $this->lostTime; - $json['products_count'] = $this->productsCount; - $json['files_count'] = $this->filesCount; - $json['notes_count'] = $this->notesCount; - $json['followers_count'] = $this->followersCount; - $json['email_messages_count'] = $this->emailMessagesCount; - $json['activities_count'] = $this->activitiesCount; - $json['done_activities_count'] = $this->doneActivitiesCount; - $json['undone_activities_count'] = $this->undoneActivitiesCount; - $json['reference_activities_count'] = $this->referenceActivitiesCount; - $json['participants_count'] = $this->participantsCount; - $json['expected_close_date'] = $this->expectedCloseDate; - $json['last_incoming_mail_time'] = $this->lastIncomingMailTime; - $json['last_outgoing_mail_time'] = $this->lastOutgoingMailTime; - $json['label'] = $this->label; - $json['stage_order_nr'] = $this->stageOrderNr; - $json['person_name'] = $this->personName; - $json['org_name'] = $this->orgName; - $json['next_activity_subject'] = $this->nextActivitySubject; - $json['next_activity_type'] = $this->nextActivityType; - $json['next_activity_duration'] = $this->nextActivityDuration; - $json['next_activity_note'] = $this->nextActivityNote; - $json['formatted_value'] = $this->formattedValue; - $json['weighted_value'] = $this->weightedValue; - $json['formatted_weighted_value'] = $this->formattedWeightedValue; - $json['weighted_value_currency'] = $this->weightedValueCurrency; - $json['rotten_time'] = $this->rottenTime; - $json['owner_name'] = $this->ownerName; - $json['cc_email'] = $this->ccEmail; - $json['org_hidden'] = $this->orgHidden; - $json['person_hidden'] = $this->personHidden; - - return $json; - } -} diff --git a/src/Models/DealDefaultVisibilityEnum.php b/src/Models/DealDefaultVisibilityEnum.php deleted file mode 100644 index 1629ab7a..00000000 --- a/src/Models/DealDefaultVisibilityEnum.php +++ /dev/null @@ -1,34 +0,0 @@ -id - * @param CreatorUserId $creatorUserId Initialization value for $this->creatorUserId - * @param UserId $userId Initialization value for $this->userId - * @param PersonId $personId Initialization value for $this->personId - * @param OrgId $orgId Initialization value for $this->orgId - */ - public function __construct() - { - if (5 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - - return $json; - } -} diff --git a/src/Models/DealOrganizationData.php b/src/Models/DealOrganizationData.php deleted file mode 100644 index 2d451ea3..00000000 --- a/src/Models/DealOrganizationData.php +++ /dev/null @@ -1,94 +0,0 @@ -name - * @param integer $peopleCount Initialization value for $this->peopleCount - * @param integer $ownerId Initialization value for $this->ownerId - * @param string $address Initialization value for $this->address - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $ccEmail Initialization value for $this->ccEmail - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->name = func_get_arg(0); - $this->peopleCount = func_get_arg(1); - $this->ownerId = func_get_arg(2); - $this->address = func_get_arg(3); - $this->activeFlag = func_get_arg(4); - $this->ccEmail = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['people_count'] = $this->peopleCount; - $json['owner_id'] = $this->ownerId; - $json['address'] = $this->address; - $json['active_flag'] = $this->activeFlag; - $json['cc_email'] = $this->ccEmail; - - return $json; - } -} diff --git a/src/Models/DealPersonData.php b/src/Models/DealPersonData.php deleted file mode 100644 index 7876de08..00000000 --- a/src/Models/DealPersonData.php +++ /dev/null @@ -1,73 +0,0 @@ -activeFlag - * @param string $name Initialization value for $this->name - * @param array $email Initialization value for $this->email - * @param array $phone Initialization value for $this->phone - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->activeFlag = func_get_arg(0); - $this->name = func_get_arg(1); - $this->email = func_get_arg(2); - $this->phone = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['active_flag'] = $this->activeFlag; - $json['name'] = $this->name; - $json['email'] = $this->email; - $json['phone'] = $this->phone; - - return $json; - } -} diff --git a/src/Models/DealStrictModeFields.php b/src/Models/DealStrictModeFields.php deleted file mode 100644 index d56f724b..00000000 --- a/src/Models/DealStrictModeFields.php +++ /dev/null @@ -1,85 +0,0 @@ -id - * @param integer $creatorUserId Initialization value for $this->creatorUserId - * @param integer $userId Initialization value for $this->userId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - */ - public function __construct() - { - if (5 == func_num_args()) { - $this->id = func_get_arg(0); - $this->creatorUserId = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->personId = func_get_arg(3); - $this->orgId = func_get_arg(4); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['creator_user_id'] = $this->creatorUserId; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - - return $json; - } -} diff --git a/src/Models/DealUserData.php b/src/Models/DealUserData.php deleted file mode 100644 index 22c1ffb1..00000000 --- a/src/Models/DealUserData.php +++ /dev/null @@ -1,93 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param string $email Initialization value for $this->email - * @param bool $hasPic Initialization value for $this->hasPic - * @param string $picHash Initialization value for $this->picHash - * @param bool $activeFlag Initialization value for $this->activeFlag - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->email = func_get_arg(2); - $this->hasPic = func_get_arg(3); - $this->picHash = func_get_arg(4); - $this->activeFlag = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['email'] = $this->email; - $json['has_pic'] = $this->hasPic; - $json['pic_hash'] = $this->picHash; - $json['active_flag'] = $this->activeFlag; - - return $json; - } -} diff --git a/src/Models/DeleteDeal.php b/src/Models/DeleteDeal.php deleted file mode 100644 index c3eb5630..00000000 --- a/src/Models/DeleteDeal.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data5 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteDealFollower.php b/src/Models/DeleteDealFollower.php deleted file mode 100644 index bfb38bd5..00000000 --- a/src/Models/DeleteDealFollower.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data6 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteDealParticipant.php b/src/Models/DeleteDealParticipant.php deleted file mode 100644 index d248d347..00000000 --- a/src/Models/DeleteDealParticipant.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data7 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteDealProduct.php b/src/Models/DeleteDealProduct.php deleted file mode 100644 index 9389ad77..00000000 --- a/src/Models/DeleteDealProduct.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data8 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteMultipleDeals.php b/src/Models/DeleteMultipleDeals.php deleted file mode 100644 index 1550a516..00000000 --- a/src/Models/DeleteMultipleDeals.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteMultipleProductFieldsResponse.php b/src/Models/DeleteMultipleProductFieldsResponse.php deleted file mode 100644 index 5688a49c..00000000 --- a/src/Models/DeleteMultipleProductFieldsResponse.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data12 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteNote.php b/src/Models/DeleteNote.php deleted file mode 100644 index 3665fa6a..00000000 --- a/src/Models/DeleteNote.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param bool $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteProductFieldResponse.php b/src/Models/DeleteProductFieldResponse.php deleted file mode 100644 index 808bbfdb..00000000 --- a/src/Models/DeleteProductFieldResponse.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data13 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteProductFollowerResponse.php b/src/Models/DeleteProductFollowerResponse.php deleted file mode 100644 index 1c47b263..00000000 --- a/src/Models/DeleteProductFollowerResponse.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data10 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteRole.php b/src/Models/DeleteRole.php deleted file mode 100644 index 7da8dd8c..00000000 --- a/src/Models/DeleteRole.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data15 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/DeleteRoleAssignment.php b/src/Models/DeleteRoleAssignment.php deleted file mode 100644 index ef23c5e5..00000000 --- a/src/Models/DeleteRoleAssignment.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data17 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/Email.php b/src/Models/Email.php deleted file mode 100644 index 517e8f49..00000000 --- a/src/Models/Email.php +++ /dev/null @@ -1,63 +0,0 @@ -label - * @param string $value Initialization value for $this->value - * @param bool $primary Initialization value for $this->primary - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->label = func_get_arg(0); - $this->value = func_get_arg(1); - $this->primary = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['label'] = $this->label; - $json['value'] = $this->value; - $json['primary'] = $this->primary; - - return $json; - } -} diff --git a/src/Models/EventActionEnum.php b/src/Models/EventActionEnum.php deleted file mode 100644 index 7f92968b..00000000 --- a/src/Models/EventActionEnum.php +++ /dev/null @@ -1,39 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a person ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- * @required - * @maps field_type - * @var string $fieldType public property - */ - public $fieldType; - - /** - * Constructor to set initial or default values of member properties - * @param string $fieldType Initialization value for $this->fieldType - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->fieldType = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['field_type'] = $this->fieldType; - - return $json; - } -} diff --git a/src/Models/FieldType1Enum.php b/src/Models/FieldType1Enum.php deleted file mode 100644 index 2bf544c8..00000000 --- a/src/Models/FieldType1Enum.php +++ /dev/null @@ -1,101 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a person ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- */ -class FieldType1Enum -{ - /** - * TODO: Write general description for this element - */ - const VARCHAR = "varchar"; - - /** - * TODO: Write general description for this element - */ - const VARCHAR_AUTO = "varchar_auto"; - - /** - * TODO: Write general description for this element - */ - const TEXT = "text"; - - /** - * TODO: Write general description for this element - */ - const DOUBLE = "double"; - - /** - * TODO: Write general description for this element - */ - const MONETARY = "monetary"; - - /** - * TODO: Write general description for this element - */ - const DATE = "date"; - - /** - * TODO: Write general description for this element - */ - const SET = "set"; - - /** - * TODO: Write general description for this element - */ - const ENUM = "enum"; - - /** - * TODO: Write general description for this element - */ - const USER = "user"; - - /** - * TODO: Write general description for this element - */ - const ORG = "org"; - - /** - * TODO: Write general description for this element - */ - const PEOPLE = "people"; - - /** - * TODO: Write general description for this element - */ - const PHONE = "phone"; - - /** - * TODO: Write general description for this element - */ - const TIME = "time"; - - /** - * TODO: Write general description for this element - */ - const TIMERANGE = "timerange"; - - /** - * TODO: Write general description for this element - */ - const DATERANGE = "daterange"; -} diff --git a/src/Models/FieldType4Enum.php b/src/Models/FieldType4Enum.php deleted file mode 100644 index 07bb5031..00000000 --- a/src/Models/FieldType4Enum.php +++ /dev/null @@ -1,101 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a product ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- */ -class FieldType4Enum -{ - /** - * TODO: Write general description for this element - */ - const VARCHAR = "varchar"; - - /** - * TODO: Write general description for this element - */ - const VARCHAR_AUTO = "varchar_auto"; - - /** - * TODO: Write general description for this element - */ - const TEXT = "text"; - - /** - * TODO: Write general description for this element - */ - const DOUBLE = "double"; - - /** - * TODO: Write general description for this element - */ - const MONETARY = "monetary"; - - /** - * TODO: Write general description for this element - */ - const DATE = "date"; - - /** - * TODO: Write general description for this element - */ - const SET = "set"; - - /** - * TODO: Write general description for this element - */ - const ENUM = "enum"; - - /** - * TODO: Write general description for this element - */ - const USER = "user"; - - /** - * TODO: Write general description for this element - */ - const ORG = "org"; - - /** - * TODO: Write general description for this element - */ - const PEOPLE = "people"; - - /** - * TODO: Write general description for this element - */ - const PHONE = "phone"; - - /** - * TODO: Write general description for this element - */ - const TIME = "time"; - - /** - * TODO: Write general description for this element - */ - const TIMERANGE = "timerange"; - - /** - * TODO: Write general description for this element - */ - const DATERANGE = "daterange"; -} diff --git a/src/Models/FieldType6Enum.php b/src/Models/FieldType6Enum.php deleted file mode 100644 index 7c1ab01c..00000000 --- a/src/Models/FieldType6Enum.php +++ /dev/null @@ -1,34 +0,0 @@ -parentRoleId - * @param string $name Initialization value for $this->name - * @param integer $id Initialization value for $this->id - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $assignmentCount Initialization value for $this->assignmentCount - * @param string $subRoleCount Initialization value for $this->subRoleCount - * @param integer $level Initialization value for $this->level - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->parentRoleId = func_get_arg(0); - $this->name = func_get_arg(1); - $this->id = func_get_arg(2); - $this->activeFlag = func_get_arg(3); - $this->assignmentCount = func_get_arg(4); - $this->subRoleCount = func_get_arg(5); - $this->level = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['parent_role_id'] = $this->parentRoleId; - $json['name'] = $this->name; - $json['id'] = $this->id; - $json['active_flag'] = $this->activeFlag; - $json['assignment_count'] = $this->assignmentCount; - $json['sub_role_count'] = $this->subRoleCount; - $json['level'] = $this->level; - - return $json; - } -} diff --git a/src/Models/GetAddProductAttachementDetails.php b/src/Models/GetAddProductAttachementDetails.php deleted file mode 100644 index 1e3bed38..00000000 --- a/src/Models/GetAddProductAttachementDetails.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data27 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetAddedDeal.php b/src/Models/GetAddedDeal.php deleted file mode 100644 index 3f7bb5e2..00000000 --- a/src/Models/GetAddedDeal.php +++ /dev/null @@ -1,74 +0,0 @@ -success - * @param Data1 $data Initialization value for $this->data - * @param AdditionalData5 $additionalData Initialization value for $this->additionalData - * @param RelatedObjects $relatedObjects Initialization value for $this->relatedObjects - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - $this->relatedObjects = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - $json['related_objects'] = $this->relatedObjects; - - return $json; - } -} diff --git a/src/Models/GetAllProductFieldsResponse.php b/src/Models/GetAllProductFieldsResponse.php deleted file mode 100644 index 75f0e91e..00000000 --- a/src/Models/GetAllProductFieldsResponse.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param object $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GetDeal.php b/src/Models/GetDeal.php deleted file mode 100644 index cc238344..00000000 --- a/src/Models/GetDeal.php +++ /dev/null @@ -1,74 +0,0 @@ -success - * @param Data21 $data Initialization value for $this->data - * @param AdditionalData3 $additionalData Initialization value for $this->additionalData - * @param RelatedObjects $relatedObjects Initialization value for $this->relatedObjects - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - $this->relatedObjects = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - $json['related_objects'] = $this->relatedObjects; - - return $json; - } -} diff --git a/src/Models/GetDeals.php b/src/Models/GetDeals.php deleted file mode 100644 index 94495260..00000000 --- a/src/Models/GetDeals.php +++ /dev/null @@ -1,74 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param AdditionalDataWithPaginationDetails $additionalData Initialization value for $this->additionalData - * @param RelatedObjects $relatedObjects Initialization value for $this->relatedObjects - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - $this->relatedObjects = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - $json['related_objects'] = $this->relatedObjects; - - return $json; - } -} diff --git a/src/Models/GetDealsByName.php b/src/Models/GetDealsByName.php deleted file mode 100644 index a26b7508..00000000 --- a/src/Models/GetDealsByName.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param AdditionalData4 $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GetDealsSummary.php b/src/Models/GetDealsSummary.php deleted file mode 100644 index 593520d3..00000000 --- a/src/Models/GetDealsSummary.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data24 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetDealsTimeline.php b/src/Models/GetDealsTimeline.php deleted file mode 100644 index 69c91b0d..00000000 --- a/src/Models/GetDealsTimeline.php +++ /dev/null @@ -1,55 +0,0 @@ -success - * @param Data25[] $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetDuplicatedDeal.php b/src/Models/GetDuplicatedDeal.php deleted file mode 100644 index fb25984b..00000000 --- a/src/Models/GetDuplicatedDeal.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data2 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetMergedDeal.php b/src/Models/GetMergedDeal.php deleted file mode 100644 index 2e8e36bf..00000000 --- a/src/Models/GetMergedDeal.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data3 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetNotes.php b/src/Models/GetNotes.php deleted file mode 100644 index 99d0da83..00000000 --- a/src/Models/GetNotes.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param AdditionalData $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GetProductAttachementDetails.php b/src/Models/GetProductAttachementDetails.php deleted file mode 100644 index 6556d907..00000000 --- a/src/Models/GetProductAttachementDetails.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data26 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetProductFieldResponse.php b/src/Models/GetProductFieldResponse.php deleted file mode 100644 index a382e8cc..00000000 --- a/src/Models/GetProductFieldResponse.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param ProductField $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetRole.php b/src/Models/GetRole.php deleted file mode 100644 index 1f8bcc32..00000000 --- a/src/Models/GetRole.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param SubRole $data Initialization value for $this->data - * @param AdditionalData2 $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GetRoleAssignments.php b/src/Models/GetRoleAssignments.php deleted file mode 100644 index 2789a6a9..00000000 --- a/src/Models/GetRoleAssignments.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param RolesAdditionalData $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GetRoleSettings.php b/src/Models/GetRoleSettings.php deleted file mode 100644 index cf45a4a4..00000000 --- a/src/Models/GetRoleSettings.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param RoleSettings $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/GetRoleSubroles.php b/src/Models/GetRoleSubroles.php deleted file mode 100644 index 79abcf05..00000000 --- a/src/Models/GetRoleSubroles.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param RolesAdditionalData $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GetRoles.php b/src/Models/GetRoles.php deleted file mode 100644 index dd22dd68..00000000 --- a/src/Models/GetRoles.php +++ /dev/null @@ -1,64 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param RolesAdditionalData $additionalData Initialization value for $this->additionalData - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->additionalData = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['additional_data'] = $this->additionalData; - - return $json; - } -} diff --git a/src/Models/GlobalMessageBaseResponse.php b/src/Models/GlobalMessageBaseResponse.php deleted file mode 100644 index 537e5468..00000000 --- a/src/Models/GlobalMessageBaseResponse.php +++ /dev/null @@ -1,45 +0,0 @@ -success - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->success = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - - return $json; - } -} diff --git a/src/Models/GlobalMessageData.php b/src/Models/GlobalMessageData.php deleted file mode 100644 index c90fcbe3..00000000 --- a/src/Models/GlobalMessageData.php +++ /dev/null @@ -1,94 +0,0 @@ -id - * @param integer $userId Initialization value for $this->userId - * @param integer $companyId Initialization value for $this->companyId - * @param GlobalMessageUserData $typeInfo Initialization value for $this->typeInfo - * @param object $userData Initialization value for $this->userData - * @param string $html Initialization value for $this->html - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->id = func_get_arg(0); - $this->userId = func_get_arg(1); - $this->companyId = func_get_arg(2); - $this->typeInfo = func_get_arg(3); - $this->userData = func_get_arg(4); - $this->html = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['user_id'] = $this->userId; - $json['company_id'] = $this->companyId; - $json['type_info'] = $this->typeInfo; - $json['user_data'] = $this->userData; - $json['html'] = $this->html; - - return $json; - } -} diff --git a/src/Models/GlobalMessageDelete.php b/src/Models/GlobalMessageDelete.php deleted file mode 100644 index 03977f55..00000000 --- a/src/Models/GlobalMessageDelete.php +++ /dev/null @@ -1,75 +0,0 @@ -success - * @param GlobalMessageData $data Initialization value for $this->data - * @param double $handleTime Initialization value for $this->handleTime - * @param object $reqTimeCtxMs Initialization value for $this->reqTimeCtxMs - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->handleTime = func_get_arg(2); - $this->reqTimeCtxMs = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['handle_time'] = $this->handleTime; - $json['_req_time_ctx_ms'] = $this->reqTimeCtxMs; - - return $json; - } -} diff --git a/src/Models/GlobalMessageGet.php b/src/Models/GlobalMessageGet.php deleted file mode 100644 index e32f44d9..00000000 --- a/src/Models/GlobalMessageGet.php +++ /dev/null @@ -1,75 +0,0 @@ -success - * @param array $data Initialization value for $this->data - * @param double $handleTime Initialization value for $this->handleTime - * @param object $reqTimeCtxMs Initialization value for $this->reqTimeCtxMs - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - $this->handleTime = func_get_arg(2); - $this->reqTimeCtxMs = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - $json['handle_time'] = $this->handleTime; - $json['_req_time_ctx_ms'] = $this->reqTimeCtxMs; - - return $json; - } -} diff --git a/src/Models/GlobalMessageUserData.php b/src/Models/GlobalMessageUserData.php deleted file mode 100644 index 1fdf715b..00000000 --- a/src/Models/GlobalMessageUserData.php +++ /dev/null @@ -1,65 +0,0 @@ -messageType - * @param bool $dismissibleFlag Initialization value for $this->dismissibleFlag - * @param integer $priority Initialization value for $this->priority - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->messageType = func_get_arg(0); - $this->dismissibleFlag = func_get_arg(1); - $this->priority = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['message_type'] = $this->messageType; - $json['dismissible_flag'] = $this->dismissibleFlag; - $json['priority'] = $this->priority; - - return $json; - } -} diff --git a/src/Models/IconKeyEnum.php b/src/Models/IconKeyEnum.php deleted file mode 100644 index ad467014..00000000 --- a/src/Models/IconKeyEnum.php +++ /dev/null @@ -1,214 +0,0 @@ -languageCode - * @param string $countryCode Initialization value for $this->countryCode - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->languageCode = func_get_arg(0); - $this->countryCode = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['language_code'] = $this->languageCode; - $json['country_code'] = $this->countryCode; - - return $json; - } -} diff --git a/src/Models/MailMessage.php b/src/Models/MailMessage.php deleted file mode 100644 index ce278b8c..00000000 --- a/src/Models/MailMessage.php +++ /dev/null @@ -1,81 +0,0 @@ -success - * @param integer $statusCode Initialization value for $this->statusCode - * @param string $statusText Initialization value for $this->statusText - * @param object $service Initialization value for $this->service - * @param MailMessageData $data Initialization value for $this->data - */ - public function __construct() - { - if (5 == func_num_args()) { - $this->success = func_get_arg(0); - $this->statusCode = func_get_arg(1); - $this->statusText = func_get_arg(2); - $this->service = func_get_arg(3); - $this->data = func_get_arg(4); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['statusCode'] = $this->statusCode; - $json['statusText'] = $this->statusText; - $json['service'] = $this->service; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/MailMessageData.php b/src/Models/MailMessageData.php deleted file mode 100644 index fbb181f4..00000000 --- a/src/Models/MailMessageData.php +++ /dev/null @@ -1,326 +0,0 @@ -id - * @param array $from Initialization value for $this->from - * @param array $to Initialization value for $this->to - * @param array $cc Initialization value for $this->cc - * @param array $bcc Initialization value for $this->bcc - * @param string $bodyUrl Initialization value for $this->bodyUrl - * @param string $accountId Initialization value for $this->accountId - * @param integer $userId Initialization value for $this->userId - * @param integer $mailThreadId Initialization value for $this->mailThreadId - * @param string $subject Initialization value for $this->subject - * @param string $snippet Initialization value for $this->snippet - * @param string $mailTrackingStatus Initialization value for $this->mailTrackingStatus - * @param int $mailLinkTrackingEnabledFlag Initialization value for $this->mailLinkTrackingEnabledFlag - * @param int $readFlag Initialization value for $this->readFlag - * @param string $draft Initialization value for $this->draft - * @param int $draftFlag Initialization value for $this->draftFlag - * @param int $syncedFlag Initialization value for $this->syncedFlag - * @param int $deletedFlag Initialization value for $this->deletedFlag - * @param int $hasBodyFlag Initialization value for $this->hasBodyFlag - * @param int $sentFlag Initialization value for $this->sentFlag - * @param int $sentFromPipedriveFlag Initialization value for $this->sentFromPipedriveFlag - * @param int $smartBccFlag Initialization value for $this->smartBccFlag - * @param \DateTime $messageTime Initialization value for $this->messageTime - * @param \DateTime $addTime Initialization value for $this->addTime - * @param \DateTime $updateTime Initialization value for $this->updateTime - * @param int $hasAttachmentsFlag Initialization value for $this->hasAttachmentsFlag - * @param int $hasInlineAttachmentsFlag Initialization value for $this->hasInlineAttachmentsFlag - * @param int $hasRealAttachmentsFlag Initialization value for $this->hasRealAttachmentsFlag - * @param bool $writeFlag Initialization value for $this->writeFlag - */ - public function __construct() - { - if (29 == func_num_args()) { - $this->id = func_get_arg(0); - $this->from = func_get_arg(1); - $this->to = func_get_arg(2); - $this->cc = func_get_arg(3); - $this->bcc = func_get_arg(4); - $this->bodyUrl = func_get_arg(5); - $this->accountId = func_get_arg(6); - $this->userId = func_get_arg(7); - $this->mailThreadId = func_get_arg(8); - $this->subject = func_get_arg(9); - $this->snippet = func_get_arg(10); - $this->mailTrackingStatus = func_get_arg(11); - $this->mailLinkTrackingEnabledFlag = func_get_arg(12); - $this->readFlag = func_get_arg(13); - $this->draft = func_get_arg(14); - $this->draftFlag = func_get_arg(15); - $this->syncedFlag = func_get_arg(16); - $this->deletedFlag = func_get_arg(17); - $this->hasBodyFlag = func_get_arg(18); - $this->sentFlag = func_get_arg(19); - $this->sentFromPipedriveFlag = func_get_arg(20); - $this->smartBccFlag = func_get_arg(21); - $this->messageTime = func_get_arg(22); - $this->addTime = func_get_arg(23); - $this->updateTime = func_get_arg(24); - $this->hasAttachmentsFlag = func_get_arg(25); - $this->hasInlineAttachmentsFlag = func_get_arg(26); - $this->hasRealAttachmentsFlag = func_get_arg(27); - $this->writeFlag = func_get_arg(28); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['from'] = $this->from; - $json['to'] = $this->to; - $json['cc'] = $this->cc; - $json['bcc'] = $this->bcc; - $json['body_url'] = $this->bodyUrl; - $json['account_id'] = $this->accountId; - $json['user_id'] = $this->userId; - $json['mail_thread_id'] = $this->mailThreadId; - $json['subject'] = $this->subject; - $json['snippet'] = $this->snippet; - $json['mail_tracking_status'] = $this->mailTrackingStatus; - $json['mail_link_tracking_enabled_flag'] = $this->mailLinkTrackingEnabledFlag; - $json['read_flag'] = $this->readFlag; - $json['draft'] = $this->draft; - $json['draft_flag'] = $this->draftFlag; - $json['synced_flag'] = $this->syncedFlag; - $json['deleted_flag'] = $this->deletedFlag; - $json['has_body_flag'] = $this->hasBodyFlag; - $json['sent_flag'] = $this->sentFlag; - $json['sent_from_pipedrive_flag'] = $this->sentFromPipedriveFlag; - $json['smart_bcc_flag'] = $this->smartBccFlag; - $json['message_time'] = isset($this->messageTime) ? - DateTimeHelper::toSimpleDate($this->messageTime) : null; - $json['add_time'] = isset($this->addTime) ? - DateTimeHelper::toSimpleDate($this->addTime) : null; - $json['update_time'] = isset($this->updateTime) ? - DateTimeHelper::toSimpleDate($this->updateTime) : null; - $json['has_attachments_flag'] = $this->hasAttachmentsFlag; - $json['has_inline_attachments_flag'] = $this->hasInlineAttachmentsFlag; - $json['has_real_attachments_flag'] = $this->hasRealAttachmentsFlag; - $json['write_flag'] = $this->writeFlag; - - return $json; - } -} diff --git a/src/Models/MailParticipant.php b/src/Models/MailParticipant.php deleted file mode 100644 index 97ae70b3..00000000 --- a/src/Models/MailParticipant.php +++ /dev/null @@ -1,94 +0,0 @@ -id - * @param string $emailAddress Initialization value for $this->emailAddress - * @param string $name Initialization value for $this->name - * @param integer $linkedPersonId Initialization value for $this->linkedPersonId - * @param string $linkedPersonName Initialization value for $this->linkedPersonName - * @param integer $mailMessagePartyId Initialization value for $this->mailMessagePartyId - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->id = func_get_arg(0); - $this->emailAddress = func_get_arg(1); - $this->name = func_get_arg(2); - $this->linkedPersonId = func_get_arg(3); - $this->linkedPersonName = func_get_arg(4); - $this->mailMessagePartyId = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['email_address'] = $this->emailAddress; - $json['name'] = $this->name; - $json['linked_person_id'] = $this->linkedPersonId; - $json['linked_person_name'] = $this->linkedPersonName; - $json['mail_message_party_id'] = $this->mailMessagePartyId; - - return $json; - } -} diff --git a/src/Models/MailServiceBaseResponse.php b/src/Models/MailServiceBaseResponse.php deleted file mode 100644 index fc71f749..00000000 --- a/src/Models/MailServiceBaseResponse.php +++ /dev/null @@ -1,72 +0,0 @@ -success - * @param integer $statusCode Initialization value for $this->statusCode - * @param string $statusText Initialization value for $this->statusText - * @param object $service Initialization value for $this->service - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->success = func_get_arg(0); - $this->statusCode = func_get_arg(1); - $this->statusText = func_get_arg(2); - $this->service = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['statusCode'] = $this->statusCode; - $json['statusText'] = $this->statusText; - $json['service'] = $this->service; - - return $json; - } -} diff --git a/src/Models/MailThread.php b/src/Models/MailThread.php deleted file mode 100644 index db5e3038..00000000 --- a/src/Models/MailThread.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/MailThreadDelete.php b/src/Models/MailThreadDelete.php deleted file mode 100644 index 172051ee..00000000 --- a/src/Models/MailThreadDelete.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/MailThreadMessages.php b/src/Models/MailThreadMessages.php deleted file mode 100644 index bb3e1581..00000000 --- a/src/Models/MailThreadMessages.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/MailThreadOne.php b/src/Models/MailThreadOne.php deleted file mode 100644 index f0cc6993..00000000 --- a/src/Models/MailThreadOne.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param BaseMailThread $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/MailThreadParticipant.php b/src/Models/MailThreadParticipant.php deleted file mode 100644 index 04a5853f..00000000 --- a/src/Models/MailThreadParticipant.php +++ /dev/null @@ -1,124 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param bool $latestSent Initialization value for $this->latestSent - * @param string $emailAddress Initialization value for $this->emailAddress - * @param double $messageTime Initialization value for $this->messageTime - * @param integer $linkedPersonId Initialization value for $this->linkedPersonId - * @param string $linkedPersonName Initialization value for $this->linkedPersonName - * @param integer $mailMessagePartyId Initialization value for $this->mailMessagePartyId - * @param integer $linkedOrganizationId Initialization value for $this->linkedOrganizationId - */ - public function __construct() - { - if (9 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->latestSent = func_get_arg(2); - $this->emailAddress = func_get_arg(3); - $this->messageTime = func_get_arg(4); - $this->linkedPersonId = func_get_arg(5); - $this->linkedPersonName = func_get_arg(6); - $this->mailMessagePartyId = func_get_arg(7); - $this->linkedOrganizationId = func_get_arg(8); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['latest_sent'] = $this->latestSent; - $json['email_address'] = $this->emailAddress; - $json['message_time'] = $this->messageTime; - $json['linked_person_id'] = $this->linkedPersonId; - $json['linked_person_name'] = $this->linkedPersonName; - $json['mail_message_party_id'] = $this->mailMessagePartyId; - $json['linked_organization_id'] = $this->linkedOrganizationId; - - return $json; - } -} diff --git a/src/Models/MailThreadPut.php b/src/Models/MailThreadPut.php deleted file mode 100644 index 08666ddf..00000000 --- a/src/Models/MailThreadPut.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/MailTrackingStatusEnum.php b/src/Models/MailTrackingStatusEnum.php deleted file mode 100644 index 5c3b8deb..00000000 --- a/src/Models/MailTrackingStatusEnum.php +++ /dev/null @@ -1,24 +0,0 @@ -
1
Owner & followers - * (private)
3
Entire company (shared)
- * @maps visible_to - * @var int|null $visibleTo public property - */ - public $visibleTo; - - /** - * Optional creation date & time of the deal in UTC. Requires admin user API token. Format: YYYY-MM-DD - * HH:MM:SS - * @maps add_time - * @var string|null $addTime public property - */ - public $addTime; - - /** - * Constructor to set initial or default values of member properties - * @param string $title Initialization value for $this->title - * @param string $value Initialization value for $this->value - * @param string $currency Initialization value for $this->currency - * @param integer $userId Initialization value for $this->userId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - * @param integer $stageId Initialization value for $this->stageId - * @param string $status Initialization value for $this->status - * @param double $probability Initialization value for $this->probability - * @param string $lostReason Initialization value for $this->lostReason - * @param int $visibleTo Initialization value for $this->visibleTo - * @param string $addTime Initialization value for $this->addTime - */ - public function __construct() - { - if (12 == func_num_args()) { - $this->title = func_get_arg(0); - $this->value = func_get_arg(1); - $this->currency = func_get_arg(2); - $this->userId = func_get_arg(3); - $this->personId = func_get_arg(4); - $this->orgId = func_get_arg(5); - $this->stageId = func_get_arg(6); - $this->status = func_get_arg(7); - $this->probability = func_get_arg(8); - $this->lostReason = func_get_arg(9); - $this->visibleTo = func_get_arg(10); - $this->addTime = func_get_arg(11); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['title'] = $this->title; - $json['value'] = $this->value; - $json['currency'] = $this->currency; - $json['user_id'] = $this->userId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['stage_id'] = $this->stageId; - $json['status'] = $this->status; - $json['probability'] = $this->probability; - $json['lost_reason'] = $this->lostReason; - $json['visible_to'] = $this->visibleTo; - $json['add_time'] = $this->addTime; - - return $json; - } -} diff --git a/src/Models/NewDealProduct.php b/src/Models/NewDealProduct.php deleted file mode 100644 index dd92c2f5..00000000 --- a/src/Models/NewDealProduct.php +++ /dev/null @@ -1,127 +0,0 @@ -itemPrice - * @param integer $quantity Initialization value for $this->quantity - * @param double $discountPercentage Initialization value for $this->discountPercentage - * @param double $duration Initialization value for $this->duration - * @param integer $productVariationId Initialization value for $this->productVariationId - * @param string $comments Initialization value for $this->comments - * @param int $enabledFlag Initialization value for $this->enabledFlag - * @param integer $productId Initialization value for $this->productId - */ - public function __construct() - { - switch (func_num_args()) { - case 8: - $this->itemPrice = func_get_arg(0); - $this->quantity = func_get_arg(1); - $this->discountPercentage = func_get_arg(2); - $this->duration = func_get_arg(3); - $this->productVariationId = func_get_arg(4); - $this->comments = func_get_arg(5); - $this->enabledFlag = func_get_arg(6); - $this->productId = func_get_arg(7); - break; - - default: - $this->discountPercentage = 0; - $this->duration = 1; - break; - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['item_price'] = $this->itemPrice; - $json['quantity'] = $this->quantity; - $json['discount_percentage'] = $this->discountPercentage; - $json['duration'] = $this->duration; - $json['product_variation_id'] = $this->productVariationId; - $json['comments'] = $this->comments; - $json['enabled_flag'] = $this->enabledFlag; - $json['product_id'] = $this->productId; - - return $json; - } -} diff --git a/src/Models/NewFollowerResponse.php b/src/Models/NewFollowerResponse.php deleted file mode 100644 index 6ed2396c..00000000 --- a/src/Models/NewFollowerResponse.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data9 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/NewGoal.php b/src/Models/NewGoal.php deleted file mode 100644 index cf7e4218..00000000 --- a/src/Models/NewGoal.php +++ /dev/null @@ -1,108 +0,0 @@ -title - * @param object $assignee Initialization value for $this->assignee - * @param object $type Initialization value for $this->type - * @param object $expectedOutcome Initialization value for $this->expectedOutcome - * @param object $duration Initialization value for $this->duration - * @param string $interval Initialization value for $this->interval - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->title = func_get_arg(0); - $this->assignee = func_get_arg(1); - $this->type = func_get_arg(2); - $this->expectedOutcome = func_get_arg(3); - $this->duration = func_get_arg(4); - $this->interval = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['title'] = $this->title; - $json['assignee'] = $this->assignee; - $json['type'] = $this->type; - $json['expected_outcome'] = $this->expectedOutcome; - $json['duration'] = $this->duration; - $json['interval'] = $this->interval; - - return $json; - } -} diff --git a/src/Models/NewOrganization.php b/src/Models/NewOrganization.php deleted file mode 100644 index eb12c6be..00000000 --- a/src/Models/NewOrganization.php +++ /dev/null @@ -1,80 +0,0 @@ -
1
Owner & - * followers (private)
3
Entire company (shared)
- * @maps visible_to - * @var int|null $visibleTo public property - */ - public $visibleTo; - - /** - * Optional creation date & time of the organization in UTC. Requires admin user API token. Format: - * YYYY-MM-DD HH:MM:SS - * @maps add_time - * @var string|null $addTime public property - */ - public $addTime; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param integer $ownerId Initialization value for $this->ownerId - * @param int $visibleTo Initialization value for $this->visibleTo - * @param string $addTime Initialization value for $this->addTime - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->name = func_get_arg(0); - $this->ownerId = func_get_arg(1); - $this->visibleTo = func_get_arg(2); - $this->addTime = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['owner_id'] = $this->ownerId; - $json['visible_to'] = $this->visibleTo; - $json['add_time'] = $this->addTime; - - return $json; - } -} diff --git a/src/Models/NewOrganizationField.php b/src/Models/NewOrganizationField.php deleted file mode 100644 index 40d70385..00000000 --- a/src/Models/NewOrganizationField.php +++ /dev/null @@ -1,81 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a person ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- * @required - * @maps field_type - * @var string $fieldType public property - */ - public $fieldType; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param string $options Initialization value for $this->options - * @param string $fieldType Initialization value for $this->fieldType - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->name = func_get_arg(0); - $this->options = func_get_arg(1); - $this->fieldType = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['options'] = $this->options; - $json['field_type'] = $this->fieldType; - - return $json; - } -} diff --git a/src/Models/NewPerson.php b/src/Models/NewPerson.php deleted file mode 100644 index d29f7927..00000000 --- a/src/Models/NewPerson.php +++ /dev/null @@ -1,110 +0,0 @@ -
1
Owner & followers - * (private)
3
Entire company (shared)
- * @maps visible_to - * @var int|null $visibleTo public property - */ - public $visibleTo; - - /** - * Optional creation date & time of the person in UTC. Requires admin user API token. Format: YYYY-MM- - * DD HH:MM:SS - * @maps add_time - * @var string|null $addTime public property - */ - public $addTime; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param integer $ownerId Initialization value for $this->ownerId - * @param integer $orgId Initialization value for $this->orgId - * @param array $email Initialization value for $this->email - * @param array $phone Initialization value for $this->phone - * @param int $visibleTo Initialization value for $this->visibleTo - * @param string $addTime Initialization value for $this->addTime - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->name = func_get_arg(0); - $this->ownerId = func_get_arg(1); - $this->orgId = func_get_arg(2); - $this->email = func_get_arg(3); - $this->phone = func_get_arg(4); - $this->visibleTo = func_get_arg(5); - $this->addTime = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['owner_id'] = $this->ownerId; - $json['org_id'] = $this->orgId; - $json['email'] = $this->email; - $json['phone'] = $this->phone; - $json['visible_to'] = $this->visibleTo; - $json['add_time'] = $this->addTime; - - return $json; - } -} diff --git a/src/Models/NewPersonField.php b/src/Models/NewPersonField.php deleted file mode 100644 index c282f1de..00000000 --- a/src/Models/NewPersonField.php +++ /dev/null @@ -1,81 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a person ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- * @required - * @maps field_type - * @var string $fieldType public property - */ - public $fieldType; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param string $options Initialization value for $this->options - * @param string $fieldType Initialization value for $this->fieldType - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->name = func_get_arg(0); - $this->options = func_get_arg(1); - $this->fieldType = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['options'] = $this->options; - $json['field_type'] = $this->fieldType; - - return $json; - } -} diff --git a/src/Models/NewProductField.php b/src/Models/NewProductField.php deleted file mode 100644 index 0cf9f3a8..00000000 --- a/src/Models/NewProductField.php +++ /dev/null @@ -1,79 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a product ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- * @required - * @maps field_type - * @var string $fieldType public property - */ - public $fieldType; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param string $options Initialization value for $this->options - * @param string $fieldType Initialization value for $this->fieldType - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->name = func_get_arg(0); - $this->options = func_get_arg(1); - $this->fieldType = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['options'] = $this->options; - $json['field_type'] = $this->fieldType; - - return $json; - } -} diff --git a/src/Models/Note.php b/src/Models/Note.php deleted file mode 100644 index f66ea33d..00000000 --- a/src/Models/Note.php +++ /dev/null @@ -1,147 +0,0 @@ -content - * @param integer $userId Initialization value for $this->userId - * @param string $leadId Initialization value for $this->leadId - * @param integer $dealId Initialization value for $this->dealId - * @param integer $personId Initialization value for $this->personId - * @param integer $orgId Initialization value for $this->orgId - * @param string $addTime Initialization value for $this->addTime - * @param int $pinnedToLeadFlag Initialization value for $this->pinnedToLeadFlag - * @param int $pinnedToDealFlag Initialization value for $this->pinnedToDealFlag - * @param int $pinnedToOrganizationFlag Initialization value for $this->pinnedToOrganizationFlag - * @param int $pinnedToPersonFlag Initialization value for $this->pinnedToPersonFlag - */ - public function __construct() - { - if (11 == func_num_args()) { - $this->content = func_get_arg(0); - $this->userId = func_get_arg(1); - $this->leadId = func_get_arg(2); - $this->dealId = func_get_arg(3); - $this->personId = func_get_arg(4); - $this->orgId = func_get_arg(5); - $this->addTime = func_get_arg(6); - $this->pinnedToLeadFlag = func_get_arg(7); - $this->pinnedToDealFlag = func_get_arg(8); - $this->pinnedToOrganizationFlag = func_get_arg(9); - $this->pinnedToPersonFlag = func_get_arg(10); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['content'] = $this->content; - $json['user_id'] = $this->userId; - $json['lead_id'] = $this->leadId; - $json['deal_id'] = $this->dealId; - $json['person_id'] = $this->personId; - $json['org_id'] = $this->orgId; - $json['add_time'] = $this->addTime; - $json['pinned_to_lead_flag'] = $this->pinnedToLeadFlag; - $json['pinned_to_deal_flag'] = $this->pinnedToDealFlag; - $json['pinned_to_organization_flag'] = $this->pinnedToOrganizationFlag; - $json['pinned_to_person_flag'] = $this->pinnedToPersonFlag; - - return $json; - } -} diff --git a/src/Models/NoteCreatorUser.php b/src/Models/NoteCreatorUser.php deleted file mode 100644 index bfcff5cd..00000000 --- a/src/Models/NoteCreatorUser.php +++ /dev/null @@ -1,74 +0,0 @@ -email - * @param string $iconUrl Initialization value for $this->iconUrl - * @param bool $isYou Initialization value for $this->isYou - * @param string $name Initialization value for $this->name - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->email = func_get_arg(0); - $this->iconUrl = func_get_arg(1); - $this->isYou = func_get_arg(2); - $this->name = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['email'] = $this->email; - $json['icon_url'] = $this->iconUrl; - $json['is_you'] = $this->isYou; - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/NumberBooleanEnum.php b/src/Models/NumberBooleanEnum.php deleted file mode 100644 index d9959870..00000000 --- a/src/Models/NumberBooleanEnum.php +++ /dev/null @@ -1,24 +0,0 @@ -accessToken - * @param string $tokenType Initialization value for $this->tokenType - * @param integer $expiresIn Initialization value for $this->expiresIn - * @param string $scope Initialization value for $this->scope - * @param integer $expiry Initialization value for $this->expiry - * @param string $refreshToken Initialization value for $this->refreshToken - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->accessToken = func_get_arg(0); - $this->tokenType = func_get_arg(1); - $this->expiresIn = func_get_arg(2); - $this->scope = func_get_arg(3); - $this->expiry = func_get_arg(4); - $this->refreshToken = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['access_token'] = $this->accessToken; - $json['token_type'] = $this->tokenType; - $json['expires_in'] = $this->expiresIn; - $json['scope'] = $this->scope; - $json['expiry'] = $this->expiry; - $json['refresh_token'] = $this->refreshToken; - - return $json; - } -} diff --git a/src/Models/OrderByEnum.php b/src/Models/OrderByEnum.php deleted file mode 100644 index 47e71f45..00000000 --- a/src/Models/OrderByEnum.php +++ /dev/null @@ -1,34 +0,0 @@ -name - * @param integer $peopleCount Initialization value for $this->peopleCount - * @param integer $ownerId Initialization value for $this->ownerId - * @param string $address Initialization value for $this->address - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $ccEmail Initialization value for $this->ccEmail - * @param integer $value Initialization value for $this->value - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->name = func_get_arg(0); - $this->peopleCount = func_get_arg(1); - $this->ownerId = func_get_arg(2); - $this->address = func_get_arg(3); - $this->activeFlag = func_get_arg(4); - $this->ccEmail = func_get_arg(5); - $this->value = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['people_count'] = $this->peopleCount; - $json['owner_id'] = $this->ownerId; - $json['address'] = $this->address; - $json['active_flag'] = $this->activeFlag; - $json['cc_email'] = $this->ccEmail; - $json['value'] = $this->value; - - return $json; - } -} diff --git a/src/Models/Organization.php b/src/Models/Organization.php deleted file mode 100644 index 6534df43..00000000 --- a/src/Models/Organization.php +++ /dev/null @@ -1,45 +0,0 @@ -name - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->name = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/OrganizationRelationship.php b/src/Models/OrganizationRelationship.php deleted file mode 100644 index e4fb3d2c..00000000 --- a/src/Models/OrganizationRelationship.php +++ /dev/null @@ -1,77 +0,0 @@ -orgId - * @param string $type Initialization value for $this->type - * @param integer $relOwnerOrgId Initialization value for $this->relOwnerOrgId - * @param integer $relLinkedOrgId Initialization value for $this->relLinkedOrgId - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->orgId = func_get_arg(0); - $this->type = func_get_arg(1); - $this->relOwnerOrgId = func_get_arg(2); - $this->relLinkedOrgId = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['org_id'] = $this->orgId; - $json['type'] = $this->type; - $json['rel_owner_org_id'] = $this->relOwnerOrgId; - $json['rel_linked_org_id'] = $this->relLinkedOrgId; - - return $json; - } -} diff --git a/src/Models/Pagination.php b/src/Models/Pagination.php deleted file mode 100644 index 752be564..00000000 --- a/src/Models/Pagination.php +++ /dev/null @@ -1,74 +0,0 @@ -start - * @param integer $limit Initialization value for $this->limit - * @param bool $moreItemsInCollection Initialization value for $this->moreItemsInCollection - * @param integer $nextStart Initialization value for $this->nextStart - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->start = func_get_arg(0); - $this->limit = func_get_arg(1); - $this->moreItemsInCollection = func_get_arg(2); - $this->nextStart = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['start'] = $this->start; - $json['limit'] = $this->limit; - $json['more_items_in_collection'] = $this->moreItemsInCollection; - $json['next_start'] = $this->nextStart; - - return $json; - } -} diff --git a/src/Models/Pagination1.php b/src/Models/Pagination1.php deleted file mode 100644 index e311f53c..00000000 --- a/src/Models/Pagination1.php +++ /dev/null @@ -1,64 +0,0 @@ -start - * @param integer $limit Initialization value for $this->limit - * @param bool $moreItemsInCollection Initialization value for $this->moreItemsInCollection - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->start = func_get_arg(0); - $this->limit = func_get_arg(1); - $this->moreItemsInCollection = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['start'] = $this->start; - $json['limit'] = $this->limit; - $json['more_items_in_collection'] = $this->moreItemsInCollection; - - return $json; - } -} diff --git a/src/Models/Parties.php b/src/Models/Parties.php deleted file mode 100644 index 77d8ce22..00000000 --- a/src/Models/Parties.php +++ /dev/null @@ -1,54 +0,0 @@ -to - * @param array $from Initialization value for $this->from - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->to = func_get_arg(0); - $this->from = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['to'] = $this->to; - $json['from'] = $this->from; - - return $json; - } -} diff --git a/src/Models/PermissionSets.php b/src/Models/PermissionSets.php deleted file mode 100644 index 9e38a315..00000000 --- a/src/Models/PermissionSets.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/PermissionSetsItem.php b/src/Models/PermissionSetsItem.php deleted file mode 100644 index 157884a1..00000000 --- a/src/Models/PermissionSetsItem.php +++ /dev/null @@ -1,64 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param integer $assignmentCount Initialization value for $this->assignmentCount - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->assignmentCount = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['assignment_count'] = $this->assignmentCount; - - return $json; - } -} diff --git a/src/Models/Person.php b/src/Models/Person.php deleted file mode 100644 index f48cb909..00000000 --- a/src/Models/Person.php +++ /dev/null @@ -1,45 +0,0 @@ -name - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->name = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/PersonId.php b/src/Models/PersonId.php deleted file mode 100644 index 1d5a3151..00000000 --- a/src/Models/PersonId.php +++ /dev/null @@ -1,82 +0,0 @@ -activeFlag - * @param string $name Initialization value for $this->name - * @param array $email Initialization value for $this->email - * @param array $phone Initialization value for $this->phone - * @param integer $value Initialization value for $this->value - */ - public function __construct() - { - if (5 == func_num_args()) { - $this->activeFlag = func_get_arg(0); - $this->name = func_get_arg(1); - $this->email = func_get_arg(2); - $this->phone = func_get_arg(3); - $this->value = func_get_arg(4); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['active_flag'] = $this->activeFlag; - $json['name'] = $this->name; - $json['email'] = $this->email; - $json['phone'] = $this->phone; - $json['value'] = $this->value; - - return $json; - } -} diff --git a/src/Models/Phone.php b/src/Models/Phone.php deleted file mode 100644 index e34d14e3..00000000 --- a/src/Models/Phone.php +++ /dev/null @@ -1,63 +0,0 @@ -label - * @param string $value Initialization value for $this->value - * @param bool $primary Initialization value for $this->primary - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->label = func_get_arg(0); - $this->value = func_get_arg(1); - $this->primary = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['label'] = $this->label; - $json['value'] = $this->value; - $json['primary'] = $this->primary; - - return $json; - } -} diff --git a/src/Models/Pipeline.php b/src/Models/Pipeline.php deleted file mode 100644 index 93d681f8..00000000 --- a/src/Models/Pipeline.php +++ /dev/null @@ -1,74 +0,0 @@ -name - * @param int $dealProbability Initialization value for $this->dealProbability - * @param integer $orderNr Initialization value for $this->orderNr - * @param int $active Initialization value for $this->active - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->name = func_get_arg(0); - $this->dealProbability = func_get_arg(1); - $this->orderNr = func_get_arg(2); - $this->active = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['deal_probability'] = $this->dealProbability; - $json['order_nr'] = $this->orderNr; - $json['active'] = $this->active; - - return $json; - } -} diff --git a/src/Models/PostNote.php b/src/Models/PostNote.php deleted file mode 100644 index de0807a9..00000000 --- a/src/Models/PostNote.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param BaseNote $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/PostRoleAssignment.php b/src/Models/PostRoleAssignment.php deleted file mode 100644 index 34b9e11c..00000000 --- a/src/Models/PostRoleAssignment.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data18 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/PostRoleSettings.php b/src/Models/PostRoleSettings.php deleted file mode 100644 index 7e28f01a..00000000 --- a/src/Models/PostRoleSettings.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data19 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/PostRoles.php b/src/Models/PostRoles.php deleted file mode 100644 index 14f676a2..00000000 --- a/src/Models/PostRoles.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data14 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/ProductAttachementFields.php b/src/Models/ProductAttachementFields.php deleted file mode 100644 index 99d067f3..00000000 --- a/src/Models/ProductAttachementFields.php +++ /dev/null @@ -1,161 +0,0 @@ -id - * @param integer $companyId Initialization value for $this->companyId - * @param integer $dealId Initialization value for $this->dealId - * @param integer $productId Initialization value for $this->productId - * @param string $durationUnit Initialization value for $this->durationUnit - * @param double $sumNoDiscount Initialization value for $this->sumNoDiscount - * @param double $sum Initialization value for $this->sum - * @param string $currency Initialization value for $this->currency - * @param string $addTime Initialization value for $this->addTime - * @param string $lastEdit Initialization value for $this->lastEdit - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param double $tax Initialization value for $this->tax - * @param string $name Initialization value for $this->name - */ - public function __construct() - { - if (13 == func_num_args()) { - $this->id = func_get_arg(0); - $this->companyId = func_get_arg(1); - $this->dealId = func_get_arg(2); - $this->productId = func_get_arg(3); - $this->durationUnit = func_get_arg(4); - $this->sumNoDiscount = func_get_arg(5); - $this->sum = func_get_arg(6); - $this->currency = func_get_arg(7); - $this->addTime = func_get_arg(8); - $this->lastEdit = func_get_arg(9); - $this->activeFlag = func_get_arg(10); - $this->tax = func_get_arg(11); - $this->name = func_get_arg(12); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['company_id'] = $this->companyId; - $json['deal_id'] = $this->dealId; - $json['product_id'] = $this->productId; - $json['duration_unit'] = $this->durationUnit; - $json['sum_no_discount'] = $this->sumNoDiscount; - $json['sum'] = $this->sum; - $json['currency'] = $this->currency; - $json['add_time'] = $this->addTime; - $json['last_edit'] = $this->lastEdit; - $json['active_flag'] = $this->activeFlag; - $json['tax'] = $this->tax; - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/ProductField.php b/src/Models/ProductField.php deleted file mode 100644 index ac773388..00000000 --- a/src/Models/ProductField.php +++ /dev/null @@ -1,227 +0,0 @@ -
varchar
Text (up to 255 - * characters)
varchar_auto
Autocomplete text (up to 255 - * characters)
text
Long text (up to 65k characters)
double
Numeric - * value
monetary
Monetary field (has a numeric value and a currency - * value)
date
Date (format YYYY-MM-DD)
set
Options field with a - * possibility of having multiple chosen options
enum
Options field with a single - * possible chosen option
user
User field (contains a user ID of another Pipedrive - * user)
org
Organization field (contains an organization ID which is stored on the - * same account)
people
Person field (contains a product ID which is stored on the same - * account)
phone
Phone field (up to 255 numbers and/or - * characters)
time
Time field (format HH:MM:SS)
timerange
Time-range - * field (has a start time and end time value, both HH:MM:SS)
daterange
Date-range - * field (has a start date and end date value, both YYYY-MM-DD)
- * @required - * @maps field_type - * @var string $fieldType public property - */ - public $fieldType; - - /** - * The ID of the Product Field - * @var integer|null $id public property - */ - public $id; - - /** - * The key of the Product Field - * @var string|null $key public property - */ - public $key; - - /** - * Position (index) of the Product Field in the detail view - * @maps order_nr - * @var integer|null $orderNr public property - */ - public $orderNr; - - /** - * The Product Field creation time. Format: YYYY-MM-DD HH:MM:SS - * @maps add_time - * @var string|null $addTime public property - */ - public $addTime; - - /** - * The Product Field last update time. Format: YYYY-MM-DD HH:MM:SS - * @maps update_time - * @var string|null $updateTime public property - */ - public $updateTime; - - /** - * The ID of the last user to update the Product Field - * @maps last_updated_by_user_id - * @var integer|null $lastUpdatedByUserId public property - */ - public $lastUpdatedByUserId; - - /** - * Whether or not the Product Field is currently active - * @maps active_flag - * @var bool|null $activeFlag public property - */ - public $activeFlag; - - /** - * Whether or not the Product Field Name and metadata is editable - * @maps edit_flag - * @var bool|null $editFlag public property - */ - public $editFlag; - - /** - * Whether or not the Product Field is visible in the Add Product Modal - * @maps add_visible_flag - * @var bool|null $addVisibleFlag public property - */ - public $addVisibleFlag; - - /** - * Whether or not the Product Field is marked as important - * @maps important_flag - * @var bool|null $importantFlag public property - */ - public $importantFlag; - - /** - * Whether or not the Product Field data can be edited - * @maps bulk_edit_allowed - * @var bool|null $bulkEditAllowed public property - */ - public $bulkEditAllowed; - - /** - * Whether or not the Product Field is searchable - * @maps searchable_flag - * @var bool|null $searchableFlag public property - */ - public $searchableFlag; - - /** - * Whether or not the Product Field value can be used when filtering searches - * @maps filtering_allowed - * @var bool|null $filteringAllowed public property - */ - public $filteringAllowed; - - /** - * Whether or not the Product Field is sortable - * @maps sortable_flag - * @var bool|null $sortableFlag public property - */ - public $sortableFlag; - - /** - * Whether or not the Product Field is mandatory when creating products - * @maps mandatory_flag - * @var bool|null $mandatoryFlag public property - */ - public $mandatoryFlag; - - /** - * Constructor to set initial or default values of member properties - * @param string $name Initialization value for $this->name - * @param string $options Initialization value for $this->options - * @param string $fieldType Initialization value for $this->fieldType - * @param integer $id Initialization value for $this->id - * @param string $key Initialization value for $this->key - * @param integer $orderNr Initialization value for $this->orderNr - * @param string $addTime Initialization value for $this->addTime - * @param string $updateTime Initialization value for $this->updateTime - * @param integer $lastUpdatedByUserId Initialization value for $this->lastUpdatedByUserId - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param bool $editFlag Initialization value for $this->editFlag - * @param bool $addVisibleFlag Initialization value for $this->addVisibleFlag - * @param bool $importantFlag Initialization value for $this->importantFlag - * @param bool $bulkEditAllowed Initialization value for $this->bulkEditAllowed - * @param bool $searchableFlag Initialization value for $this->searchableFlag - * @param bool $filteringAllowed Initialization value for $this->filteringAllowed - * @param bool $sortableFlag Initialization value for $this->sortableFlag - * @param bool $mandatoryFlag Initialization value for $this->mandatoryFlag - */ - public function __construct() - { - if (18 == func_num_args()) { - $this->name = func_get_arg(0); - $this->options = func_get_arg(1); - $this->fieldType = func_get_arg(2); - $this->id = func_get_arg(3); - $this->key = func_get_arg(4); - $this->orderNr = func_get_arg(5); - $this->addTime = func_get_arg(6); - $this->updateTime = func_get_arg(7); - $this->lastUpdatedByUserId = func_get_arg(8); - $this->activeFlag = func_get_arg(9); - $this->editFlag = func_get_arg(10); - $this->addVisibleFlag = func_get_arg(11); - $this->importantFlag = func_get_arg(12); - $this->bulkEditAllowed = func_get_arg(13); - $this->searchableFlag = func_get_arg(14); - $this->filteringAllowed = func_get_arg(15); - $this->sortableFlag = func_get_arg(16); - $this->mandatoryFlag = func_get_arg(17); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['options'] = $this->options; - $json['field_type'] = $this->fieldType; - $json['id'] = $this->id; - $json['key'] = $this->key; - $json['order_nr'] = $this->orderNr; - $json['add_time'] = $this->addTime; - $json['update_time'] = $this->updateTime; - $json['last_updated_by_user_id'] = $this->lastUpdatedByUserId; - $json['active_flag'] = $this->activeFlag; - $json['edit_flag'] = $this->editFlag; - $json['add_visible_flag'] = $this->addVisibleFlag; - $json['important_flag'] = $this->importantFlag; - $json['bulk_edit_allowed'] = $this->bulkEditAllowed; - $json['searchable_flag'] = $this->searchableFlag; - $json['filtering_allowed'] = $this->filteringAllowed; - $json['sortable_flag'] = $this->sortableFlag; - $json['mandatory_flag'] = $this->mandatoryFlag; - - return $json; - } -} diff --git a/src/Models/PutRole.php b/src/Models/PutRole.php deleted file mode 100644 index 22681f7a..00000000 --- a/src/Models/PutRole.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data16 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/RelatedObjects.php b/src/Models/RelatedObjects.php deleted file mode 100644 index d3044fba..00000000 --- a/src/Models/RelatedObjects.php +++ /dev/null @@ -1,63 +0,0 @@ -user - * @param DealOrganizationData $organization Initialization value for $this->organization - * @param DealPersonData $person Initialization value for $this->person - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->user = func_get_arg(0); - $this->organization = func_get_arg(1); - $this->person = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['user'] = $this->user; - $json['organization'] = $this->organization; - $json['person'] = $this->person; - - return $json; - } -} diff --git a/src/Models/RemoteLocationEnum.php b/src/Models/RemoteLocationEnum.php deleted file mode 100644 index 40351f56..00000000 --- a/src/Models/RemoteLocationEnum.php +++ /dev/null @@ -1,19 +0,0 @@ -parentRoleId - * @param string $name Initialization value for $this->name - * @param integer $userId Initialization value for $this->userId - * @param integer $roleId Initialization value for $this->roleId - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $type Initialization value for $this->type - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->parentRoleId = func_get_arg(0); - $this->name = func_get_arg(1); - $this->userId = func_get_arg(2); - $this->roleId = func_get_arg(3); - $this->activeFlag = func_get_arg(4); - $this->type = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['parent_role_id'] = $this->parentRoleId; - $json['name'] = $this->name; - $json['user_id'] = $this->userId; - $json['role_id'] = $this->roleId; - $json['active_flag'] = $this->activeFlag; - $json['type'] = $this->type; - - return $json; - } -} diff --git a/src/Models/RoleSettings.php b/src/Models/RoleSettings.php deleted file mode 100644 index 581b6cbd..00000000 --- a/src/Models/RoleSettings.php +++ /dev/null @@ -1,116 +0,0 @@ -dealDefaultVisibility - * @param double $orgDefaultVisibility Initialization value for $this->orgDefaultVisibility - * @param double $personDefaultVisibility Initialization value for $this->personDefaultVisibility - * @param double $productDefaultVisibility Initialization value for $this->productDefaultVisibility - * @param double $dealAccessLevel Initialization value for $this->dealAccessLevel - * @param double $orgAccessLevel Initialization value for $this->orgAccessLevel - * @param double $personAccessLevel Initialization value for $this->personAccessLevel - * @param double $productAccessLevel Initialization value for $this->productAccessLevel - */ - public function __construct() - { - if (8 == func_num_args()) { - $this->dealDefaultVisibility = func_get_arg(0); - $this->orgDefaultVisibility = func_get_arg(1); - $this->personDefaultVisibility = func_get_arg(2); - $this->productDefaultVisibility = func_get_arg(3); - $this->dealAccessLevel = func_get_arg(4); - $this->orgAccessLevel = func_get_arg(5); - $this->personAccessLevel = func_get_arg(6); - $this->productAccessLevel = func_get_arg(7); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['deal_default_visibility'] = $this->dealDefaultVisibility; - $json['org_default_visibility'] = $this->orgDefaultVisibility; - $json['person_default_visibility'] = $this->personDefaultVisibility; - $json['product_default_visibility'] = $this->productDefaultVisibility; - $json['deal_access_level'] = $this->dealAccessLevel; - $json['org_access_level'] = $this->orgAccessLevel; - $json['person_access_level'] = $this->personAccessLevel; - $json['product_access_level'] = $this->productAccessLevel; - - return $json; - } -} diff --git a/src/Models/RolesAdditionalData.php b/src/Models/RolesAdditionalData.php deleted file mode 100644 index f33e1127..00000000 --- a/src/Models/RolesAdditionalData.php +++ /dev/null @@ -1,45 +0,0 @@ -pagination - */ - public function __construct() - { - if (1 == func_num_args()) { - $this->pagination = func_get_arg(0); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['pagination'] = $this->pagination; - - return $json; - } -} diff --git a/src/Models/RottenFlagEnum.php b/src/Models/RottenFlagEnum.php deleted file mode 100644 index 21ab830f..00000000 --- a/src/Models/RottenFlagEnum.php +++ /dev/null @@ -1,24 +0,0 @@ -success - * @param string $status Initialization value for $this->status - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->status = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['status'] = $this->status; - - return $json; - } -} diff --git a/src/Models/SettingKeyEnum.php b/src/Models/SettingKeyEnum.php deleted file mode 100644 index f4591093..00000000 --- a/src/Models/SettingKeyEnum.php +++ /dev/null @@ -1,34 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param integer $assignmentCount Initialization value for $this->assignmentCount - * @param array $contents Initialization value for $this->contents - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->assignmentCount = func_get_arg(2); - $this->contents = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['assignment_count'] = $this->assignmentCount; - $json['contents'] = $this->contents; - - return $json; - } -} diff --git a/src/Models/Stage.php b/src/Models/Stage.php deleted file mode 100644 index dd46c0d9..00000000 --- a/src/Models/Stage.php +++ /dev/null @@ -1,86 +0,0 @@ -name - * @param integer $pipelineId Initialization value for $this->pipelineId - * @param integer $dealProbability Initialization value for $this->dealProbability - * @param int $rottenFlag Initialization value for $this->rottenFlag - * @param integer $rottenDays Initialization value for $this->rottenDays - */ - public function __construct() - { - if (5 == func_num_args()) { - $this->name = func_get_arg(0); - $this->pipelineId = func_get_arg(1); - $this->dealProbability = func_get_arg(2); - $this->rottenFlag = func_get_arg(3); - $this->rottenDays = func_get_arg(4); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['pipeline_id'] = $this->pipelineId; - $json['deal_probability'] = $this->dealProbability; - $json['rotten_flag'] = $this->rottenFlag; - $json['rotten_days'] = $this->rottenDays; - - return $json; - } -} diff --git a/src/Models/Status2Enum.php b/src/Models/Status2Enum.php deleted file mode 100644 index 2d5be743..00000000 --- a/src/Models/Status2Enum.php +++ /dev/null @@ -1,39 +0,0 @@ -timesInStages - * @param array $orderOfStages Initialization value for $this->orderOfStages - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->timesInStages = func_get_arg(0); - $this->orderOfStages = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['times_in_stages'] = $this->timesInStages; - $json['order_of_stages'] = $this->orderOfStages; - - return $json; - } -} diff --git a/src/Models/SubRole.php b/src/Models/SubRole.php deleted file mode 100644 index 22ae7144..00000000 --- a/src/Models/SubRole.php +++ /dev/null @@ -1,94 +0,0 @@ -parentRoleId - * @param string $name Initialization value for $this->name - * @param integer $id Initialization value for $this->id - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param string $assignmentCount Initialization value for $this->assignmentCount - * @param string $subRoleCount Initialization value for $this->subRoleCount - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->parentRoleId = func_get_arg(0); - $this->name = func_get_arg(1); - $this->id = func_get_arg(2); - $this->activeFlag = func_get_arg(3); - $this->assignmentCount = func_get_arg(4); - $this->subRoleCount = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['parent_role_id'] = $this->parentRoleId; - $json['name'] = $this->name; - $json['id'] = $this->id; - $json['active_flag'] = $this->activeFlag; - $json['assignment_count'] = $this->assignmentCount; - $json['sub_role_count'] = $this->subRoleCount; - - return $json; - } -} diff --git a/src/Models/Teams.php b/src/Models/Teams.php deleted file mode 100644 index 2fe16529..00000000 --- a/src/Models/Teams.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/Totals.php b/src/Models/Totals.php deleted file mode 100644 index 64bc2a1b..00000000 --- a/src/Models/Totals.php +++ /dev/null @@ -1,116 +0,0 @@ -count - * @param object $values Initialization value for $this->values - * @param object $weightedValues Initialization value for $this->weightedValues - * @param integer $openCount Initialization value for $this->openCount - * @param object $openValues Initialization value for $this->openValues - * @param object $weightedOpenValues Initialization value for $this->weightedOpenValues - * @param integer $wonCount Initialization value for $this->wonCount - * @param object $wonValues Initialization value for $this->wonValues - */ - public function __construct() - { - if (8 == func_num_args()) { - $this->count = func_get_arg(0); - $this->values = func_get_arg(1); - $this->weightedValues = func_get_arg(2); - $this->openCount = func_get_arg(3); - $this->openValues = func_get_arg(4); - $this->weightedOpenValues = func_get_arg(5); - $this->wonCount = func_get_arg(6); - $this->wonValues = func_get_arg(7); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['count'] = $this->count; - $json['values'] = $this->values; - $json['weighted_values'] = $this->weightedValues; - $json['open_count'] = $this->openCount; - $json['open_values'] = $this->openValues; - $json['weighted_open_values'] = $this->weightedOpenValues; - $json['won_count'] = $this->wonCount; - $json['won_values'] = $this->wonValues; - - return $json; - } -} diff --git a/src/Models/Type2Enum.php b/src/Models/Type2Enum.php deleted file mode 100644 index 3af83cf4..00000000 --- a/src/Models/Type2Enum.php +++ /dev/null @@ -1,24 +0,0 @@ -name - * @param string $description Initialization value for $this->description - * @param integer $managerId Initialization value for $this->managerId - * @param array $users Initialization value for $this->users - * @param int $activeFlag Initialization value for $this->activeFlag - * @param int $deletedFlag Initialization value for $this->deletedFlag - */ - public function __construct() - { - if (6 == func_num_args()) { - $this->name = func_get_arg(0); - $this->description = func_get_arg(1); - $this->managerId = func_get_arg(2); - $this->users = func_get_arg(3); - $this->activeFlag = func_get_arg(4); - $this->deletedFlag = func_get_arg(5); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['name'] = $this->name; - $json['description'] = $this->description; - $json['manager_id'] = $this->managerId; - $json['users'] = $this->users; - $json['active_flag'] = $this->activeFlag; - $json['deleted_flag'] = $this->deletedFlag; - - return $json; - } -} diff --git a/src/Models/User.php b/src/Models/User.php deleted file mode 100644 index ae9c1f45..00000000 --- a/src/Models/User.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param BaseUser $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/UserAssignmentToPermissionSet.php b/src/Models/UserAssignmentToPermissionSet.php deleted file mode 100644 index 506380af..00000000 --- a/src/Models/UserAssignmentToPermissionSet.php +++ /dev/null @@ -1,74 +0,0 @@ -id - * @param integer $userId Initialization value for $this->userId - * @param integer $permissionSetId Initialization value for $this->permissionSetId - * @param string $name Initialization value for $this->name - */ - public function __construct() - { - if (4 == func_num_args()) { - $this->id = func_get_arg(0); - $this->userId = func_get_arg(1); - $this->permissionSetId = func_get_arg(2); - $this->name = func_get_arg(3); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['user_id'] = $this->userId; - $json['permission_set_id'] = $this->permissionSetId; - $json['name'] = $this->name; - - return $json; - } -} diff --git a/src/Models/UserAssignmentsToPermissionSet.php b/src/Models/UserAssignmentsToPermissionSet.php deleted file mode 100644 index 596e71d4..00000000 --- a/src/Models/UserAssignmentsToPermissionSet.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/UserConnections.php b/src/Models/UserConnections.php deleted file mode 100644 index d05f310f..00000000 --- a/src/Models/UserConnections.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param Data20 $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/UserIDs.php b/src/Models/UserIDs.php deleted file mode 100644 index 383ecdf0..00000000 --- a/src/Models/UserIDs.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/UserId.php b/src/Models/UserId.php deleted file mode 100644 index 87e1625c..00000000 --- a/src/Models/UserId.php +++ /dev/null @@ -1,102 +0,0 @@ -id - * @param string $name Initialization value for $this->name - * @param string $email Initialization value for $this->email - * @param bool $hasPic Initialization value for $this->hasPic - * @param string $picHash Initialization value for $this->picHash - * @param bool $activeFlag Initialization value for $this->activeFlag - * @param integer $value Initialization value for $this->value - */ - public function __construct() - { - if (7 == func_num_args()) { - $this->id = func_get_arg(0); - $this->name = func_get_arg(1); - $this->email = func_get_arg(2); - $this->hasPic = func_get_arg(3); - $this->picHash = func_get_arg(4); - $this->activeFlag = func_get_arg(5); - $this->value = func_get_arg(6); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['email'] = $this->email; - $json['has_pic'] = $this->hasPic; - $json['pic_hash'] = $this->picHash; - $json['active_flag'] = $this->activeFlag; - $json['value'] = $this->value; - - return $json; - } -} diff --git a/src/Models/UserMe.php b/src/Models/UserMe.php deleted file mode 100644 index 910a1124..00000000 --- a/src/Models/UserMe.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param BaseUserMe $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/Users.php b/src/Models/Users.php deleted file mode 100644 index fa0a7fe3..00000000 --- a/src/Models/Users.php +++ /dev/null @@ -1,54 +0,0 @@ -success - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (2 == func_num_args()) { - $this->success = func_get_arg(0); - $this->data = func_get_arg(1); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/ValuesTotal.php b/src/Models/ValuesTotal.php deleted file mode 100644 index 4a447623..00000000 --- a/src/Models/ValuesTotal.php +++ /dev/null @@ -1,84 +0,0 @@ -value - * @param integer $count Initialization value for $this->count - * @param double $valueConverted Initialization value for $this->valueConverted - * @param string $valueFormatted Initialization value for $this->valueFormatted - * @param string $valueConvertedFormatted Initialization value for $this->valueConvertedFormatted - */ - public function __construct() - { - if (5 == func_num_args()) { - $this->value = func_get_arg(0); - $this->count = func_get_arg(1); - $this->valueConverted = func_get_arg(2); - $this->valueFormatted = func_get_arg(3); - $this->valueConvertedFormatted = func_get_arg(4); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['value'] = $this->value; - $json['count'] = $this->count; - $json['value_converted'] = $this->valueConverted; - $json['value_formatted'] = $this->valueFormatted; - $json['value_converted_formatted'] = $this->valueConvertedFormatted; - - return $json; - } -} diff --git a/src/Models/VisibleToEnum.php b/src/Models/VisibleToEnum.php deleted file mode 100644 index e4261044..00000000 --- a/src/Models/VisibleToEnum.php +++ /dev/null @@ -1,24 +0,0 @@ -success - * @param string $status Initialization value for $this->status - * @param array $data Initialization value for $this->data - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->status = func_get_arg(1); - $this->data = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['status'] = $this->status; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/WebhooksResponse1.php b/src/Models/WebhooksResponse1.php deleted file mode 100644 index f0bbf299..00000000 --- a/src/Models/WebhooksResponse1.php +++ /dev/null @@ -1,63 +0,0 @@ -success - * @param string $status Initialization value for $this->status - * @param Data29 $data Initialization value for $this->data - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->success = func_get_arg(0); - $this->status = func_get_arg(1); - $this->data = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['success'] = $this->success; - $json['status'] = $this->status; - $json['data'] = $this->data; - - return $json; - } -} diff --git a/src/Models/WeightedValuesTotal.php b/src/Models/WeightedValuesTotal.php deleted file mode 100644 index 9c2024ac..00000000 --- a/src/Models/WeightedValuesTotal.php +++ /dev/null @@ -1,65 +0,0 @@ -value - * @param integer $count Initialization value for $this->count - * @param string $valueFormatted Initialization value for $this->valueFormatted - */ - public function __construct() - { - if (3 == func_num_args()) { - $this->value = func_get_arg(0); - $this->count = func_get_arg(1); - $this->valueFormatted = func_get_arg(2); - } - } - - - /** - * Encode this object to JSON - */ - public function jsonSerialize() - { - $json = array(); - $json['value'] = $this->value; - $json['count'] = $this->count; - $json['value_formatted'] = $this->valueFormatted; - - return $json; - } -} diff --git a/src/OAuthManager.php b/src/OAuthManager.php deleted file mode 100644 index 2f594d68..00000000 --- a/src/OAuthManager.php +++ /dev/null @@ -1,194 +0,0 @@ -oAuthApi = OAuthAuthorizationController::getInstance(); - } - - /** - * Build an authorization URL for taking the user's consent to access data - * @param array|string|null $scope List of scopes needed - * @param string|null $state An opaque state string - * @param array|null $additionalParams Additional parameters to add the the authorization URL - * @return string - */ - public function buildAuthorizationUrl($scope = null, $state = null, $additionalParams = null) - { - //the base uri for api requests - $queryBuilder = Configuration::getBaseUri(Servers::OAUTH); - - //prepare query string for API call - $queryBuilder = $queryBuilder . '/oauth/authorize'; - - //build query params - $queryParams = array ( - 'response_type' => 'code', - 'client_id' => Configuration::$oAuthClientId, - 'redirect_uri' => Configuration::$oAuthRedirectUri, - 'scope' => is_array($scope) ? implode(' ', $scope) : $scope, - 'state' => $state - ); - - if ($additionalParams != null && is_array($additionalParams)) { - $queryParams = array_merge($additionalParams, $queryParams); - } - - //process optional query parameters - APIHelper::appendUrlWithQueryParameters($queryBuilder, $queryParams); - - //validate and preprocess url - return APIHelper::cleanUrl($queryBuilder); - } - - /** - * Authorize the client with the OAuth provider - * @param string $authorizationCode Authorization code returned by the OAuth provider - * @param array|null $additionalParams Additional parameters to send during authorization - * @return \Pipedrive\Models\OAuthToken - */ - public function authorize($authorizationCode, $additionalParams = null) - { - //send request for access token - $oAuthToken = $this->oAuthApi->createRequestToken( - array ( - 'authorization' => $this->buildBasicHeader(), - 'code' => $authorizationCode, - 'redirectUri' => Configuration::$oAuthRedirectUri, - ), - $additionalParams - ); - - //update configuration - static::updateOAuthToken($oAuthToken); - - return $oAuthToken; - } - - /** - * Refresh the OAuth token - * @param array|string|null $scope List of scopes needed. Should only be passed if scopes need to be - * changed. - * @param array|null $additionalParams Additional parameters to send during token refresh - * @return \Pipedrive\Models\OAuthToken - */ - public function refreshToken($scope = null, $additionalParams = null) - { - //send request for token refresh - $oAuthToken = $this->oAuthApi->createRefreshToken( - array ( - 'authorization' => $this->buildBasicHeader(), - 'refreshToken' => Configuration::$oAuthToken->refreshToken, - 'scope' => is_array($scope) ? implode(' ', $scope) : $scope, - ), - $additionalParams - ); - - //update configuration - static::updateOAuthToken($oAuthToken); - - return $oAuthToken; - } - - /** - * Has the OAuth token expired? - * @return boolean - */ - public function isTokenExpired() - { - return isset(Configuration::$oAuthToken->expiry) && Configuration::$oAuthToken->expiry < time(); - } - - /** - * Check if client is authorized, else attempt to get token - */ - public function checkAuthorization() - { - //authorization is needed before making API calls - if (Configuration::$oAuthToken->accessToken == null && Configuration::$apiToken == null ) { - throw new Exception('Client is not authorized. An OAuth token or an API token is needed to make API calls.'); - } - - if (Configuration::$apiToken != null ) { - return; - } - - //refresh token if expired - if ($this->isTokenExpired()) { - $this->refreshToken(); - } - } - - /** - * Update OAuth token in configuration - * @param \Pipedrive\Models\OAuthToken $oAuthToken OAuth token - */ - private static function updateOAuthToken($oAuthToken) - { - //add expiry - if ($oAuthToken->expiresIn != null && $oAuthToken->expiresIn != 0) { - $oAuthToken->expiry = time() + $oAuthToken->expiresIn; - } - - //update config and call callback - Configuration::$oAuthToken = $oAuthToken; - - if (is_callable(Configuration::$oAuthTokenUpdateCallback)) { - call_user_func(Configuration::$oAuthTokenUpdateCallback, $oAuthToken); - } - } - - /** - * Build authorization header value for basic auth - * @param string $username Username - * @param string $password Password - * @return string - */ - private static function buildBasicHeader() - { - return 'Basic ' . base64_encode( - Configuration::$oAuthClientId . ':' . Configuration::$oAuthClientSecret - ); - } -} diff --git a/src/Servers.php b/src/Servers.php deleted file mode 100644 index 481cc139..00000000 --- a/src/Servers.php +++ /dev/null @@ -1,24 +0,0 @@ - $value) { - $key = preg_replace_callback( - '/_([^_])/', - function (array $m) { - return ucfirst($m[1]); - }, - $key - ); - - if (is_array($value) || is_object($value)) { - $value = CamelCaseHelper::keysToCamelCase($value); - } - - if (is_object($input)) { - $obj->{$key} = $value; - } else { - $arr[$key] = $value; - } - } - - return is_object($input) ? $obj : $arr; - } -} \ No newline at end of file diff --git a/src/Utils/DateTimeHelper.php b/src/Utils/DateTimeHelper.php deleted file mode 100644 index 256b087c..00000000 --- a/src/Utils/DateTimeHelper.php +++ /dev/null @@ -1,296 +0,0 @@ -format(DateTimeHelper::SIMPLE_DATE); - } else { - throw new Exception('Not a valid DateTime object.'); - } - } - - /** - * Convert an array of DateTime objects to an array of strings in simple date format - * @param $dates The array of DateTime objects to convert - * @return The array of datetime strings in simple date format - */ - public static function toSimpleDateArray($dates) - { - if (is_null($dates)) { - return null; - } else { - return array_map('static::toSimpleDate', $dates); - } - } - - /** - * Parse a datetime string in simple date format to a DateTime object - * @param $date A datetime string in simple date format - * @return The parsed DateTime object - */ - public static function fromSimpleDate($date) - { - if (is_null($date)) { - return null; - } else { - $x = DateTime::createFromFormat(static::SIMPLE_DATE, $date); - - if ($x instanceof DateTime) { - return $x; - } else { - throw new Exception('Incorrect format.'); - } - } - } - - /** - * Parse an array of datetime strings in simple date format to an array of DateTime objects - * @param $dates An array of datetime strings in simple date format - * @return An array of parsed DateTime objects - */ - public static function fromSimpleDateArray($dates) - { - if (is_null($dates)) { - return null; - } else { - return array_map('static::fromSimpleDate', $dates); - } - } - - - /** - * Convert a DateTime object to a string in Rfc1123 format - * @param $datetime The DateTime object to convert - * @return The datetime as a string in Rfc1123 format - */ - public static function toRfc1123DateTime($datetime) - { - if (is_null($datetime)) { - return null; - } elseif ($datetime instanceof DateTime) { - return $datetime->setTimeZone(new DateTimeZone('GMT'))->format(static::RFC1123); - } else { - throw new Exception('Not a valid DateTime object.'); - } - } - - /** - * Convert an array of DateTime objects to an array of strings in Rfc1123 format - * @param $datetimes The array of DateTime objects to convert - * @return The array of datetime strings in Rfc1123 format - */ - public static function toRfc1123DateTimeArray($datetimes) - { - if (is_null($datetimes)) { - return null; - } else { - return array_map('static::toRfc1123DateTime', $datetimes); - } - } - - /** - * Parse a datetime string in Rfc1123 format to a DateTime object - * @param $datetime A datetime string in Rfc1123 format - * @return The parsed DateTime object - */ - public static function fromRfc1123DateTime($datetime) - { - if (is_null($datetime)) { - return null; - } else { - $x = DateTime::createFromFormat(DateTime::RFC1123, $datetime); - - if ($x instanceof DateTime) { - return $x->setTimeZone(new DateTimeZone('GMT')); - } else { - throw new Exception('Incorrect format.'); - } - } - } - - /** - * Parse an array of datetime strings in Rfc1123 format to an array of DateTime objects - * @param $datetimes An array of datetime strings in Rfc1123 format - * @return An array of parsed DateTime objects - */ - public static function fromRfc1123DateTimeArray($datetimes) - { - if (is_null($datetimes)) { - return null; - } else { - return array_map('static::fromRfc1123DateTime', $datetimes); - } - } - - - /** - * Convert a DateTime object to a string in Rfc3339 format - * @param value The DateTime object to convert - * @return The datetime as a string in Rfc3339 format - */ - public static function toRfc3339DateTime($datetime) - { - if (is_null($datetime)) { - return null; - } elseif ($datetime instanceof DateTime) { - return $datetime->setTimeZone(new DateTimeZone('UTC'))->format(DateTime::RFC3339); - } else { - throw new Exception('Not a valid DateTime object.'); - } - } - - /** - * Convert an array of DateTime objects to an array of strings in Rfc3339 format - * @param $datetimes The array of DateTime objects to convert - * @return The array of datetime strings in Rfc3339 format - */ - public static function toRfc3339DateTimeArray($datetimes) - { - if (is_null($datetimes)) { - return null; - } else { - return array_map('static::toRfc3339DateTime', $datetimes); - } - } - - /** - * Parse a datetime string in Rfc3339 format to a DateTime object - * @param $datetime A datetime string in Rfc3339 format - * @return The parsed DateTime object - */ - public static function fromRfc3339DateTime($datetime) - { - if (is_null($datetime)) { - return null; - } else { - // Check for timezone information and append it if missing - if (!(substr($datetime, strlen($datetime)-1) == 'Z' || strpos($datetime, '+'))) { - $datetime .= 'Z'; - } - - $x = DateTime::createFromFormat(DateTime::RFC3339, $datetime); - - if ($x instanceof DateTime) { - return $x->setTimeZone(new DateTimeZone('UTC')); - } else { - $x = DateTime::createFromFormat("Y-m-d\TH:i:s.uP", $datetime); // parse with up to 6 microseconds - if ($x instanceof DateTime) { - return $x->setTimeZone(new DateTimeZone('UTC')); - } else { - $x = DateTime::createFromFormat("Y-m-d\TH:i:s.uuP", $datetime); // parse with up to 12 microseconds - if ($x instanceof DateTime) { - return $x->setTimeZone(new DateTimeZone('UTC')); - } else { - throw new Exception('Incorrect format.'); - } - } - } - } - } - - /** - * Parse an array of datetime strings in Rfc3339 format to an array of DateTime objects - * @param $datetimes An array of datetime strings in Rfc3339 format - * @return An array of parsed DateTime objects - */ - public static function fromRfc3339DateTimeArray($datetimes) - { - if (is_null($datetimes)) { - return null; - } else { - return array_map('static::fromRfc3339DateTime', $datetimes); - } - } - - - /** - * Convert a DateTime object to a Unix Timestamp - * @param value The DateTime object to convert - * @return The converted Unix Timestamp - */ - public static function toUnixTimestamp($datetime) - { - if (is_null($datetime)) { - return null; - } elseif ($datetime instanceof DateTime) { - return $datetime->getTimestamp(); - } else { - throw new Exception('Not a valid DateTime object.'); - } - } - - public static function toUnixTimestampArray($datetimes) - { - if (is_null($datetimes)) { - return null; - } else { - return array_map('static::toUnixTimestamp', $datetimes); - } - } - - /** - * Parse a Unix Timestamp to a DateTime object - * @param $datetime The Unix Timestamp - * @return The parsed DateTime object - */ - public static function fromUnixTimestamp($datetime) - { - if (is_null($datetime)) { - return null; - } else { - $x = DateTime::createFromFormat("U", $datetime); - - if ($x instanceof DateTime) { - return $x; - } else { - throw new Exception('Incorrect format.'); - } - } - } - - /** - * Parse an array of Unix Timestamps to an array of DateTime objects - * @param $datetimes An array of Unix Timestamps - * @return An array of parsed DateTime objects - */ - public static function fromUnixTimestampArray($datetimes) - { - if (is_null($datetimes)) { - return null; - } else { - return array_map('static::fromUnixTimestamp', $datetimes); - } - } -} diff --git a/src/Utils/JsonSerializer.php b/src/Utils/JsonSerializer.php deleted file mode 100644 index a61fbbfd..00000000 --- a/src/Utils/JsonSerializer.php +++ /dev/null @@ -1,24 +0,0 @@ -args = $input; - } - - /** - * Encode this object to JSON - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->args; - } -} diff --git a/test/Activities/ActivityApiTest.php b/test/Activities/ActivityApiTest.php new file mode 100644 index 00000000..a3d73cd6 --- /dev/null +++ b/test/Activities/ActivityApiTest.php @@ -0,0 +1,71 @@ +group('unit'); + +test('list activities', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + [ + 'id' => 1, + 'busy_flag' => true, + ], + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new ActivitiesApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->getActivities()->getData(); + + expect($result[0]->getBusyFlag())->toBe(true); +}); + +test('set correct activity busy_flag type', function (array $dataset) { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + [ + 'id' => 1, + 'busy_flag' => $dataset['busy_flag'], + ], + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new ActivitiesApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->getActivities()->getData(); + + expect($mock->getLastRequest()->getUri())->toEqual('https://api.pipedrive.com/v1/activities') + ->and($result[0]->getBusyFlag())->toBe($dataset['expected']); + })->with([ + 'boolean (false)' => fn() => ['busy_flag' => false, 'expected' => false], + 'boolean (true)' => fn() => ['busy_flag' => true, 'expected' => true], + 'number (0)' => fn() => ['busy_flag' => 0, 'expected' => false], + 'number (1)' => fn() => ['busy_flag' => 1, 'expected' => true], + 'null' => fn() => ['busy_flag' => null, 'expected' => null], +]); \ No newline at end of file diff --git a/test/CallLogs/CallLogsApiTest.php b/test/CallLogs/CallLogsApiTest.php new file mode 100644 index 00000000..a7d4006c --- /dev/null +++ b/test/CallLogs/CallLogsApiTest.php @@ -0,0 +1,133 @@ +group('unit'); + +test('get call log by id', function () { + $config = new Configuration(); + + $callLogId = 'logId'; + $phoneNumber = '+37255123456'; + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'success' => true, + 'data' => [ + 'id' => $callLogId, + 'to_phone_number' => $phoneNumber, + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new CallLogsApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->getCallLog($callLogId); + + expect($result->getSuccess())->toBe(true); + expect($result->getData()->getId())->toBe($callLogId); + expect($result->getData()->getToPhoneNumber())->toBe($phoneNumber); +}); + +test('get all call logs assigned to a user', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'success' => true, + 'data' => [ + [ + 'id' => 'first', + ], + [ + 'id' => 'second', + ], + + ], + 'additional_data' => [ + 'pagination' => [ + 'start' => 0, + 'limit' => 5, + 'more_items_in_collection' => false, + ] + ] + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new CallLogsApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->getUserCallLogs(); + + expect($result->getSuccess())->toBe(true); + expect($result->getData()[0]->getId())->toBe('first'); + expect($result->getData()[1]->getId())->toBe('second'); + expect($result->getAdditionalData()->getPagination()->getStart())->toBe(0); +}); + +test('add a call log', function () { + $config = new Configuration(); + + $outcome = 'connected'; + $toPhoneNumber = '+37255345678'; + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'success' => true, + 'data' => [ + 'outcome' => $outcome, + 'to_phone_number' => $toPhoneNumber, + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new CallLogsApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->addCallLog(); + + expect($result->getSuccess())->toBe(true); + expect($result->getData()->getOutcome())->toBe($outcome); + expect($result->getData()->getToPhoneNumber())->toBe($toPhoneNumber); +}); + +test('delete a call log', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'success' => true, + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new CallLogsApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->deleteCallLog('mockId'); + + expect(json_decode($result))->toMatchObject(['success' => true]); +}); \ No newline at end of file diff --git a/test/Deals/DealsApiTest.php b/test/Deals/DealsApiTest.php new file mode 100644 index 00000000..054ccca4 --- /dev/null +++ b/test/Deals/DealsApiTest.php @@ -0,0 +1,62 @@ +group('unit'); + +it('lists deals', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + [ + 'id' => 1, + ], + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new DealsApi( + new Client(['handler' => $handlerStack]), + $config, + ); + $result = $apiInstance->getDeals(42, 100, 1, 'open'); + + expect($mock->getLastRequest()->getUri()->getQuery())->toEqual('user_id=42&filter_id=100&stage_id=1&status=open&start=0') + ->and($result->getData())->toHaveLength(1); +}); + +it('fetches one deal', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + 'id' => 1, + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $client = new Client(['handler' => $handlerStack]); + + $apiInstance = new DealsApi( + $client, + $config, + ); + $result = $apiInstance->getDeal(1); + + expect($mock->getLastRequest()->getUri())->toEqual('https://api.pipedrive.com/v1/deals/1') + ->and($result->getData()->getId())->toBe(1); +}); diff --git a/test/Leads/LeadsApiTest.php b/test/Leads/LeadsApiTest.php new file mode 100644 index 00000000..deee9dd8 --- /dev/null +++ b/test/Leads/LeadsApiTest.php @@ -0,0 +1,48 @@ +group('unit'); + +it('lists leads', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + [ + 'id' => 42, + 'visible_to' => '7', + ], + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new LeadsApi( + new Client(['handler' => $handlerStack]), + $config, + ); + $result = $apiInstance->getLeads( + 10, + 0, + null, + null, + null, + null, + null, + null, + ); + + expect($mock->getLastRequest()->getUri()->getQuery())->toEqual('limit=10&start=0') + ->and($result->getData())->toHaveLength(1) + ->and($result->getData()[0]->getId())->toEqual(42) + ->and($result->getData()[0]->getVisibleTo())->toEqual('7'); +}); diff --git a/test/MailThreads/MailThreadsApiTest.php b/test/MailThreads/MailThreadsApiTest.php new file mode 100644 index 00000000..158849f3 --- /dev/null +++ b/test/MailThreads/MailThreadsApiTest.php @@ -0,0 +1,63 @@ +group('unit'); + +test('get mail threads', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + ['id' => 42, 'archived_flag' => 0] + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new MailboxApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->getMailThreads('home')->getData(); + + expect($mock->getLastRequest()->getUri())->toEqual('https://api.pipedrive.com/v1/mailbox/mailThreads?folder=home&start=0') + ->and($result)->toHaveLength(1) + ->and($result[0]->getId())->toBe(42) + ->and($result[0]->getArchivedFlag())->toBe(0); +}); + +test('put mail threads', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' =>[ + 'id' => 42, + 'archived_flag' => 1 + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new MailboxApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->updateMailThreadDetails(42, ['archived_flag' => '1'])->getData(); + + expect($mock->getLastRequest()->getUri())->toEqual('https://api.pipedrive.com/v1/mailbox/mailThreads/42') + ->and($result->getArchivedFlag())->toBe(1); +}); \ No newline at end of file diff --git a/test/Pest.php b/test/Pest.php new file mode 100644 index 00000000..5949c617 --- /dev/null +++ b/test/Pest.php @@ -0,0 +1,45 @@ +in('Feature'); + +/* +|-------------------------------------------------------------------------- +| Expectations +|-------------------------------------------------------------------------- +| +| When you're writing tests, you often need to check that values meet certain conditions. The +| "expect()" function gives you access to a set of "expectations" methods that you can use +| to assert different things. Of course, you may extend the Expectation API at any time. +| +*/ + +expect()->extend('toBeOne', function () { + return $this->toBe(1); +}); + +/* +|-------------------------------------------------------------------------- +| Functions +|-------------------------------------------------------------------------- +| +| While Pest is very powerful out-of-the-box, you may have some testing code specific to your +| project that you don't want to repeat in every file. Here you can also expose helpers as +| global functions to help you to reduce the number of lines of code in your test files. +| +*/ + +function something() +{ + // .. +} diff --git a/test/Recents/RecentsApiTest.php b/test/Recents/RecentsApiTest.php new file mode 100644 index 00000000..d43dc53e --- /dev/null +++ b/test/Recents/RecentsApiTest.php @@ -0,0 +1,53 @@ +group('unit'); + +it('lists recents', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + [ + 'id' => 1, + 'item' => 'activity', + 'data' => [ + 'id' => 1, + 'attendees' => [[ 'name' => 'First' ]] + ] + ], + [ + 'id' => 2, + 'item' => 'deal', + 'data' => [ + 'id' => 2, + 'attendees' => [[ 'name' => 'Second' ]] + ] + ], + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new RecentsApi( + new Client(['handler' => $handlerStack]), + $config, + ); + $result = $apiInstance->getRecents('2023-06-12 12:13:14'); + + expect($mock->getLastRequest()->getUri())->toEqual('https://api.pipedrive.com/v1/recents?since_timestamp=2023-06-12%2012%3A13%3A14&start=0') + ->and($result->getData()[0]->getId())->toEqual(1) + ->and($result->getData()[0]->getItem())->toEqual('activity') + ->and($result->getData()[0]->getData())->toHaveKey('id') + ->and($result->getData()[0]->getData()['id'])->toEqual(1) + ->and($result->getData()[0]->getData()['attendees'])->toHaveLength(1); +}); diff --git a/test/Stages/StagesApiTest.php b/test/Stages/StagesApiTest.php new file mode 100644 index 00000000..266c0d7c --- /dev/null +++ b/test/Stages/StagesApiTest.php @@ -0,0 +1,45 @@ +group('unit'); + +test('get stage details with correct type casting', function () { + $config = new Configuration(); + + $mock = $this->httpMock(); + $mock->append( + new Response(200, [], json_encode([ + 'data' => [ + 'id' => '1', + 'rotten_flag' => 0, + 'active_flag' => 1, + 'rotten_days' => null, + 'update_time' => null, + 'name' => 'Qualified', + 'pipeline_name' => 'Pipeline', + ], + ])), + ); + + $handlerStack = HandlerStack::create($mock); + + $apiInstance = new StagesApi( + new Client(['handler' => $handlerStack]), + $config + ); + + $result = $apiInstance->getStage(1)->getData(); + + expect($mock->getLastRequest()->getUri())->toEqual('https://api.pipedrive.com/v1/stages/1') + ->and($result->getId())->toBe(1) + ->and($result->getRottenFlag())->toBe(false) + ->and($result->getActiveFlag())->toBe(true) + ->and($result->getRottenDays())->toBe(null) + ->and($result->getUpdateTime())->toBe(null); +}); \ No newline at end of file diff --git a/test/TestCase.php b/test/TestCase.php new file mode 100644 index 00000000..07e1a401 --- /dev/null +++ b/test/TestCase.php @@ -0,0 +1,26 @@ + 'Bar'], null), + new Response(202, ['Content-Length' => 0]), + new RequestException('Error Communicating with Server', new Request('GET', '/mock')) + ]); + + $mock->reset(); + + return $mock; + } + +} diff --git a/tests/Controllers/ActivitiesControllerTest.php b/tests/Controllers/ActivitiesControllerTest.php deleted file mode 100644 index 506fc67c..00000000 --- a/tests/Controllers/ActivitiesControllerTest.php +++ /dev/null @@ -1,75 +0,0 @@ -getActivities(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns all activities assigned to a particular user. - */ - public function testTestGetAllActivitiesAssignedToAParticularUser() - { - // Parameters for the API call - $input = array(); - $input['userId'] = null; - $input['filterId'] = null; - $input['type'] = null; - $input['start'] = 0; - $input['limit'] = null; - $input['startDate'] = null; - $input['endDate'] = null; - $input['done'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllActivitiesAssignedToAParticularUser($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/ActivityFieldsControllerTest.php b/tests/Controllers/ActivityFieldsControllerTest.php deleted file mode 100644 index 4a0be45d..00000000 --- a/tests/Controllers/ActivityFieldsControllerTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getActivityFields(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Return list of all fields for activity - */ - public function testTestGetAllFieldsForAnActivity() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllFieldsForAnActivity(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/ActivityTypesControllerTest.php b/tests/Controllers/ActivityTypesControllerTest.php deleted file mode 100644 index cb12ffc1..00000000 --- a/tests/Controllers/ActivityTypesControllerTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getActivityTypes(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns all activity types - */ - public function testTestGetAllActivityTypes() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllActivityTypes(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/CurrenciesControllerTest.php b/tests/Controllers/CurrenciesControllerTest.php deleted file mode 100644 index ef5beb03..00000000 --- a/tests/Controllers/CurrenciesControllerTest.php +++ /dev/null @@ -1,92 +0,0 @@ -getCurrencies(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns all supported currencies in given account which should be used when saving monetary values with other objects. The 'code' parameter of the returning objects is the currency code according to ISO 4217 for all non-custom currencies. - */ - public function testTestGetAllSupportedCurrencies() - { - // Parameters for the API call - $term = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllSupportedCurrencies($term); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"code\":\"EUR\",\"name\":\"Euro\",\"decimal_points\":2,\"symb" . - "ol\":\"€\",\"active_flag\":true,\"is_custom_flag\":false},{\"id\":2,\"code\":\"USD\",\"name\":\"US D" . - "ollar\",\"decimal_points\":2,\"symbol\":\"$\",\"active_flag\":true,\"is_custom_flag\":false}]}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/DealFieldsControllerTest.php b/tests/Controllers/DealFieldsControllerTest.php deleted file mode 100644 index eda78eab..00000000 --- a/tests/Controllers/DealFieldsControllerTest.php +++ /dev/null @@ -1,91 +0,0 @@ -getDealFields(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all fields deals can have - */ - public function testTestGetAllDealFields() - { - // Parameters for the API call - $input = array(); - $input['start'] = 0; - $input['limit'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllDealFields($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new deal field. For more information on adding a new custom field, see this tutorial. - */ - public function testTestAddANewDealField() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addANewDealField($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/DealsControllerTest.php b/tests/Controllers/DealsControllerTest.php deleted file mode 100644 index adcf5ae0..00000000 --- a/tests/Controllers/DealsControllerTest.php +++ /dev/null @@ -1,266 +0,0 @@ -getDeals(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns all deals. For more information on how to get all deals, see this tutorial. - */ - public function testTestGetAllDeals() - { - // Parameters for the API call - $input = array(); - $input['userId'] = null; - $input['filterId'] = null; - $input['stageId'] = null; - $input['status'] = TestHelper::getJsonMapper()->mapClass(json_decode( - 'all_not_deleted'), - 'Pipedrive\\Models\\string' - ); - $input['start'] = 0; - $input['limit'] = null; - $input['sort'] = null; - $input['ownedByYou'] = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllDeals($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"creator_user_id\":{\"id\":9258618,\"name\":\"Creator\",\"ema" . - "il\":\"creator@pipedrive.com\",\"has_pic\":false,\"pic_hash\":\"null\",\"active_flag\":true,\"value" . - "\":9258618},\"user_id\":{\"id\":9258618,\"name\":\"Creator\",\"email\":\"creator@pipedrive.com\",\"h" . - "as_pic\":false,\"pic_hash\":\"null\",\"active_flag\":true,\"value\":9258618},\"person_id\":{\"active" . - "_flag\":true,\"name\":\"Person\",\"email\":[{\"label\":\"work\",\"value\":\"person@pipedrive.com\"," . - "\"primary\":true}],\"phone\":[{\"label\":\"work\",\"value\":\"37244499911\",\"primary\":true}],\"val" . - "ue\":1101},\"org_id\":{\"name\":\"Organization\",\"people_count\":2,\"owner_id\":9258618,\"address\"" . - ":\"Mustamäe tee 3a, 10615 Tallinn\",\"active_flag\":true,\"cc_email\":\"org@pipedrivemail.com\",\"va" . - "lue\":5},\"stage_id\":2,\"title\":\"Deal One\",\"value\":5000,\"currency\":\"EUR\",\"add_time\":\"20" . - "19-05-29 04:21:51\",\"update_time\":\"2019-11-28 16:19:50\",\"stage_change_time\":\"2019-11-28 15:41" . - ":22\",\"active\":true,\"deleted\":false,\"status\":\"open\",\"probability\":null,\"next_activity_dat" . - "e\":\"2019-11-29\",\"next_activity_time\":\"11:30:00\",\"next_activity_id\":128,\"last_activity_id\"" . - ":null,\"last_activity_date\":\"null\",\"lost_reason\":\"null\",\"visible_to\":\"1\",\"close_time\":" . - "\"null\",\"pipeline_id\":1,\"won_time\":\"2019-11-27 11:40:36\",\"first_won_time\":\"2019-11-27 11:4" . - "0:36\",\"lost_time\":\"null\",\"products_count\":0,\"files_count\":0,\"notes_count\":2,\"followers_c" . - "ount\":0,\"email_messages_count\":4,\"activities_count\":1,\"done_activities_count\":0,\"undone_acti" . - "vities_count\":1,\"reference_activities_count\":0,\"participants_count\":1,\"expected_close_date\":" . - "\"2019-06-29\",\"last_incoming_mail_time\":\"2019-05-29 18:21:42\",\"last_outgoing_mail_time\":\"201" . - "9-05-30 03:45:35\",\"label\":\"null\",\"stage_order_nr\":2,\"person_name\":\"Person\",\"org_name\":" . - "\"Organization\",\"next_activity_subject\":\"Call\",\"next_activity_type\":\"call\",\"next_activity_" . - "duration\":\"00:30:00\",\"next_activity_note\":\"Note content\",\"formatted_value\":\"€5,000\",\"wei" . - "ghted_value\":5000,\"formatted_weighted_value\":\"€5,000\",\"weighted_value_currency\":\"EUR\",\"rot" . - "ten_time\":\"null\",\"owner_name\":\"Creator\",\"cc_email\":\"company+deal1@pipedrivemail.com\",\"or" . - "g_hidden\":false,\"person_hidden\":false}],\"related_objects\":{\"user\":{\"9258618\":{\"id\":925861" . - "8,\"name\":\"Creator\",\"email\":\"creator@pipedrive.com\",\"has_pic\":false,\"pic_hash\":null,\"act" . - "ive_flag\":true}},\"organization\":{\"5\":{\"id\":5,\"name\":\"Organization\",\"people_count\":2,\"o" . - "wner_id\":9258618,\"address\":\"Mustamäe tee 3a, 10615 Tallinn\",\"active_flag\":true,\"cc_email\":" . - "\"org@pipedrivemail.com\"}},\"person\":{\"1101\":{\"active_flag\":true,\"id\":1101,\"name\":\"Person" . - "\",\"email\":[{\"label\":\"work\",\"value\":\"person@pipedrive.com\",\"primary\":true}],\"phone\":[{" . - "\"label\":\"work\",\"value\":\"3421787767\",\"primary\":true}]}}},\"additional_data\":{\"pagination" . - "\":{\"start\":0,\"limit\":100,\"more_items_in_collection\":false,\"next_start\":1}}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } - - /** - * Adds a new deal. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for 'key' values. For more information on how to add a deal, see this tutorial. - */ - public function testTestAddADeal() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->addADeal($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":{\"id\":1,\"creator_user_id\":{\"id\":9258618,\"name\":\"Creator\",\"emai" . - "l\":\"creator@pipedrive.com\",\"has_pic\":false,\"pic_hash\":\"null\",\"active_flag\":true,\"value\"" . - ":9258618},\"user_id\":{\"id\":9258618,\"name\":\"Creator\",\"email\":\"creator@pipedrive.com\",\"has" . - "_pic\":false,\"pic_hash\":\"null\",\"active_flag\":true,\"value\":9258618},\"person_id\":{\"active_f" . - "lag\":true,\"name\":\"Person\",\"email\":[{\"label\":\"work\",\"value\":\"person@pipedrive.com\",\"p" . - "rimary\":true}],\"phone\":[{\"label\":\"work\",\"value\":\"37244499911\",\"primary\":true}],\"value" . - "\":1101},\"org_id\":{\"name\":\"Organization\",\"people_count\":2,\"owner_id\":9258618,\"address\":" . - "\"null\",\"active_flag\":true,\"cc_email\":\"org@pipedrivemail.com\",\"value\":5},\"stage_id\":2,\"t" . - "itle\":\"Deal One\",\"value\":5000,\"currency\":\"EUR\",\"add_time\":\"2019-05-29 04:21:51\",\"updat" . - "e_time\":\"2019-11-28 16:19:50\",\"stage_change_time\":\"2019-11-28 15:41:22\",\"active\":true,\"del" . - "eted\":false,\"status\":\"open\",\"probability\":null,\"next_activity_date\":\"2019-11-29\",\"next_a" . - "ctivity_time\":\"11:30:00\",\"next_activity_id\":128,\"last_activity_id\":null,\"last_activity_date" . - "\":\"null\",\"lost_reason\":\"null\",\"visible_to\":\"1\",\"close_time\":\"null\",\"pipeline_id\":1," . - "\"won_time\":\"2019-11-27 11:40:36\",\"first_won_time\":\"2019-11-27 11:40:36\",\"lost_time\":\"null" . - "\",\"products_count\":0,\"files_count\":0,\"notes_count\":2,\"followers_count\":0,\"email_messages_c" . - "ount\":4,\"activities_count\":1,\"done_activities_count\":0,\"undone_activities_count\":1,\"referenc" . - "e_activities_count\":0,\"participants_count\":1,\"expected_close_date\":\"2019-06-29\",\"last_incomi" . - "ng_mail_time\":\"2019-05-29 18:21:42\",\"last_outgoing_mail_time\":\"2019-05-30 03:45:35\",\"label\"" . - ":\"null\",\"stage_order_nr\":2,\"person_name\":\"Person\",\"org_name\":\"Organization\",\"next_activ" . - "ity_subject\":\"Call\",\"next_activity_type\":\"call\",\"next_activity_duration\":\"00:30:00\",\"nex" . - "t_activity_note\":\"Note content\",\"formatted_value\":\"€5,000\",\"weighted_value\":5000,\"formatte" . - "d_weighted_value\":\"€5,000\",\"weighted_value_currency\":\"EUR\",\"rotten_time\":\"null\",\"owner_n" . - "ame\":\"Creator\",\"cc_email\":\"company+deal1@pipedrivemail.com\",\"org_hidden\":false,\"person_hid" . - "den\":false},\"additional_data\":{\"matches_filters\":[1]},\"related_objects\":{\"user\":{\"9258618" . - "\":{\"id\":9258618,\"name\":\"Creator\",\"email\":\"creator@pipedrive.com\",\"has_pic\":false,\"pic_" . - "hash\":null,\"active_flag\":true}},\"organization\":{\"2\":{\"id\":2,\"name\":\"Organization\",\"peo" . - "ple_count\":2,\"owner_id\":9258618,\"address\":\"Mustamäe tee 3a, 10615 Tallinn\",\"active_flag\":tr" . - "ue,\"cc_email\":\"org@pipedrivemail.com\"}},\"person\":{\"1101\":{\"active_flag\":true,\"id\":1101," . - "\"name\":\"Person\",\"email\":[{\"label\":\"work\",\"value\":\"person@pipedrive.com\",\"primary\":tr" . - "ue}],\"phone\":[{\"label\":\"work\",\"value\":\"3421787767\",\"primary\":true}]}}}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } - - /** - * Returns summary of all the deals. - */ - public function testTestGetDealsSummary() - { - // Parameters for the API call - $input = array(); - $input['status'] = null; - $input['filterId'] = null; - $input['userId'] = null; - $input['stageId'] = null; - $input['pipelineId'] = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getDealsSummary($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":{\"values_total\":{\"EUR\":{\"value\":10,\"count\":2,\"value_converted\":" . - "11.1,\"value_formatted\":\"€10\",\"value_converted_formatted\":\"US$11.10\"},\"USD\":{\"value\":30," . - "\"count\":3,\"value_converted\":30,\"value_formatted\":\"US$30\",\"value_converted_formatted\":\"US$" . - "3\"}},\"weighted_values_total\":{\"EUR\":{\"value\":10,\"count\":2,\"value_formatted\":\"€10\"},\"US" . - "D\":{\"value\":30,\"count\":3,\"value_formatted\":\"US$30\"}},\"total_count\":5,\"total_currency_con" . - "verted_value\":41.1,\"total_weighted_currency_converted_value\":41.1,\"total_currency_converted_valu" . - "e_formatted\":\"US$41.1\",\"total_weighted_currency_converted_value_formatted\":\"US$41.1\"}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/FilesControllerTest.php b/tests/Controllers/FilesControllerTest.php deleted file mode 100644 index 879d8098..00000000 --- a/tests/Controllers/FilesControllerTest.php +++ /dev/null @@ -1,70 +0,0 @@ -getFiles(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all files. - */ - public function testTestGetAllFiles() - { - // Parameters for the API call - $input = array(); - $input['start'] = 0; - $input['limit'] = null; - $input['includeDeletedFiles'] = null; - $input['sort'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllFiles($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/FiltersControllerTest.php b/tests/Controllers/FiltersControllerTest.php deleted file mode 100644 index 9c114252..00000000 --- a/tests/Controllers/FiltersControllerTest.php +++ /dev/null @@ -1,87 +0,0 @@ -getFilters(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all filters - */ - public function testTestGetAllFilters() - { - // Parameters for the API call - $type = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllFilters($type); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information on how filter’s helpers can be used, see this tutorial. - */ - public function testTestGetAllFilterHelpers() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllFilterHelpers(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/GoalsControllerTest.php b/tests/Controllers/GoalsControllerTest.php deleted file mode 100644 index 747730ac..00000000 --- a/tests/Controllers/GoalsControllerTest.php +++ /dev/null @@ -1,103 +0,0 @@ -getGoals(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Adds a new goal. - */ - public function testTestAddANewGoal() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addANewGoal($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Returns data about goals based on criteria. For searching, append `{searchField}={searchValue}` to the URL, where `searchField` can be any one of the lowest-level fields in dot-notation (e.g. `type.params.pipeline_id`; `title`). `searchValue` should be the value you are looking for on that field. Additionally, `is_active=` can be provided to search for only active/inactive goals. When providing `period.start`, `period.end` must also be provided and vice versa. - */ - public function testTestFindGoals() - { - // Parameters for the API call - $input = array(); - $input['typeName'] = null; - $input['title'] = null; - $input['isActive'] = True; - $input['assigneeId'] = null; - $input['assigneeType'] = null; - $input['expectedOutcomeTarget'] = null; - $input['expectedOutcomeTrackingMetric'] = null; - $input['expectedOutcomeCurrencyId'] = null; - $input['typeParamsPipelineId'] = null; - $input['typeParamsStageId'] = null; - $input['typeParamsActivityTypeId'] = null; - $input['periodStart'] = null; - $input['periodEnd'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->findGoals($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/MailThreadsControllerTest.php b/tests/Controllers/MailThreadsControllerTest.php deleted file mode 100644 index c22df698..00000000 --- a/tests/Controllers/MailThreadsControllerTest.php +++ /dev/null @@ -1,110 +0,0 @@ -getMailThreads(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns mail threads in specified folder ordered by most recent message within. - */ - public function testTestGetMailThreads() - { - // Parameters for the API call - $input = array(); - $input['folder'] = TestHelper::getJsonMapper()->mapClass(json_decode( - 'inbox'), - 'Pipedrive\\Models\\string' - ); - $input['start'] = 0; - $input['limit'] = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getMailThreads($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"parties\":{\"to\":[{\"id\":2,\"name\":\"\",\"latest_sent\":f" . - "alse,\"email_address\":\"example@test.com\",\"message_time\":1574677850000,\"linked_person_id\":3,\"" . - "linked_person_name\":\"Tester\",\"linked_organization_id\":null,\"mail_message_party_id\":5318}],\"f" . - "rom\":[{\"id\":3,\"name\":\"\",\"latest_sent\":false,\"email_address\":\"example@test.com\",\"messag" . - "e_time\":1574677850000,\"linked_person_id\":2,\"linked_person_name\":\"Tester\",\"linked_organizatio" . - "n_id\":null,\"mail_message_party_id\":5318}]},\"drafts_parties\":[],\"folders\":[\"inbox\"],\"accoun" . - "t_id\":\"123412jhfsaa221\",\"user_id\":232,\"version\":9,\"subject\":\"Example\",\"snippet\":\"Examp" . - "le Snippet\",\"snippet_draft\":null,\"snippet_sent\":\"\",\"has_attachments_flag\":1,\"has_inline_at" . - "tachments_flag\":1,\"has_real_attachments_flag\":0,\"has_draft_flag\":0,\"has_sent_flag\":0,\"archiv" . - "ed_flag\":0,\"deleted_flag\":0,\"shared_flag\":1,\"synced_flag\":1,\"external_deleted_flag\":0,\"sma" . - "rt_bcc_flag\":0,\"first_message_to_me_flag\":1,\"mail_link_tracking_enabled_flag\":0,\"last_message_" . - "timestamp\":\"2019-11-20T20:20:46.000Z\",\"first_message_timestamp\":\"2019-11-20T17:40:46.000Z\",\"" . - "last_message_sent_timestamp\":null,\"last_message_received_timestamp\":\"2019-11-20T20:20:46.000Z\"," . - "\"add_time\":\"2019-11-20T17:40:59.000Z\",\"update_time\":\"2019-11-20T20:21:22.000Z\",\"deal_id\":n" . - "ull,\"deal_status\":null,\"write_flag\":true,\"all_messages_sent_flag\":0}]}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/NoteFieldsControllerTest.php b/tests/Controllers/NoteFieldsControllerTest.php deleted file mode 100644 index 822032b9..00000000 --- a/tests/Controllers/NoteFieldsControllerTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getNoteFields(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Return list of all fields for note - */ - public function testTestGetAllFieldsForANote() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllFieldsForANote(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/NotesControllerTest.php b/tests/Controllers/NotesControllerTest.php deleted file mode 100644 index a53cd694..00000000 --- a/tests/Controllers/NotesControllerTest.php +++ /dev/null @@ -1,109 +0,0 @@ -getNotes(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns all notes. - */ - public function testTestGetAllNotes() - { - // Parameters for the API call - $input = array(); - $input['userId'] = null; - $input['dealId'] = null; - $input['personId'] = null; - $input['orgId'] = null; - $input['start'] = 0; - $input['limit'] = null; - $input['sort'] = null; - $input['startDate'] = null; - $input['endDate'] = null; - $input['pinnedToDealFlag'] = null; - $input['pinnedToOrganizationFlag'] = null; - $input['pinnedToPersonFlag'] = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllNotes($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"active_flag\":true,\"add_time\":\"2019-12-09 13:59:21\",\"co" . - "ntent\":\"abc\",\"deal\":{\"title\":\"Deal title\"},\"deal_id\":1,\"last_update_user_id\":1,\"org_id" . - "\":1,\"organization\":{\"name\":\"Organization name\"},\"person\":{\"name\":\"Person name\"},\"perso" . - "n_id\":1,\"pinned_to_deal_flag\":true,\"pinned_to_organization_flag\":false,\"pinned_to_person_flag" . - "\":false,\"update_time\":\"2019-12-09 14:26:11\",\"user\":{\"email\":\"user@email.com\",\"icon_url\"" . - ":\"https://iconurl.net/profile_120x120_123.jpg\",\"is_you\":true,\"name\":\"User Name\"},\"user_id\"" . - ":1}],\"additional_data\":{\"limit\":100,\"more_items_in_collection\":false,\"start\":0}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/OrganizationFieldsControllerTest.php b/tests/Controllers/OrganizationFieldsControllerTest.php deleted file mode 100644 index 6b314089..00000000 --- a/tests/Controllers/OrganizationFieldsControllerTest.php +++ /dev/null @@ -1,87 +0,0 @@ -getOrganizationFields(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all organization fields - */ - public function testTestGetAllOrganizationFields() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllOrganizationFields(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new organization field. For more information on adding a new custom field, see this tutorial. - */ - public function testTestAddANewOrganizationField() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addANewOrganizationField($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/OrganizationRelationshipsControllerTest.php b/tests/Controllers/OrganizationRelationshipsControllerTest.php deleted file mode 100644 index 3d5b2646..00000000 --- a/tests/Controllers/OrganizationRelationshipsControllerTest.php +++ /dev/null @@ -1,66 +0,0 @@ -getOrganizationRelationships(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Creates and returns an organization relationship. - */ - public function testTestCreateAnOrganizationRelationship() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->createAnOrganizationRelationship($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/OrganizationsControllerTest.php b/tests/Controllers/OrganizationsControllerTest.php deleted file mode 100644 index f2bb25e5..00000000 --- a/tests/Controllers/OrganizationsControllerTest.php +++ /dev/null @@ -1,95 +0,0 @@ -getOrganizations(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns all organizations - */ - public function testTestGetAllOrganizations() - { - // Parameters for the API call - $input = array(); - $input['userId'] = null; - $input['filterId'] = null; - $input['firstChar'] = null; - $input['start'] = 0; - $input['limit'] = null; - $input['sort'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllOrganizations($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for 'key' values. For more information on how to add an organization, see this tutorial. - */ - public function testTestAddAnOrganization() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addAnOrganization($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/PermissionSetsControllerTest.php b/tests/Controllers/PermissionSetsControllerTest.php deleted file mode 100644 index c8456f5d..00000000 --- a/tests/Controllers/PermissionSetsControllerTest.php +++ /dev/null @@ -1,90 +0,0 @@ -getPermissionSets(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Get all Permission Sets - */ - public function testTestGetAllPermissionSets() - { - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllPermissionSets(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"name\":\"Admin user\",\"assignment_count\":1},{\"id\":2,\"na" . - "me\":\"Regular user\",\"assignment_count\":3},{\"id\":3,\"name\":\"Manager\",\"assignment_count\":0}" . - "]}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/PersonFieldsControllerTest.php b/tests/Controllers/PersonFieldsControllerTest.php deleted file mode 100644 index 2890e0e9..00000000 --- a/tests/Controllers/PersonFieldsControllerTest.php +++ /dev/null @@ -1,91 +0,0 @@ -getPersonFields(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all person fields - */ - public function testTestGetAllPersonFields() - { - // Parameters for the API call - $input = array(); - $input['start'] = 0; - $input['limit'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllPersonFields($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new person field. For more information on adding a new custom field, see this tutorial. - */ - public function testTestAddANewPersonField() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addANewPersonField($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/PersonsControllerTest.php b/tests/Controllers/PersonsControllerTest.php deleted file mode 100644 index 363ce558..00000000 --- a/tests/Controllers/PersonsControllerTest.php +++ /dev/null @@ -1,118 +0,0 @@ -getPersons(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Marks multiple persons as deleted. - */ - public function testTestDeleteMultiplePersonsInBulk() - { - // Parameters for the API call - $ids = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->deleteMultiplePersonsInBulk($ids); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Returns all persons - */ - public function testTestGetAllPersons() - { - // Parameters for the API call - $input = array(); - $input['userId'] = null; - $input['filterId'] = null; - $input['firstChar'] = null; - $input['start'] = 0; - $input['limit'] = null; - $input['sort'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllPersons($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for 'key' values. - */ - public function testTestAddAPerson() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addAPerson($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/PipelinesControllerTest.php b/tests/Controllers/PipelinesControllerTest.php deleted file mode 100644 index 548bbbdf..00000000 --- a/tests/Controllers/PipelinesControllerTest.php +++ /dev/null @@ -1,92 +0,0 @@ -getPipelines(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all pipelines - */ - public function testTestGetAllPipelines() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllPipelines(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new pipeline - */ - public function testTestAddANewPipeline() - { - // Parameters for the API call - $input = array(); - $input['name'] = null; - $input['dealProbability'] = null; - $input['orderNr'] = null; - $input['active'] = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addANewPipeline($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/ProductFieldsControllerTest.php b/tests/Controllers/ProductFieldsControllerTest.php deleted file mode 100644 index b88288c6..00000000 --- a/tests/Controllers/ProductFieldsControllerTest.php +++ /dev/null @@ -1,96 +0,0 @@ -getProductFields(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Adds a new product field. For more information on adding a new custom field, see this tutorial. - */ - public function testTestAddANewProductField() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->addANewProductField($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":{\"id\":32,\"key\":\"397b0f545d134b479a5485041b33b0f0f3da2333\",\"name\":" . - "\"Color\",\"order_nr\":13,\"field_type\":\"enum\",\"add_time\":\"2019-12-20 11:01:24\",\"update_time" . - "\":\"2019-12-20 11:01:24\",\"last_updated_by_user_id\":10999910,\"active_flag\":true,\"edit_flag\":t" . - "rue,\"index_visible_flag\":true,\"details_visible_flag\":true,\"add_visible_flag\":true,\"important_" . - "flag\":false,\"bulk_edit_allowed\":true,\"searchable_flag\":false,\"filtering_allowed\":true,\"sorta" . - "ble_flag\":true,\"options\":\"[{\\\"id\\\":9,\\\"label\\\":\\\"red\\\"},{\\\"id\\\":10,\\\"label\\\"" . - ":\\\"blue\\\"},{\\\"id\\\":11,\\\"label\\\":\\\"lilac\\\"}]\",\"mandatory_flag\":false}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/ProductsControllerTest.php b/tests/Controllers/ProductsControllerTest.php deleted file mode 100644 index 17c5bc1d..00000000 --- a/tests/Controllers/ProductsControllerTest.php +++ /dev/null @@ -1,126 +0,0 @@ -getProducts(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all products. - */ - public function testTestGetAllProducts() - { - // Parameters for the API call - $input = array(); - $input['userId'] = null; - $input['filterId'] = null; - $input['firstChar'] = null; - $input['start'] = 0; - $input['limit'] = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllProducts($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"name\":\"Mechanical Pencil\",\"code\":\"MPENCIL\",\"descript" . - "ion\":null,\"unit\":null,\"tax\":0,\"category\":null,\"active_flag\":true,\"selectable\":true,\"firs" . - "t_char\":\"m\",\"visible_to\":\"3\",\"owner_id\":{\"id\":10100010,\"name\":\"Test User\",\"email\":" . - "\"example@test.com\",\"has_pic\":true,\"pic_hash\":\"5df5332929fab76702207f38b29a5d88\",\"active_fla" . - "g\":true,\"value\":10100010},\"files_count\":null,\"followers_count\":0,\"add_time\":\"2019-12-19 11" . - ":36:49\",\"update_time\":\"2019-12-19 11:36:49\",\"prices\":[{\"id\":1,\"product_id\":1,\"price\":5," . - "\"currency\":\"EUR\",\"cost\":2,\"overhead_cost\":null}]}],\"additional_data\":{},\"related_objects" . - "\":null,\"user\":{\"10100010\":{\"id\":10100010,\"name\":\"Test User\",\"email\":\"example@test.com" . - "\",\"has_pic\":true,\"pic_hash\":\"5df5332929fab76702207f38b29a5d88\",\"active_flag\":true}}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } - - /** - * Adds a new product to the products inventory. For more information on how to add a product, see this tutorial. - */ - public function testTestAddAProduct() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addAProduct($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/RolesControllerTest.php b/tests/Controllers/RolesControllerTest.php deleted file mode 100644 index c67164fe..00000000 --- a/tests/Controllers/RolesControllerTest.php +++ /dev/null @@ -1,90 +0,0 @@ -getRoles(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Add a role - */ - public function testTestAddARole() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->addARole($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - '{"success":true,"data":{"id":2}}', - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/StagesControllerTest.php b/tests/Controllers/StagesControllerTest.php deleted file mode 100644 index 9b0ea843..00000000 --- a/tests/Controllers/StagesControllerTest.php +++ /dev/null @@ -1,89 +0,0 @@ -getStages(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all stages - */ - public function testTestGetAllStages() - { - // Parameters for the API call - $pipelineId = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->getAllStages($pipelineId); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } - - /** - * Adds a new stage, returns the ID upon success. - */ - public function testTestAddANewStage() - { - // Parameters for the API call - $body = null; - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->addANewStage($body); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/TeamsControllerTest.php b/tests/Controllers/TeamsControllerTest.php deleted file mode 100644 index 5b07b25a..00000000 --- a/tests/Controllers/TeamsControllerTest.php +++ /dev/null @@ -1,99 +0,0 @@ -getTeams(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about teams within the company - */ - public function testTestGetAllTeams() - { - // Parameters for the API call - $input = array(); - $input['orderBy'] = TestHelper::getJsonMapper()->mapClass(json_decode( - 'id'), - 'Pipedrive\\Models\\string' - ); - $input['skipUsers'] = null; - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllTeams($input); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"name\":\"Closers\",\"description\":\"Berlin office Sales Tea" . - "m\",\"manager_id\":4,\"users\":[2,3,4,5],\"active_flag\":1,\"deleted_flag\":0,\"add_time\":\"2019-10" . - "-07 09:06:09\",\"created_by_user_id\":2},{\"id\":2,\"name\":\"Coffee\",\"description\":\"London offi" . - "ce Sales Team\",\"manager_id\":7,\"users\":[5,8],\"active_flag\":0,\"deleted_flag\":0,\"add_time\":" . - "\"2018-04-11 12:54:43\",\"created_by_user_id\":7}]}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/UserConnectionsControllerTest.php b/tests/Controllers/UserConnectionsControllerTest.php deleted file mode 100644 index 5c2061df..00000000 --- a/tests/Controllers/UserConnectionsControllerTest.php +++ /dev/null @@ -1,88 +0,0 @@ -getUserConnections(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all connections for authorized user. - */ - public function testTestGetAllUserConnections() - { - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllUserConnections(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - '{"success":true,"data":{"google":"awesomeid-123-4567890"}}', - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/UserSettingsControllerTest.php b/tests/Controllers/UserSettingsControllerTest.php deleted file mode 100644 index d30c5f70..00000000 --- a/tests/Controllers/UserSettingsControllerTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getUserSettings(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Lists settings of authorized user. - */ - public function testTestListSettingsOfAuthorizedUser() - { - - // Set callback and perform API call - self::$controller->setHttpCallBack($this->httpResponse); - try { - self::$controller->listSettingsOfAuthorizedUser(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - } -} diff --git a/tests/Controllers/UsersControllerTest.php b/tests/Controllers/UsersControllerTest.php deleted file mode 100644 index d850ec5e..00000000 --- a/tests/Controllers/UsersControllerTest.php +++ /dev/null @@ -1,151 +0,0 @@ -getUsers(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all users within the company - */ - public function testTestGetAllUsers() - { - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllUsers(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":[{\"id\":1,\"name\":\"John Doe\",\"default_currency\":\"EUR\",\"locale\":" . - "\"et_EE\",\"lang\":1,\"email\":\"john@pipedrive.com\",\"phone\":\"0000-0001\",\"activated\":true,\"l" . - "ast_login\":\"2019-11-21 08:45:56\",\"created\":\"2018-11-13 09:16:26\",\"modified\":\"2019-11-21 08" . - ":45:56\",\"signup_flow_variation\":\"google\",\"has_created_company\":true,\"is_admin\":1,\"active_f" . - "lag\":true,\"timezone_name\":\"Europe/Berlin\",\"timezone_offset\":\"+03:00\",\"role_id\":1,\"icon_u" . - "rl\":\"https://upload.wikimedia.org/wikipedia/en/thumb/e/e0/WPVG_icon_2016.svg/1024px-WPVG_icon_2016" . - ".svg.png\",\"is_you\":true},{\"id\":2,\"name\":\"Jane Doe\",\"default_currency\":\"EUR\",\"locale\":" . - "\"et_EE\",\"lang\":1,\"email\":\"jane@pipedrive.com\",\"phone\":\"0000-0002\",\"activated\":true,\"l" . - "ast_login\":\"2019-09-11 11:43:54\",\"created\":\"2019-01-22 10:43:47\",\"modified\":\"2019-11-21 09" . - ":49:50\",\"signup_flow_variation\":null,\"has_created_company\":false,\"is_admin\":0,\"active_flag\"" . - ":true,\"timezone_name\":\"Europe/Berlin\",\"timezone_offset\":\"+03:00\",\"role_id\":1,\"icon_url\":" . - "null,\"is_you\":false}]}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } - - /** - * Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the 'locale' property means 'Date and number format' in the Pipedrive settings, not the chosen language. - */ - public function testTestGetCurrentUserData() - { - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getCurrentUserData(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"success\":true,\"data\":{\"id\":1,\"name\":\"Me\",\"default_currency\":\"EUR\",\"locale\":\"et_EE" . - "\",\"lang\":1,\"email\":\"me@pipedrive.com\",\"phone\":\"0000-0000\",\"activated\":true,\"last_login" . - "\":\"2019-11-21 08:45:56\",\"created\":\"2018-11-13 09:16:26\",\"modified\":\"2019-11-21 08:45:56\"," . - "\"signup_flow_variation\":\"google\",\"has_created_company\":true,\"is_admin\":1,\"active_flag\":tru" . - "e,\"timezone_name\":\"Europe/Berlin\",\"timezone_offset\":\"+03:00\",\"role_id\":1,\"icon_url\":\"ht" . - "tps://upload.wikimedia.org/wikipedia/en/thumb/e/e0/WPVG_icon_2016.svg/1024px-WPVG_icon_2016.svg.png" . - "\",\"is_you\":true,\"company_id\":54235233,\"company_name\":\"Pipedrive\",\"company_domain\":\"piped" . - "rive-12g53f\",\"language\":{\"language_code\":\"en\",\"country_code\":\"US\"}}}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/Controllers/WebhooksControllerTest.php b/tests/Controllers/WebhooksControllerTest.php deleted file mode 100644 index 32fb7e51..00000000 --- a/tests/Controllers/WebhooksControllerTest.php +++ /dev/null @@ -1,92 +0,0 @@ -getWebhooks(); - } - - /** - * Setup test - */ - protected function setUp() - { - $this->httpResponse = new HttpCallBackCatcher(); - } - - /** - * Returns data about all webhooks of a company. - */ - public function testTestGetAllWebhooks() - { - - // Set callback and perform API call - $result = null; - self::$controller->setHttpCallBack($this->httpResponse); - try { - $result = self::$controller->getAllWebhooks(); - } catch (APIException $e) { - } - - // Test response code - $this->assertEquals( - 200, - $this->httpResponse->getResponse()->getStatusCode(), - "Status is not 200" - ); - - // Test headers - $headers = []; - $headers['Content-Type'] = 'application/json' ; - - $this->assertTrue( - TestHelper::areHeadersProperSubsetOf($headers, $this->httpResponse->getResponse()->getHeaders(), true), - "Headers do not match" - ); - - // Test whether the captured response is as we expected - $this->assertNotNull($result, "Result does not exist"); - - $this->assertTrue( - TestHelper::isJsonObjectProperSubsetOf( - "{\"status\":\"ok\",\"success\":true,\"data\":[{\"id\":1,\"company_id\":1,\"owner_id\":1,\"user_id\":" . - "1,\"event_action\":\"added\",\"event_object\":\"activityType\",\"subscription_url\":\"http://example" . - ".org\",\"is_active\":1,\"add_time\":\"2019-10-25T08:25:27.000Z\",\"remove_time\":null,\"type\":\"gen" . - "eral\",\"http_auth_user\":\"test\",\"http_auth_password\":\"test\",\"additional_data\":{},\"remove_r" . - "eason\":null,\"last_delivery_time\":null,\"last_http_status\":null,\"admin_id\":1}]}", - $this->httpResponse->getResponse()->getRawBody(), - false, - true, - false - ), - "Response body does not match in keys" - ); - } -} diff --git a/tests/HttpCallBackCatcher.php b/tests/HttpCallBackCatcher.php deleted file mode 100644 index f5a001f7..00000000 --- a/tests/HttpCallBackCatcher.php +++ /dev/null @@ -1,58 +0,0 @@ -request = $httpContext->getRequest(); - $instance->response = $httpContext->getResponse(); - }); - } - - /** - * Get the HTTP Request object associated with this API call - * @return Pipedrive\Http\HttpRequest - */ - public function getRequest() - { - return $this->request; - } - - /** - * Get the HTTP Response object associated with this API call - * @return Pipedrive\Http\HttpResponse - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/tests/TestHelper.php b/tests/TestHelper.php deleted file mode 100644 index 5098836c..00000000 --- a/tests/TestHelper.php +++ /dev/null @@ -1,348 +0,0 @@ - $eV) { - $found = false; - foreach (array_values($response) as $rK => $rV) { - if ($eV == $rV) - $found = true; - } - if ($found == false) { - throw new \Exception("Response array is missing values"); - } - } - } - - /** - * Recursively check whether the leftTree is a proper subset of the right tree - * @param array $leftTree Left tree - * @param array $rightTree Right tree - * @param boolean $checkValues Check primitive values for equality? - * @param boolean $allowExtra Are extra elements allowed in right array? - * @param boolean $isOrdered Should elements in right be compared in order to left? - * @return boolean True if leftTree is a subset of rightTree - */ - public static function isProperSubsetOf( - array $leftTree = null, - array $rightTree = null, - $checkValues, - $allowExtra, - $isOrdered - ) { - - if ($leftTree == null) { - return true; - } - - for ($iterator = new \ArrayIterator($leftTree); $iterator->valid(); $iterator->next()) { - $key = $iterator->key(); - $leftVal = $leftTree[$key]; - $rightVal = $rightTree[$key]; - - // Check if key exists - if (!array_key_exists($key, $rightTree)) { - return false; - } - if (static::isAssoc($leftVal)) { - // If left value is tree, right value should be be tree too - if (static::isAssoc($rightVal)) { - if (!static::isProperSubsetOf( - $leftVal, - $rightVal, - $checkValues, - $allowExtra, - $isOrdered - )) { - return false; - } - } else { - return false; - } - } else { - // Value comparison if checkValues - if ($checkValues) { - // If left value is a primitive, check if it equals right value - if (is_array($leftVal)) { - if (!is_array($rightVal)) { - return false; - } - if (count($leftVal) > 0 && static::isAssoc($leftVal[0])) { - if (!static::isArrayOfJsonObjectsProperSubsetOf( - $leftVal, - $rightVal, - $checkValues, - $allowExtra, - $isOrdered - )) { - return false; - } - } else { - if (!static::isListProperSubsetOf( - $leftVal, - $rightVal, - $allowExtra, - $isOrdered - )) { - return false; - } - } - } elseif (!$leftVal == $rightTree[$key] && !$leftVal == null) { - return false; - } - } - } - } - return true; - } - - /** - * Recursively check whether the left JSON object is a proper subset of the right JSON object - * @param array $leftObject Left JSON object as string - * @param array $rightObject Right JSON object as string - * @param boolean $checkValues Check primitive values for equality? - * @param boolean $allowExtra Are extra elements allowed in right array? - * @param boolean $isOrdered Should elements in right be compared in order to left? - * @return boolean If Json object is a subset - */ - public static function isJsonObjectProperSubsetOf( - $leftObject, - $rightObject, - $checkValues, - $allowExtra, - $isOrdered - ) { - - return static::isProperSubsetOf( - APIHelper::deserialize($leftObject), - APIHelper::deserialize($rightObject), - $checkValues, - $allowExtra, - $isOrdered - ); - } - - /** - * Check if left array of objects is a subset of right array - * @param array $leftObject Left array as a JSON string - * @param array $rightObject Right array as a JSON string - * @param boolean $checkValues Check primitive values for equality? - * @param boolean $allowExtra Are extra elements allowed in right array? - * @param boolean $isOrdered Should elements in right be compared in order to left? - * @return boolean True if it is a subset - */ - public static function isArrayOfStringifiedJsonObjectsProperSubsetOf( - $leftObject, - $rightObject, - $checkValues, - $allowExtra, - $isOrdered - ) { - - // Deserialize left and right objects from their respective strings - $left = APIHelper::deserialize($leftObject); - $right = APIHelper::deserialize($rightObject); - - return static::isArrayOfJsonObjectsProperSubsetOf( - $left, - $right, - $checkValues, - $allowExtra, - $isOrdered - ); - } - - /** - * Check if left array of objects is a subset of right array - * @param array $left Left array as a JSON string - * @param array $right Right array as a JSON string - * @param boolean $checkValues Check primitive values for equality? - * @param boolean $allowExtra Are extra elements allowed in right array? - * @param boolean $isOrdered Should elements in right be compared in order to left? - * @return boolean True if it is a subset - */ - public static function isArrayOfJsonObjectsProperSubsetOf( - $left, - $right, - $checkValues, - $allowExtra, - $isOrdered - ) { - - // Return false if size different and checking was strict - if (!$allowExtra && count($left) != count($right)) { - return false; - } - - // Create list iterators - $leftIter = (new \ArrayObject($left))->getIterator(); - $rightIter = (new \ArrayObject($right))->getIterator(); - - // Iterate left list and check if each value is present in the right list - while ($leftIter->valid()) { - $leftIter->next(); - $leftTree = $leftIter->current(); - $found = false; - - // If order is not required, then search right array from beginning - if (!$isOrdered) { - $rightIter->rewind(); - } - - // Check each right element to see if left is a subset - while ($rightIter->valid()) { - $rightIter->next(); - if (static::isProperSubsetOf( - $leftTree, - $rightIter->current(), - $checkValues, - $allowExtra, - $isOrdered - )) { - $found = true; - break; - } - } - - if (!$found) { - return false; - } - } - - return true; - } - - /** - * Check whether the a list is a subset of another list - * @param array $leftList Expected List - * @param array $rightList List to check - * @param boolean $allowExtra Are extras allowed in the list to check? - * @param boolean $isOrdered Should checking be in order? - * @return boolean True if leftList is a subset of rightList - */ - public static function isListProperSubsetOf( - array $leftList, - array $rightList, - $allowExtra, - $isOrdered - ) { - - if ($isOrdered && !$allowExtra) { - return $leftList === $rightList; - } elseif ($isOrdered && $allowExtra) { - return array_slice($rightList, 0, count($leftList)) === $leftList; - } elseif (!$isOrdered && !$allowExtra) { - return count($leftList) == count($rightList) && - array_intersect($leftList, $rightList) == $leftList; - } elseif (!$isOrdered && $allowExtra) { - return array_intersect($leftList, $rightList) == $leftList; - } - return true; - } - - /** - * Recursively check whether the left headers map is a proper subset of - * the right headers map. Header keys & values are compared case-insensitive. - * - * @param array $leftTree Left headers map - * @param array $rightTree Right headers map - * @param boolean $checkValues Check header values for equality? - * @return boolean True if leftTree is a subset of rightTree - */ - public static function areHeadersProperSubsetOf( - array $leftTree, - array $rightTree, - $checkValues - ) { - - // Http headers are case-insensitive - $l = array_change_key_case($leftTree); - $r = array_change_key_case($rightTree); - - return static::isProperSubsetOf($l, $r, $checkValues, true, false); - } - - /** - * Is array associative? - * @param mixed $array Input - * @return boolean True if associative array - */ - public static function isAssoc($array) - { - if (!is_array($array)) { - return false; - } - - // Keys of the array - $keys = array_keys($array); - - // If the array keys of the keys match the keys, then the array must - // not be associative (e.g. the keys array looked like {0:0, 1:1...}). - return array_keys($keys) !== $keys; - } - - /** - * Downloads and gets a local path to a file URL. - * Subsequent calls to the same URL will get the cached file. - * @param string $url URL of the file to download - * @return string Local path to the file - */ - public static function getFile($url) - { - $filename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "sdktests" . sha1($url) . "tmp"; - if (!file_exists($filename)) { - file_put_contents($filename, fopen($url, 'r')); - } - return $filename; - } - - /** - * Downloads and gets contents of a file URL. - * Subsequent calls to the same URL will get the cached file. - * @param string $url URL of the file to download - * @return binary File contents - */ - public static function getFileContents($url) - { - return file_get_contents(static::getFile($url)); - } - - /** - * Get a new JsonMapper instance for mapping objects - * @return \apimatic\jsonmapper\JsonMapper JsonMapper instance - */ - public static function getJsonMapper() - { - $mapper = new JsonMapper(); - return $mapper; - } - -} diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 90bb6797..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,15 +0,0 @@ -